From 42c037ba841fe87bd8baad72c424cfe4b712b50f Mon Sep 17 00:00:00 2001 From: Jonathan Youett <youett@math.fu-berlin.de> Date: Tue, 23 Oct 2018 09:19:22 +0200 Subject: [PATCH] Only use adolc if found --- nonlinelast.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/nonlinelast.cc b/nonlinelast.cc index 312cf52..735df39 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()); -- GitLab