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
2 files
+ 22
16
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -42,7 +42,9 @@
@@ -42,7 +42,9 @@
#include <dune/elasticity/materials/neumannenergy.hh>
#include <dune/elasticity/materials/neumannenergy.hh>
#include <dune/elasticity/materials/sumenergy.hh>
#include <dune/elasticity/materials/sumenergy.hh>
 
#if HAVE_DUNE_VTK
#include <dune/vtk/writers/vtkunstructuredgridwriter.hh>
#include <dune/vtk/writers/vtkunstructuredgridwriter.hh>
 
#endif
#include <iostream>
#include <iostream>
#include <fstream>
#include <fstream>
@@ -418,21 +420,25 @@ int main (int argc, char *argv[]) try
@@ -418,21 +420,25 @@ 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));
}
}
#if HAVE_DUNE_VTK
displacement = x;
if (grid->leafGridView().comm().size() == 1) {
displacement -= identity;
displacement = x;
auto finalDisplacementFunction = Dune::Functions::makeDiscreteGlobalBasisFunction<FieldVector<double,dim>>(feBasis, displacement);
displacement -= identity;
//Write out the grid using an unstructured GridWriter
auto finalDisplacementFunction = Dune::Functions::makeDiscreteGlobalBasisFunction<FieldVector<double,dim>>(feBasis, displacement);
VtkUnstructuredGridWriter<GridView> vtkUnstructuredGridWriter(gridView, Vtk::ASCII);
//Write out the grid using an unstructured GridWriter
vtkUnstructuredGridWriter.addPointData(finalDisplacementFunction, "displacement");
VtkUnstructuredGridWriter<GridView> vtkUnstructuredGridWriter(gridView, Vtk::ASCII);
vtkUnstructuredGridWriter.write(resultPath + "finite-strain_homotopy_original");
vtkUnstructuredGridWriter.addPointData(finalDisplacementFunction, "displacement");
std::ofstream file;
vtkUnstructuredGridWriter.write(resultPath + "finite-strain_homotopy_original");
file.open("deformation");
std::ofstream file;
for (auto& d : displacement){
file.open("deformation");
file << d << "\n";
for (auto& d : displacement){
 
file << d << "\n";
 
}
 
file.close();
 
} else if (mpiHelper.rank() == 0) {
 
std::cout << "Not writing out the deformation to a file, this currently only works for sequential calculations" << std::endl;
}
}
file.close();
#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;
Loading