diff --git a/nonlinelast.cc b/nonlinelast.cc index 312cf521b8d7469fe4f7360837711177b5de6038..735df39486391c53086ca09403eb505398723c84 100644 --- a/nonlinelast.cc +++ b/nonlinelast.cc @@ -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());