31 #ifndef CORE_BASIS_TRISAMPLINGSCHEMES_H
32 #define CORE_BASIS_TRISAMPLINGSCHEMES_H 1
47 template <
class ARRAY1,
class ARRAY2>
50 typedef typename ARRAY1::value_type coords_type;
52 if (order == 1 || order == 0)
54 const double gaussian_weights[1] = { 1.0};
55 const double gaussian_coords[1][2] = {{1./3.,1./3.}};
56 const unsigned int num_coords = 2;
57 const unsigned int num_points = 1;
59 coords.resize(num_points);
60 weights.resize(num_points);
61 for (
unsigned int i=0; i<num_points; i++)
63 coords[i].resize(num_coords);
64 for (
unsigned int j=0; j<num_coords; j++)
65 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
66 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
71 const double gaussian_weights[3] =
72 {1./3., 1./3., 1./3.};
73 const double gaussian_coords[3][2] =
74 {{1./6.,1./6.}, {2./3.,1./6.}, {1./6.,2./3.}};
75 const unsigned int num_coords = 2;
76 const unsigned int num_points = 3;
78 coords.resize(num_points);
79 weights.resize(num_points);
80 for (
unsigned int i=0; i<num_points; i++)
82 coords[i].resize(num_coords);
83 for (
unsigned int j=0; j<num_coords; j++)
84 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
85 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
90 const double gaussian_weights[7] =
91 { 0.1259391805, 0.1259391805, 0.1259391805, 0.1323941527,
92 0.1323941527, 0.1323941527, 0.225};
93 const double gaussian_coords[7][2] = {
94 {0.1012865073, 0.1012865073}, {0.7974269853, 0.1012865073},
95 {0.1012865073, 0.7974269853}, {0.4701420641, 0.0597158717},
96 {0.4701420641, 0.4701420641}, {0.0597158717, 0.4701420641},
97 {0.3333333333, 0.3333333333}};
98 const unsigned int num_coords = 2;
99 const unsigned int num_points = 7;
101 coords.resize(num_points);
102 weights.resize(num_points);
103 for (
unsigned int i=0; i<num_points; i++)
105 coords[i].resize(num_coords);
106 for (
unsigned int j=0; j<num_coords; j++)
107 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
108 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
117 template <
class ARRAY1,
class ARRAY2>
120 typedef typename ARRAY1::value_type coords_type;
123 for (
int j=0; j<order;j++) m += (2*j+1);
127 for (
int p=0; p<m;p++) weights[p] = static_cast<typename ARRAY2::value_type>(1.0/
static_cast<double>(m));
130 for (
int p=0;p<order;p++)
136 coords[k][1] =
static_cast<typename coords_type::value_type
>((
static_cast<double>(order-1-p)+1.0/3.0)/
static_cast<double>(order));
137 coords[k][0] =
static_cast<typename coords_type::value_type
>((
static_cast<double>(r)+1.0/3.0)/
static_cast<double>(order));
140 coords[k][1] =
static_cast<typename coords_type::value_type
>((
static_cast<double>(order-1-p)+2.0/3.0)/
static_cast<double>(order));
141 coords[k][0] =
static_cast<typename coords_type::value_type
>((
static_cast<double>(r)+2.0/3.0)/
static_cast<double>(order));
145 coords[k][1] =
static_cast<typename coords_type::value_type
>((
static_cast<double>(order-1-p)+1.0/3.0)/
static_cast<double>(order));
146 coords[k][0] =
static_cast<typename coords_type::value_type
>((
static_cast<double>(r)+1.0/3.0)/
static_cast<double>(order));
void get_regular_scheme(ARRAY1 &coords, ARRAY2 &weights, int order)
Definition: TriSamplingSchemes.h:118
#define SCISHARE
Definition: share.h:39
Utility for specifying data invariants (Assertions)
#define REPORT_NOT_IMPLEMENTED(message)
Definition: Exception.h:106
void get_gaussian_scheme(ARRAY1 &coords, ARRAY2 &weights, int order)
Definition: TriSamplingSchemes.h:48
Definition: TriSamplingSchemes.h:43