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

Store the local energy in a pointer to the base class, rather than by value

This allows to select the energy at run-time, but this is not what we do.
It also allows to give extra parameters to the nonplanar Cosserat energy,
and that is what we need: in a subsequent patch the main program will compute
a surface normal field and pass it to the Nonplanar Cosserat energy.
parent e3984639
No related branches found
No related tags found
No related merge requests found
......@@ -298,16 +298,27 @@ int main (int argc, char *argv[]) try
}
// Assembler using ADOL-C
using LocalEnergy = std::conditional<dim==dimworld,
CosseratEnergyLocalStiffness<FEBasis,3,adouble>,
NonplanarCosseratShellEnergy<FEBasis,3,adouble> >::type;
LocalEnergy cosseratEnergyADOLCLocalStiffness(materialParameters,
&neumannBoundary,
neumannFunction,
volumeLoad);
using LocalEnergyBase = LocalGeodesicFEStiffness<FEBasis,RigidBodyMotion<adouble,3> >;
std::shared_ptr<LocalEnergyBase> cosseratEnergyADOLCLocalStiffness;
if (dim==dimworld)
{
cosseratEnergyADOLCLocalStiffness = std::make_shared<CosseratEnergyLocalStiffness<FEBasis,3,adouble> >(materialParameters,
&neumannBoundary,
neumannFunction,
volumeLoad);
}
else
{
cosseratEnergyADOLCLocalStiffness = std::make_shared<NonplanarCosseratShellEnergy<FEBasis,3,adouble> >(materialParameters,
&neumannBoundary,
neumannFunction,
volumeLoad);
}
LocalGeodesicFEADOLCStiffness<FEBasis,
TargetSpace> localGFEADOLCStiffness(&cosseratEnergyADOLCLocalStiffness);
TargetSpace> localGFEADOLCStiffness(cosseratEnergyADOLCLocalStiffness.get());
GeodesicFEAssembler<FEBasis,TargetSpace> assembler(gridView, &localGFEADOLCStiffness);
......
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