Skip to content
Snippets Groups Projects
Commit 6591c627 authored by Lisa Julia Nebel's avatar Lisa Julia Nebel
Browse files

Fix the usage of Dune::power

parent e070ff5f
No related branches found
No related tags found
1 merge request!59Correct the iterative calculation of the polar decomposition and its derivative
...@@ -307,15 +307,15 @@ energy(const typename Basis::LocalView& localView, ...@@ -307,15 +307,15 @@ energy(const typename Basis::LocalView& localView,
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
// Add the membrane energy density // Add the membrane energy density
auto energyDensity = (thickness_ - K*Dune::Power<3>::eval(thickness_) / 12.0) * W_m(Ee) auto energyDensity = (thickness_ - K*Dune::power(thickness_,3) / 12.0) * W_m(Ee)
+ (Dune::Power<3>::eval(thickness_) / 12.0 - K * Dune::Power<5>::eval(thickness_) / 80.0)*W_m(Ee*b + c*Ke) + (Dune::power(thickness_,3) / 12.0 - K * Dune::power(thickness_,5) / 80.0)*W_m(Ee*b + c*Ke)
+ Dune::Power<3>::eval(thickness_) / 6.0 * W_mixt(Ee, c*Ke*b - 2*H*c*Ke) + Dune::power(thickness_,3) / 6.0 * W_mixt(Ee, c*Ke*b - 2*H*c*Ke)
+ Dune::Power<5>::eval(thickness_) / 80.0 * W_mp( (Ee*b + c*Ke)*b); + Dune::power(thickness_,5) / 80.0 * W_mp( (Ee*b + c*Ke)*b);
// Add the bending energy density // Add the bending energy density
energyDensity += (thickness_ - K*Dune::Power<3>::eval(thickness_) / 12.0) * W_curv(Ke) energyDensity += (thickness_ - K*Dune::power(thickness_,3) / 12.0) * W_curv(Ke)
+ (Dune::Power<3>::eval(thickness_) / 12.0 - K * Dune::Power<5>::eval(thickness_) / 80.0)*W_curv(Ke*b) + (Dune::power(thickness_,3) / 12.0 - K * Dune::power(thickness_,5) / 80.0)*W_curv(Ke*b)
+ Dune::Power<5>::eval(thickness_) / 80.0 * W_curv(Ke*b*b); + Dune::power(thickness_,5) / 80.0 * W_curv(Ke*b*b);
// Add energy density // Add energy density
energy += quad[pt].weight() * integrationElement * energyDensity; energy += quad[pt].weight() * integrationElement * energyDensity;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#define DUNE_GFE_PERIODIC_1D_PQ1NODALBASIS_HH #define DUNE_GFE_PERIODIC_1D_PQ1NODALBASIS_HH
#include <dune/common/exceptions.hh> #include <dune/common/exceptions.hh>
#include <dune/common/math.hh>
#include <dune/localfunctions/lagrange/pqkfactory.hh> #include <dune/localfunctions/lagrange/pqkfactory.hh>
...@@ -109,7 +110,7 @@ public: ...@@ -109,7 +110,7 @@ public:
size_type maxNodeSize() const size_type maxNodeSize() const
{ {
return StaticPower<2,GV::dimension>::power; return Dune::power(2,GV::dimension);
} }
//protected: //protected:
...@@ -123,7 +124,7 @@ class Periodic1DPQ1Node : ...@@ -123,7 +124,7 @@ class Periodic1DPQ1Node :
public LeafBasisNode public LeafBasisNode
{ {
static const int dim = GV::dimension; static const int dim = GV::dimension;
static const int maxSize = StaticPower<2,GV::dimension>::power; static const int maxSize = Dune::power(2,GV::dimension);
using FiniteElementCache = typename Dune::PQkLocalFiniteElementCache<typename GV::ctype, double, dim, 1>; using FiniteElementCache = typename Dune::PQkLocalFiniteElementCache<typename GV::ctype, double, dim, 1>;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/exceptions.hh> #include <dune/common/exceptions.hh>
#include <dune/common/math.hh>
#include "quaternion.hh" #include "quaternion.hh"
#include <dune/gfe/tensor3.hh> #include <dune/gfe/tensor3.hh>
......
...@@ -331,15 +331,15 @@ RT energy(const typename Basis::LocalView& localView, ...@@ -331,15 +331,15 @@ RT energy(const typename Basis::LocalView& localView,
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
// Add the membrane energy density // Add the membrane energy density
auto energyDensity = (thickness - K*Dune::Power<3>::eval(thickness) / 12.0) * W_m(Ee, mu, lambda); auto energyDensity = (thickness - K*Dune::power(thickness,3) / 12.0) * W_m(Ee, mu, lambda);
energyDensity += (Dune::Power<3>::eval(thickness) / 12.0 - K * Dune::Power<5>::eval(thickness) / 80.0)*W_m(Ee*b + c*Ke, mu, lambda); energyDensity += (Dune::power(thickness,3) / 12.0 - K * Dune::power(thickness,5) / 80.0)*W_m(Ee*b + c*Ke, mu, lambda);
energyDensity += Dune::Power<3>::eval(thickness) / 6.0 * W_mixt(Ee, c*Ke*b - 2*H*c*Ke, mu, lambda); energyDensity += Dune::power(thickness,3) / 6.0 * W_mixt(Ee, c*Ke*b - 2*H*c*Ke, mu, lambda);
energyDensity += Dune::Power<5>::eval(thickness) / 80.0 * W_mp( (Ee*b + c*Ke)*b, mu, lambda); energyDensity += Dune::power(thickness,5) / 80.0 * W_mp( (Ee*b + c*Ke)*b, mu, lambda);
// Add the bending energy density // Add the bending energy density
energyDensity += (thickness - K*Dune::Power<3>::eval(thickness) / 12.0) * W_curv(Ke, mu) energyDensity += (thickness - K*Dune::power(thickness,3) / 12.0) * W_curv(Ke, mu)
+ (Dune::Power<3>::eval(thickness) / 12.0 - K * Dune::Power<5>::eval(thickness) / 80.0)*W_curv(Ke*b, mu) + (Dune::power(thickness,3) / 12.0 - K * Dune::power(thickness,5) / 80.0)*W_curv(Ke*b, mu)
+ Dune::Power<5>::eval(thickness) / 80.0 * W_curv(Ke*b*b, mu); + Dune::power(thickness,5) / 80.0 * W_curv(Ke*b*b, mu);
// Add energy density // Add energy density
energy += quad[pt].weight() * integrationElement * energyDensity; energy += quad[pt].weight() * integrationElement * energyDensity;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment