From c538116dfd7990094d867c232fc7a25f0cdb430a Mon Sep 17 00:00:00 2001 From: Jonathan Youett <youett@mi.fu-berlin.de> Date: Wed, 17 Apr 2013 13:16:42 +0000 Subject: [PATCH] -rename member configuration_ to what it actually is: the displacement -bugfix: compute the determinant of the deformation gradient and not of the displacement gradient -fix include [[Imported from SVN: r11293]] --- .../assemblers/neohookefunctionalassembler.hh | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/dune/elasticity/assemblers/neohookefunctionalassembler.hh b/dune/elasticity/assemblers/neohookefunctionalassembler.hh index 2292b8d..d4dc7d3 100644 --- a/dune/elasticity/assemblers/neohookefunctionalassembler.hh +++ b/dune/elasticity/assemblers/neohookefunctionalassembler.hh @@ -9,7 +9,7 @@ #include <dune/fufem/symmetrictensor.hh> #include <dune/fufem/functions/virtualgridfunction.hh> -#include <dune/elasticity/common/elasticityhelper.hh> +#include <dune/elasticity/common/elasticityhelpers.hh> /** \brief Local assembler for the linearization of a nonlinear Neo-Hookean energy at a displacement u * @@ -56,7 +56,7 @@ public: NeoHookeFunctionalAssembler(ctype lambda, ctype mu, const Dune::shared_ptr<GridFunction> displacement) : lambda_(lambda), mu_(mu), - configuration_(configuration) + displacement_(displacement) {} //! Create assembler from material parameters @@ -117,29 +117,24 @@ public: } - // evaluate the displacement gradients of the configuration at the quadrature point + // evaluate the displacement gradient at the quadrature point typename GridFunction::DerivativeType localConfGrad; - if (configuration_->isDefinedOn(*element)) - configuration_->evaluateDerivativeLocal(*element, quadPos, localConfGrad); + if (displacement_->isDefinedOn(*element)) + displacement_->evaluateDerivativeLocal(*element, quadPos, localConfGrad); else - configuration_->evaluateDerivative(geometry.global(quadPos),localConfGrad); - - // evaluate the derminante of the deformation gradient - const ctype J = localConfGrad.determinant(); + displacement_->evaluateDerivative(geometry.global(quadPos),localConfGrad); // compute linearization of the determinante of the deformation gradient FMdimdim linDefDet; Dune::Elasticity::linearisedDefDet(localConfGrad,linDefDet); - - - /* Compute the nonlinear strain tensor from the displacement gradient*/ - SymmetricTensor<dim> strain; - computeStrain(localConfGrad,strain); // make deformation gradient out of the discplacement for (int i=0;i<dim;i++) localConfGrad[i][i] += 1; + // evaluate the derminante of the deformation gradient + const ctype J = localConfGrad.determinant(); + // collect terms FMdimdim fu(0); @@ -162,8 +157,8 @@ public: } /** \brief Set new configuration. In Newton iterations this needs to be assembled more than one time.*/ - void setConfiguration(Dune::shared_ptr<GridFunction> newConfig) { - configuration_ = newConfig; + void setConfiguration(Dune::shared_ptr<GridFunction> newDisplacement) { + displacement_ = newDisplacement; } private: @@ -174,7 +169,7 @@ private: ctype mu_; /** \brief The configuration at which the functional is evaluated.*/ - Dune::shared_ptr<GridFunction> configuration_; + Dune::shared_ptr<GridFunction> displacement_; }; #endif -- GitLab