From d14c6b63a98cc3825034df152dcabdf46de098b6 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 24 Mar 2015 09:22:33 +0000 Subject: [PATCH] Use the separate NeumannEnergy class now [[Imported from SVN: r10119]] --- src/finite-strain-elasticity.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/finite-strain-elasticity.cc b/src/finite-strain-elasticity.cc index 6ef8eac9..130640e6 100644 --- a/src/finite-strain-elasticity.cc +++ b/src/finite-strain-elasticity.cc @@ -31,6 +31,8 @@ #include <dune/gfe/localadolcstiffness.hh> #include <dune/gfe/stvenantkirchhoffenergy.hh> +#include <dune/gfe/neumannenergy.hh> +#include <dune/gfe/sumenergy.hh> #include <dune/gfe/feassembler.hh> #include <dune/gfe/trustregionsolver.hh> @@ -239,16 +241,21 @@ int main (int argc, char *argv[]) try } // Assembler using ADOL-C + auto elasticEnergy = std::make_shared<StVenantKirchhoffEnergy<GridView, + FEBasis::LocalFiniteElement, + adouble> >(materialParameters); - StVenantKirchhoffEnergy<GridView, - FEBasis::LocalFiniteElement, - adouble> elasticEnergy(materialParameters, - &neumannBoundary, - neumannFunction.get()); + auto neumannEnergy = std::make_shared<NeumannEnergy<GridView, + FEBasis::LocalFiniteElement, + adouble> >(&neumannBoundary,neumannFunction.get()); + + SumEnergy<GridView, + FEBasis::LocalFiniteElement, + adouble> totalEnergy(elasticEnergy, neumannEnergy); LocalADOLCStiffness<GridView, FEBasis::LocalFiniteElement, - SolutionType> localADOLCStiffness(&elasticEnergy); + SolutionType> localADOLCStiffness(&totalEnergy); FEAssembler<FEBasis,SolutionType> assembler(gridView, &localADOLCStiffness); -- GitLab