Skip to content
Snippets Groups Projects
Commit 9175ef7d authored by Sander, Oliver's avatar Sander, Oliver
Browse files

Print the average deformation of the output deformation at the end

parent 24cee53a
No related branches found
No related tags found
No related merge requests found
...@@ -195,6 +195,10 @@ int main (int argc, char *argv[]) try ...@@ -195,6 +195,10 @@ int main (int argc, char *argv[]) try
BoundaryPatch<GridView> dirichletBoundary(gridView, dirichletVertices); BoundaryPatch<GridView> dirichletBoundary(gridView, dirichletVertices);
BoundaryPatch<GridView> neumannBoundary(gridView, neumannVertices); BoundaryPatch<GridView> neumannBoundary(gridView, neumannVertices);
BitSetVector<1> neumannNodes(deformationFEBasis.indexSet().size(), false);
constructBoundaryDofs(neumannBoundary,fufemDeformationFEBasis,neumannNodes);
if (mpiHelper.rank()==0) if (mpiHelper.rank()==0)
std::cout << "Neumann boundary has " << neumannBoundary.numFaces() << " faces\n"; std::cout << "Neumann boundary has " << neumannBoundary.numFaces() << " faces\n";
...@@ -352,7 +356,7 @@ int main (int argc, char *argv[]) try ...@@ -352,7 +356,7 @@ int main (int argc, char *argv[]) try
solver.setInitialIterate(xDisp,xOrient); solver.setInitialIterate(xDisp,xOrient);
solver.solve(); solver.solve();
//x = solver.getSol(); std::tie(xDisp,xOrient) = solver.getSol();
// Output result of each homotopy step // Output result of each homotopy step
std::stringstream iAsAscii; std::stringstream iAsAscii;
...@@ -363,6 +367,24 @@ int main (int argc, char *argv[]) try ...@@ -363,6 +367,24 @@ int main (int argc, char *argv[]) try
} }
// //////////////////////////////
// Output result
// //////////////////////////////
// finally: compute the average deformation of the Neumann boundary
// That is what we need for the locking tests
FieldVector<double,3> averageDef(0);
for (size_t i=0; i<xDisp.size(); i++)
if (neumannNodes[i][0])
averageDef += xDisp[i].globalCoordinates();
averageDef /= neumannNodes.count();
if (mpiHelper.rank()==0)
{
std::cout << "Neumann values = " << parameterSet.get<FieldVector<double, 3> >("neumannValues") << " "
<< ", average deflection: " << averageDef << std::endl;
}
} catch (Exception e) { } catch (Exception e) {
std::cout << e << std::endl; std::cout << e << 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