Skip to content
Snippets Groups Projects
Commit 2610fdd2 authored by lisa_julia.nebel_at_tu-dresden.de's avatar lisa_julia.nebel_at_tu-dresden.de
Browse files

Print stretch in x-direction at the end

parent f5252f04
No related branches found
No related tags found
1 merge request!19PARMG cleanup, write out deformationfunction to a file, Continue the trustregionsolver with a smaller trustregion radius in case of an exception
This commit is part of merge request !19. Comments created here will be created in the context of that merge request.
...@@ -263,6 +263,11 @@ int main (int argc, char *argv[]) try ...@@ -263,6 +263,11 @@ int main (int argc, char *argv[]) try
Dune::Functions::interpolate(powerBasis, identity, [](FieldVector<double,dim> x){ return x; }); Dune::Functions::interpolate(powerBasis, identity, [](FieldVector<double,dim> x){ return x; });
SolutionType displacement = 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; displacement -= identity;
auto displacementFunction = Dune::Functions::makeDiscreteGlobalBasisFunction<FieldVector<double,dim>>(feBasis, displacement); auto displacementFunction = Dune::Functions::makeDiscreteGlobalBasisFunction<FieldVector<double,dim>>(feBasis, displacement);
...@@ -415,6 +420,9 @@ int main (int argc, char *argv[]) try ...@@ -415,6 +420,9 @@ int main (int argc, char *argv[]) try
vtkWriter.addVertexData(displacementFunction, VTK::FieldInfo("displacement", VTK::FieldInfo::Type::vector, dim)); vtkWriter.addVertexData(displacementFunction, VTK::FieldInfo("displacement", VTK::FieldInfo::Type::vector, dim));
vtkWriter.write(resultPath + "finite-strain_homotopy_" + std::to_string(i+1)); 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 HAVE_DUNE_VTK
if (grid->leafGridView().comm().size() == 1) { if (grid->leafGridView().comm().size() == 1) {
displacement = x; displacement = x;
...@@ -434,8 +442,10 @@ int main (int argc, char *argv[]) try ...@@ -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; std::cout << "Not writing out the deformation to a file, this currently only works for sequential calculations" << std::endl;
} }
#endif #endif
if (mpiHelper.rank()==0) if (mpiHelper.rank()==0) {
std::cout << "Complete duration: " << homotopyTimer.elapsed() << " sec." << std::endl; 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) { } catch (Exception& e) {
std::cout << e.what() << std::endl; std::cout << e.what() << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment