Skip to content
Snippets Groups Projects

PARMG cleanup, write out deformationfunction to a file, Continue the trustregionsolver with a smaller trustregion radius in case of an exception

Closed lisa_julia.nebel_at_tu-dresden.de requested to merge (removed):master into master
1 unresolved thread
1 file
+ 11
1
Compare changes
  • Side-by-side
  • Inline
@@ -263,6 +263,11 @@ int main (int argc, char *argv[]) try
Dune::Functions::interpolate(powerBasis, identity, [](FieldVector<double,dim> x){ return x; });
SolutionType displacement = x;
double max_x = 0;
double initial_max_x = 0;
for (auto& coord: x) {
initial_max_x = std::max(coord[0], initial_max_x);
}
displacement -= identity;
auto displacementFunction = Dune::Functions::makeDiscreteGlobalBasisFunction<FieldVector<double,dim>>(feBasis, displacement);
@@ -415,6 +420,9 @@ int main (int argc, char *argv[]) try
vtkWriter.addVertexData(displacementFunction, VTK::FieldInfo("displacement", VTK::FieldInfo::Type::vector, dim));
vtkWriter.write(resultPath + "finite-strain_homotopy_" + std::to_string(i+1));
}
for (auto& coord : x) {
max_x = std::max(coord[0], max_x);
}
#if HAVE_DUNE_VTK
if (grid->leafGridView().comm().size() == 1) {
displacement = x;
@@ -434,8 +442,10 @@ int main (int argc, char *argv[]) try
std::cout << "Not writing out the deformation to a file, this currently only works for sequential calculations" << std::endl;
}
#endif
if (mpiHelper.rank()==0)
if (mpiHelper.rank()==0) {
std::cout << "Complete duration: " << homotopyTimer.elapsed() << " sec." << std::endl;
std::cout << "Maximal value in x-direction: " << max_x << ", this is a stretch in of " << 100*(max_x - initial_max_x)/initial_max_x << " %." << std::endl;
}
} catch (Exception& e) {
std::cout << e.what() << std::endl;
Loading