9#include <kernel/cubature/driver_base.hpp> 
   10#include <kernel/util/math.hpp> 
   11#include <kernel/util/meta_math.hpp> 
   29    template<
typename Shape_>
 
   39      static constexpr bool variadic = 
false;
 
   40      static constexpr int num_points = dim_ + 1;
 
   45        return "hammer-stroud-degree-2";
 
   61        Coord_ r = (Coord_(dim_ + 2) - 
Math::sqrt(Coord_(dim_ + 2)))/
 
   62                   (Coord_(dim_ + 2) * Coord_(dim_ + 1));
 
   63        Coord_ s = (Coord_(dim_ + 2) + Coord_(dim_) * 
Math::sqrt(Coord_(dim_ + 2)))/
 
   64                   (Coord_(dim_ + 2) * Coord_(dim_ + 1));
 
   66        for(
int i(0); i <= dim_; ++i)
 
   72          for(
int j(0); j < dim_; ++j)
 
   74            rule.get_coord(i,j) = (i == j) ? s : r;
 
   92    template<
typename Shape_>
 
  102      static constexpr bool variadic = 
false;
 
  103      static constexpr int num_points = dim_ + 2;
 
  108        return "hammer-stroud-degree-3";
 
  125        Weight_ B = - Weight_((dim_ + 1)*(dim_ + 1))/Weight_(4*dim_ + 8) * V;
 
  126        Weight_ C = Weight_((dim_ + 3)*(dim_ + 3))/Weight_(4*(dim_ + 1)*(dim_ + 2)) * V;
 
  129        rule.get_weight(0) = B;
 
  130        for(
int j(0); j < dim_; ++j)
 
  132          rule.get_coord(0,j) = Coord_(1) / Coord_(dim_ + 1);
 
  138        for(
int i(0); i <= dim_; ++i)
 
  143          rule.get_weight(count) = C;
 
  146          for(
int j(0); j < dim_; ++j)
 
  148            rule.get_coord(count,j) = Coord_((i == j) ? 3 : 1) / Coord_(dim_ + 3);
 
  167    template<
typename Shape_>
 
  177      static constexpr bool variadic = 
false;
 
  178      static constexpr int dim = 3;
 
  179      static constexpr int num_points = 15;
 
  184        return "hammer-stroud-degree-5";
 
  201        Weight_ A = Weight_(16)/Weight_(135) * V;
 
  202        Weight_ B1 = (Weight_(2665) + Weight_(14)*
Math::sqrt(Weight_(15)))/Weight_(37800)*V;
 
  203        Weight_ B2 = (Weight_(2665) - Weight_(14)*
Math::sqrt(Weight_(15)))/Weight_(37800)*V;
 
  204        Weight_ C = Weight_(20)/Weight_(378)*V;
 
  206        Coord_ s1 = (Coord_(7) - 
Math::sqrt(Coord_(15)))/Coord_(34);
 
  207        Coord_ s2 = (Coord_(7) + 
Math::sqrt(Coord_(15)))/Coord_(34);
 
  208        Coord_ t1 = (Coord_(13) + Coord_(3)*
Math::sqrt(Coord_(15)))/Coord_(34);
 
  209        Coord_ t2 = (Coord_(13) - Coord_(3)*
Math::sqrt(Coord_(15)))/Coord_(34);
 
  210        Coord_ u  = (Coord_(10) - Coord_(2)*
Math::sqrt(Coord_(15)))/Coord_(40);
 
  211        Coord_ v  = (Coord_(10) + Coord_(2)*
Math::sqrt(Coord_(15)))/Coord_(40);
 
  217        rule.get_weight(count) = A;
 
  218        for(
int j(0); j < dim; ++j)
 
  220          rule.get_coord(count,j) = Coord_(1)/Coord_(4);
 
  225        for(
int i(0); i <= dim; ++i)
 
  228          rule.get_weight(count) = B1;
 
  231          for(
int j(0); j < dim; ++j)
 
  233            rule.get_coord(count,j) = (i == j) ? t1 : s1;
 
  239        for(
int i(0); i <= dim; ++i)
 
  243          rule.get_weight(count) = B2;
 
  246          for(
int j(0); j < dim; ++j)
 
  248            rule.get_coord(count,j) = (i == j) ? t2 : s2;
 
  254        for(
int i(0); i <= dim; ++i)
 
  256          for(
int j(0); j < i; ++j)
 
  261              rule.get_weight(count) = C;
 
  264              for(
int k(0); k < dim; ++k)
 
  266                rule.get_coord(count,k) = (k == i) || (k == j) ? u : v;
 
static void fill(Rule< Shape::Simplex< dim_ >, Weight_, Coord_, Point_ > &rule)
Fills the cubature rule structure.
static String name()
Returns the name of the cubature rule.
Hammer-Stroud-D2 driver class template.
static void fill(Rule< Shape::Simplex< dim_ >, Weight_, Coord_, Point_ > &rule)
Fills the cubature rule structure.
static String name()
Returns the name of the cubature rule.
Hammer-Stroud-D3 driver class template.
static String name()
Returns the name of the cubature rule.
static void fill(Rule< Shape::Simplex< 3 >, Weight_, Coord_, Point_ > &rule)
Fills the cubature rule structure.
Hammer-Stroud-D5 driver class template.
Cubature Rule class template.
String class implementation.
T_ sqrt(T_ x)
Returns the square-root of a value.
Simplex shape tag struct template.