Skip to content
Snippets Groups Projects

Modernize rod code

Merged Sander, Oliver requested to merge modernize-rod-code into master
4 files
+ 118
62
Compare changes
  • Side-by-side
  • Inline
Files
4
  • 87e1da6f
    Find std math functions by ADL · 87e1da6f
    Sander, Oliver authored
    ADOL-C implements most standard math functions for its
    'adouble' type, and they are not in the namespace 'std'.
    dune-fufem contains a file adolcnamespaceinjections.hh
    which imports some of these methods into the 'std'
    namespace, but that is not the proper way to do it.
    Rather, they should be found by argument-dependent
    lookup (ADL), that is
    
      using std::sin;
      auto v = sin(x);
@@ -227,10 +227,11 @@ public:
RT curvatureEnergy(const Tensor3<field_type,3,3,gridDim>& DR) const
{
using std::pow;
#ifdef DONT_USE_CURL
return mu_ * std::pow(L_c_ * L_c_ * DR.frobenius_norm2(),q_/2.0);
return mu_ * pow(L_c_ * L_c_ * DR.frobenius_norm2(),q_/2.0);
#else
return mu_ * std::pow(L_c_ * L_c_ * curl(DR).frobenius_norm2(),q_/2.0);
return mu_ * pow(L_c_ * L_c_ * curl(DR).frobenius_norm2(),q_/2.0);
#endif
}
Loading