Skip to content
Snippets Groups Projects
Commit 5f1c9ab9 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

remove trailing whitespace

[[Imported from SVN: r9268]]
parent 8cba8d42
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& o ...@@ -49,7 +49,7 @@ void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& o
out = 0; out = 0;
for (int i=0; i<dim; i++) for (int i=0; i<dim; i++)
out[i] = in[i]; out[i] = in[i];
out[1] += homotopy; out[1] += homotopy;
} }
#endif #endif
...@@ -59,11 +59,11 @@ void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& o ...@@ -59,11 +59,11 @@ void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& o
{ {
double angle = M_PI/4; double angle = M_PI/4;
angle *= homotopy; angle *= homotopy;
// center of rotation // center of rotation
FieldVector<double,3> center(0); FieldVector<double,3> center(0);
center[1] = 0.5; center[1] = 0.5;
FieldMatrix<double,3,3> rotation(0); FieldMatrix<double,3,3> rotation(0);
rotation[0][0] = 1; rotation[0][0] = 1;
rotation[1][1] = std::cos(angle); rotation[1][1] = std::cos(angle);
...@@ -75,9 +75,9 @@ void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& o ...@@ -75,9 +75,9 @@ void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& o
for (int i=0; i<dim; i++) for (int i=0; i<dim; i++)
inEmbedded[i] = in[i]; inEmbedded[i] = in[i];
inEmbedded -= center; inEmbedded -= center;
rotation.mv(inEmbedded, out); rotation.mv(inEmbedded, out);
out += center; out += center;
} }
...@@ -88,7 +88,7 @@ struct NeumannFunction ...@@ -88,7 +88,7 @@ struct NeumannFunction
NeumannFunction(double homotopyParameter) NeumannFunction(double homotopyParameter)
: homotopyParameter_(homotopyParameter) : homotopyParameter_(homotopyParameter)
{} {}
void evaluate(const FieldVector<double, dim>& x, FieldVector<double,3>& out) const { void evaluate(const FieldVector<double, dim>& x, FieldVector<double,3>& out) const {
out = 0; out = 0;
out[2] = -40*homotopyParameter_; out[2] = -40*homotopyParameter_;
...@@ -157,7 +157,7 @@ int main (int argc, char *argv[]) try ...@@ -157,7 +157,7 @@ int main (int argc, char *argv[]) try
GridType::Codim<dim>::LeafIterator vIt = grid.leafbegin<dim>(); GridType::Codim<dim>::LeafIterator vIt = grid.leafbegin<dim>();
GridType::Codim<dim>::LeafIterator vEndIt = grid.leafend<dim>(); GridType::Codim<dim>::LeafIterator vEndIt = grid.leafend<dim>();
for (; vIt!=vEndIt; ++vIt) { for (; vIt!=vEndIt; ++vIt) {
if (vIt->geometry().corner(0)[0] < 1.0+1e-3 /* or vIt->geometry().corner(0)[0] > upper[0]-1e-3*/ ) { if (vIt->geometry().corner(0)[0] < 1.0+1e-3 /* or vIt->geometry().corner(0)[0] > upper[0]-1e-3*/ ) {
// Only translation dofs are Dirichlet // Only translation dofs are Dirichlet
...@@ -176,9 +176,9 @@ int main (int argc, char *argv[]) try ...@@ -176,9 +176,9 @@ int main (int argc, char *argv[]) try
typedef P1NodalBasis<GridType::LeafGridView,double> P1Basis; typedef P1NodalBasis<GridType::LeafGridView,double> P1Basis;
P1Basis p1Basis(grid.leafView()); P1Basis p1Basis(grid.leafView());
BoundaryPatch<GridType::LeafGridView> neumannBoundary(grid.leafView(), neumannNodes); BoundaryPatch<GridType::LeafGridView> neumannBoundary(grid.leafView(), neumannNodes);
std::cout << "Neumann boundary has " << neumannBoundary.numFaces() << " faces\n"; std::cout << "Neumann boundary has " << neumannBoundary.numFaces() << " faces\n";
// ////////////////////////// // //////////////////////////
...@@ -203,7 +203,7 @@ int main (int argc, char *argv[]) try ...@@ -203,7 +203,7 @@ int main (int argc, char *argv[]) try
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
for (int i=0; i<numHomotopySteps; i++) { for (int i=0; i<numHomotopySteps; i++) {
double homotopyParameter = (i+1)*(1.0/numHomotopySteps); double homotopyParameter = (i+1)*(1.0/numHomotopySteps);
std::cout << "Homotopy step: " << i << ", parameter: " << homotopyParameter << std::endl; std::cout << "Homotopy step: " << i << ", parameter: " << homotopyParameter << std::endl;
...@@ -214,7 +214,7 @@ int main (int argc, char *argv[]) try ...@@ -214,7 +214,7 @@ int main (int argc, char *argv[]) try
const ParameterTree& materialParameters = parameterSet.sub("materialParameters"); const ParameterTree& materialParameters = parameterSet.sub("materialParameters");
NeumannFunction neumannFunction(homotopyParameter); NeumannFunction neumannFunction(homotopyParameter);
std::cout << "Material parameters:" << std::endl; std::cout << "Material parameters:" << std::endl;
materialParameters.report(); materialParameters.report();
...@@ -232,7 +232,7 @@ int main (int argc, char *argv[]) try ...@@ -232,7 +232,7 @@ int main (int argc, char *argv[]) try
// ///////////////////////////////////////////////// // /////////////////////////////////////////////////
RiemannianTrustRegionSolver<GridType,TargetSpace> solver; RiemannianTrustRegionSolver<GridType,TargetSpace> solver;
solver.setup(grid, solver.setup(grid,
&assembler, &assembler,
x, x,
dirichletNodes, dirichletNodes,
...@@ -245,16 +245,16 @@ int main (int argc, char *argv[]) try ...@@ -245,16 +245,16 @@ int main (int argc, char *argv[]) try
baseIterations, baseIterations,
baseTolerance, baseTolerance,
instrumented); instrumented);
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
// Set Dirichlet values // Set Dirichlet values
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
for (vIt=grid.leafbegin<dim>(); vIt!=vEndIt; ++vIt) { for (vIt=grid.leafbegin<dim>(); vIt!=vEndIt; ++vIt) {
int idx = grid.leafIndexSet().index(*vIt); int idx = grid.leafIndexSet().index(*vIt);
if (dirichletNodes[idx][0] and vIt->geometry().corner(0)[0] > upper[0]-1e-3) { if (dirichletNodes[idx][0] and vIt->geometry().corner(0)[0] > upper[0]-1e-3) {
// Only the positions have Dirichlet values // Only the positions have Dirichlet values
dirichletValues(vIt->geometry().corner(0), x[idx].r, dirichletValues(vIt->geometry().corner(0), x[idx].r,
homotopyParameter); homotopyParameter);
...@@ -266,7 +266,7 @@ int main (int argc, char *argv[]) try ...@@ -266,7 +266,7 @@ int main (int argc, char *argv[]) try
// ///////////////////////////////////////////////////// // /////////////////////////////////////////////////////
// Solve! // Solve!
// ///////////////////////////////////////////////////// // /////////////////////////////////////////////////////
std::cout << "Energy: " << assembler.computeEnergy(x) << std::endl; std::cout << "Energy: " << assembler.computeEnergy(x) << std::endl;
//exit(0); //exit(0);
...@@ -276,11 +276,11 @@ int main (int argc, char *argv[]) try ...@@ -276,11 +276,11 @@ int main (int argc, char *argv[]) try
x = solver.getSol(); x = solver.getSol();
} }
// ////////////////////////////// // //////////////////////////////
// Output result // Output result
// ////////////////////////////// // //////////////////////////////
CosseratVTKWriter<GridType>::write(grid,x, resultPath + "cosserat"); CosseratVTKWriter<GridType>::write(grid,x, resultPath + "cosserat");
// finally: compute the average deformation of the Neumann boundary // finally: compute the average deformation of the Neumann boundary
...@@ -290,9 +290,9 @@ int main (int argc, char *argv[]) try ...@@ -290,9 +290,9 @@ int main (int argc, char *argv[]) try
if (neumannNodes[i][0]) if (neumannNodes[i][0])
averageDef += x[i].r; averageDef += x[i].r;
averageDef /= neumannNodes.count(); averageDef /= neumannNodes.count();
std::cout << "mu_c = " << parameterSet.get<double>("materialParameters.mu_c") << " " std::cout << "mu_c = " << parameterSet.get<double>("materialParameters.mu_c") << " "
<< "kappa = " << parameterSet.get<double>("materialParameters.kappa") << " " << "kappa = " << parameterSet.get<double>("materialParameters.kappa") << " "
<< numLevels << " levels, average deflection: " << averageDef << std::endl; << numLevels << " levels, average deflection: " << averageDef << std::endl;
// ////////////////////////////// // //////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment