Skip to content
Snippets Groups Projects
Commit 42c037ba authored by Jonathan Youett's avatar Jonathan Youett
Browse files

Only use adolc if found

parent f292f64a
Branches
Tags
No related merge requests found
......@@ -155,17 +155,19 @@ int main (int argc, char *argv[]) try
typedef P1NodalBasis<GridType::LeafGridView> P1Basis;
P1Basis p1Basis(grid->leafGridView());
//typedef NeoHookeanMaterial<P1Basis> MaterialType;
#if HAVE_ADOLC
MooneyRivlinMaterial<P1Basis> localEnergy(p1Basis,
parameterSet.get<double>("E"),
parameterSet.get<double>("nu"));
using MaterialType = AdolcMaterial<P1Basis>;
MaterialType material(p1Basis, localEnergy, parameterSet.get<bool>("vectorMode"));
/*
#else
using MaterialType = NeoHookeanMaterial<P1Basis>;
MaterialType material(p1Basis,
parameterSet.get<double>("E"),
parameterSet.get<double>("nu"));
*/
#endif
// ///////////////////////////////////////////////////
// Do a homotopy of the Dirichlet boundary data
......@@ -286,7 +288,6 @@ int main (int argc, char *argv[]) try
std::string name = "loadingStep" + std::to_string(loadFactor);
amiramesh2.write(resultPath + name, 1);
} while (loadFactor < 1);
......@@ -306,11 +307,17 @@ int main (int argc, char *argv[]) try
// Create the materials
typedef P2NodalBasis<GridType::LeafGridView> P2Basis;
P2Basis p2Basis(grid->leafGridView());
#if HAVE_ADOLC
typedef MooneyRivlinMaterial<P2Basis> MaterialType2;
MaterialType2 p2localEnergy(p2Basis, parameterSet.get<field_type>("E"),
parameterSet.get<field_type>("nu"));
AdolcMaterial<P2Basis> p2Material(p2Basis, p2localEnergy, false);
#else
using MaterialType2 = NeoHookeanMaterial<P2Basis>;
MaterialType material(p2Basis,
parameterSet.get<double>("E"),
parameterSet.get<double>("nu"));
#endif
// P2 Forces
VectorType p2ExtForces(p2Basis.size());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment