Skip to content
Snippets Groups Projects
Commit 95de8e2d authored by Lisa Julia Nebel's avatar Lisa Julia Nebel
Browse files

Implement the missing option: MIXED_SPACE for dim != dimworld in cosserat-continuum

parent 76831121
No related branches found
No related tags found
1 merge request!120Correct the stopping criterion in the Riemannian-TR-Solver,...
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include <dune/gfe/localgeodesicfefunction.hh> #include <dune/gfe/localgeodesicfefunction.hh>
#include <dune/gfe/localprojectedfefunction.hh> #include <dune/gfe/localprojectedfefunction.hh>
#include <dune/gfe/localgeodesicfeadolcstiffness.hh>
#include <dune/gfe/mixedlocalgfeadolcstiffness.hh> #include <dune/gfe/mixedlocalgfeadolcstiffness.hh>
#include <dune/gfe/cosseratenergystiffness.hh> #include <dune/gfe/cosseratenergystiffness.hh>
#include <dune/gfe/nonplanarcosseratshellenergy.hh> #include <dune/gfe/nonplanarcosseratshellenergy.hh>
...@@ -540,20 +539,50 @@ int main (int argc, char *argv[]) try ...@@ -540,20 +539,50 @@ int main (int argc, char *argv[]) try
x[_1][i] = xTargetSpace[i].q; x[_1][i] = xTargetSpace[i].q;
} }
#endif #endif
} else { } else { //dim != dimworld
#if MIXED_SPACE using StiffnessType = MixedLocalGFEADOLCStiffness<CompositeBasis, RealTuple<double,3>, Rotation<double,3>>;
DUNE_THROW(Exception, "Problems with dim != dimworld do not work for MIXED_SPACE = 1!"); std::shared_ptr<StiffnessType> localGFEStiffness;
#else
std::shared_ptr<LocalGeodesicFEADOLCStiffness<DeformationFEBasis, TargetSpace>> localGFEADOLCStiffness;
NonplanarCosseratShellEnergy<DeformationFEBasis, 3, adouble> localCosseratEnergyPlanar(materialParameters, NonplanarCosseratShellEnergy< CompositeBasis, 3, adouble,
Dune::Functions::DiscreteGlobalBasisFunction< DeformationFEBasis,std::vector<Dune::FieldVector<double, dimworld>> >>
localCosseratEnergyPlanar(materialParameters,
nullptr, nullptr,
&neumannBoundary, &neumannBoundary,
neumannFunction, neumannFunction,
volumeLoad); volumeLoad);
localGFEADOLCStiffness = std::make_shared<LocalGeodesicFEADOLCStiffness<DeformationFEBasis, TargetSpace>>(&localCosseratEnergyPlanar, adolcScalarMode);
GeodesicFEAssembler<DeformationFEBasis,TargetSpace> assembler(gridView, *localGFEADOLCStiffness); localGFEStiffness = std::make_shared<StiffnessType>(&localCosseratEnergyPlanar, adolcScalarMode);
MixedGFEAssembler<CompositeBasis,
RealTuple<double,3>,
Rotation<double,3> > mixedAssembler(compositeBasis, localGFEStiffness.get());
#if MIXED_SPACE
MixedRiemannianTrustRegionSolver<GridType,
CompositeBasis,
DeformationFEBasis, RealTuple<double,3>,
OrientationFEBasis, Rotation<double,3> > solver;
solver.setup(*grid,
&mixedAssembler,
deformationFEBasis,
orientationFEBasis,
x,
deformationDirichletDofs,
orientationDirichletDofs, tolerance,
maxSolverSteps,
initialTrustRegionRadius,
multigridIterations,
mgTolerance,
mu, nu1, nu2,
baseIterations,
baseTolerance,
instrumented);
solver.setScaling(parameterSet.get<FieldVector<double,6> >("trustRegionScaling"));
solver.setInitialIterate(x);
solver.solve();
x = solver.getSol();
#else
//The MixedRiemannianTrustRegionSolver can treat the Displacement and Orientation Space as separate ones //The MixedRiemannianTrustRegionSolver can treat the Displacement and Orientation Space as separate ones
//The RiemannianTrustRegionSolver can only treat the Displacement and Rotation together in a RigidBodyMotion //The RiemannianTrustRegionSolver can only treat the Displacement and Rotation together in a RigidBodyMotion
//Therefore, x and the dirichletDofs are converted to a RigidBodyMotion structure, as well as the Hessian and Gradient that are returned by the assembler //Therefore, x and the dirichletDofs are converted to a RigidBodyMotion structure, as well as the Hessian and Gradient that are returned by the assembler
...@@ -568,9 +597,11 @@ int main (int argc, char *argv[]) try ...@@ -568,9 +597,11 @@ int main (int argc, char *argv[]) try
for (int j = 3; j < TargetSpace::TangentVector::dimension; j ++) for (int j = 3; j < TargetSpace::TangentVector::dimension; j ++)
dirichletDofsTargetSpace[i][j] = orientationDirichletDofs[i][j-3]; dirichletDofsTargetSpace[i][j] = orientationDirichletDofs[i][j-3];
} }
if (parameterSet.get<std::string>("solvertype", "trustRegion") == "trustRegion") {
RiemannianTrustRegionSolver<DeformationFEBasis, TargetSpace> solver; using GFEAssemblerWrapper = Dune::GFE::GeodesicFEAssemblerWrapper<CompositeBasis, DeformationFEBasis, TargetSpace, RealTuple<double, 3>, Rotation<double,3>>;
GFEAssemblerWrapper assembler(&mixedAssembler, deformationFEBasis);
if (parameterSet.get<std::string>("solvertype", "trustRegion") == "trustRegion") {
RiemannianTrustRegionSolver<DeformationFEBasis, TargetSpace, GFEAssemblerWrapper> solver;
solver.setup(*grid, solver.setup(*grid,
&assembler, &assembler,
xTargetSpace, xTargetSpace,
...@@ -590,7 +621,7 @@ int main (int argc, char *argv[]) try ...@@ -590,7 +621,7 @@ int main (int argc, char *argv[]) try
solver.solve(); solver.solve();
xTargetSpace = solver.getSol(); xTargetSpace = solver.getSol();
} else { //parameterSet.get<std::string>("solvertype") == "proximalNewton" } else { //parameterSet.get<std::string>("solvertype") == "proximalNewton"
RiemannianProximalNewtonSolver<DeformationFEBasis, TargetSpace> solver; RiemannianProximalNewtonSolver<DeformationFEBasis, TargetSpace, GFEAssemblerWrapper> solver;
solver.setup(*grid, solver.setup(*grid,
&assembler, &assembler,
xTargetSpace, xTargetSpace,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment