9#include <kernel/cubature/driver_base.hpp>
10#include <kernel/util/meta_math.hpp>
28 template<
typename Shape_>
38 static constexpr bool variadic =
false;
39 static constexpr int num_points = (dim_ + 1)*(dim_ + 2)/2;
44 return "lauffer-degree-2";
61 Weight_ B = Weight_(2 - dim_)/Weight_((dim_ + 1)*(dim_ + 2)) * V;
62 Weight_ C = Weight_(4)/Weight_((dim_ + 1)*(dim_ + 2)) * V;
65 for(
int i(0); i <= dim_; ++i)
68 rule.get_weight(i) = B;
71 for(
int j(0); j < dim_; ++j)
73 rule.get_coord(i,j) = (i == j) ? Coord_(1) : Coord_(0);
81 for(
int i(1); i <= dim_; ++i)
83 for(
int k(0); k < i; ++k)
86 rule.get_weight(count) = C;
89 for(
int j(0); j < dim_; ++j)
91 rule.get_coord(count,j) = ((j == k) || (j == i)) ? Coord_(1)/Coord_(2) : Coord_(0);
111 template<
typename Shape_>
121 static constexpr bool variadic = 0;
122 static constexpr int dim = 3;
128 return "lauffer-degree-4";
144 Weight_ V = Weight_(1) / Weight_(6);
146 Weight_(-3*dim*dim*dim + 17*dim*dim - 58*dim + 72)/
147 Weight_(3*(dim + 1)*(dim + 2)*(dim + 3)*(dim + 4)) * V;
149 Weight_(16*(dim*dim - 5*dim + 12))/
150 Weight_(3*(dim + 1)*(dim + 2)*(dim + 3)*(dim + 4)) * V;
152 Weight_(4*(dim*dim - 9*dim + 12))/
153 Weight_((dim + 1)*(dim + 2)*(dim + 3)*(dim + 4)) * V;
155 Weight_(64*(4 - dim))/
156 Weight_(2*(dim + 1)*(dim + 2)*(dim + 3)*(dim + 4)) * V;
159 Weight_((dim + 1)*(dim + 2)*(dim + 3)*(dim + 4)) * V;
164 for(
int i(0); i <= dim; ++i)
167 rule.get_weight(count) = B1;
170 for(
int j(0); j < dim; ++j)
172 rule.get_coord(count,j) = (i == j) ? Coord_(1) : Coord_(0);
178 for(
int i(0); i <= dim; ++i)
180 for(
int j(0); j <= dim; ++j)
185 rule.get_weight(count) = B2;
188 for(
int k(0); k < dim; ++k)
192 rule.get_coord(count,k) = Coord_(1)/Coord_(4);
196 rule.get_coord(count,k) = Coord_(3)/Coord_(4);
200 rule.get_coord(count,k) = Coord_(0);
209 for(
int i(1); i <= dim; ++i)
211 for(
int j(0); j < i; ++j)
213 rule.get_weight(count) = B3;
216 for(
int k(0); k < dim; ++k)
218 rule.get_coord(count,k) = ((k == j) || (k == i)) ? Coord_(1)/Coord_(2) : Coord_(0);
225 for(
int i(0); i <= dim; ++i)
227 for(
int j(0); j <= dim; ++j)
229 for(
int k(0); k < j; ++k)
231 if(i != j && i != k && j != k)
233 rule.get_weight(count) = B4;
236 for(
int l(0); l < dim; ++l)
240 rule.get_coord(count,l) = Coord_(1)/Coord_(4);
244 rule.get_coord(count,l) = Coord_(1)/Coord_(2);
248 rule.get_coord(count,l) = Coord_(0);
258 for(
int i(1); i <= dim; ++i)
260 for(
int j(0); j < i; ++j)
262 for(
int k(0); k < j; ++k)
264 for(
int l(0); l < k; ++l)
266 rule.get_weight(count) = B5;
269 for(
int m(0); m < dim; ++m)
271 if(m == i || m == j || m == k || m == l)
273 rule.get_coord(count,m) = Coord_(1)/Coord_(4);
277 rule.get_coord(count,m) = Coord_(0);
static String name()
Returns the name of the cubature rule.
static void fill(Rule< Shape::Simplex< dim_ >, Weight_, Coord_, Point_ > &rule)
Fills the cubature rule structure.
Lauffer-D2 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.
Lauffer-D4 driver class template.
Cubature Rule class template.
String class implementation.
Simplex shape tag struct template.