From c6ac12d89f66285a902d3c33599a7702d7e8729f Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Thu, 15 Mar 2012 07:20:43 +0000 Subject: [PATCH] add a cpp switch to toggle between the curl- and non-curl versions of the curvature energy [[Imported from SVN: r8567]] --- dune/gfe/cosseratenergystiffness.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dune/gfe/cosseratenergystiffness.hh b/dune/gfe/cosseratenergystiffness.hh index 48ac41ef..c290db1f 100644 --- a/dune/gfe/cosseratenergystiffness.hh +++ b/dune/gfe/cosseratenergystiffness.hh @@ -14,6 +14,7 @@ #include <dune/gfe/tensor3.hh> #include <dune/gfe/orthogonalmatrix.hh> +#define DONT_USE_CURL template<class GridView, class LocalFiniteElement, int dim> class CosseratEnergyLocalStiffness : public LocalGeodesicFEStiffness<GridView,LocalFiniteElement,RigidBodyMotion<double,dim> > @@ -295,7 +296,11 @@ public: RT curvatureEnergy(const Tensor3<double,3,3,3>& DR) const { +#ifdef DONT_USE_CURL + return mu_ * std::pow(L_c_ * DR.frobenius_norm(),q_); +#else return mu_ * std::pow(L_c_ * curl(DR).frobenius_norm(),q_); +#endif } RT bendingEnergy(const Dune::FieldMatrix<double,dim,dim>& R, const Tensor3<double,3,3,3>& DR) const @@ -610,6 +615,9 @@ curvatureEnergyGradient(typename TargetSpace::EmbeddedTangentVector& embeddedLoc const Tensor3<double,3,3,3>& DR, const Dune::array<Tensor3<double,3,3,4>, 3>& dDR_dv) const { +#ifndef DONT_USE_CURL +#error curvatureEnergyGradient not implemented for the curl curvature energy +#endif embeddedLocalGradient = 0; for (size_t v_i=0; v_i<4; v_i++) { -- GitLab