30 #ifndef CORE_BASIS_QUADSAMPLINGSCHEMES_H
31 #define CORE_BASIS_QUADSAMPLINGSCHEMES_H 1
46 template <
class ARRAY1,
class ARRAY2>
49 typedef typename ARRAY1::value_type coords_type;
51 if (order == 1 || order == 0)
53 const double gaussian_weights[1] = {1.0};
54 const double gaussian_coords[1][2] = {{.5,.5}};
55 const unsigned int num_coords = 2;
56 const unsigned int num_points = 1;
58 coords.resize(num_points);
59 weights.resize(num_points);
60 for (
unsigned int i=0; i<num_points; i++)
62 coords[i].resize(num_coords);
63 for (
unsigned int j=0; j<num_coords; j++)
64 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
65 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
70 const double gaussian_weights[4] = {.25, .25, .25, .25};
71 const double gaussian_coords[4][2] = {
72 {0.211324865405, 0.211324865405},
73 {0.788675134595, 0.211324865405},
74 {0.788675134595, 0.788675134595},
75 {0.211324865405, 0.788675134595}};
76 const unsigned int num_coords = 2;
77 const unsigned int num_points = 4;
79 coords.resize(num_points);
80 weights.resize(num_points);
81 for (
unsigned int i=0; i<num_points; i++)
83 coords[i].resize(num_coords);
84 for (
unsigned int j=0; j<num_coords; j++)
85 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
86 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
91 const double gaussian_weights[9] = {
92 0.07716049378395, 0.12345679007654, 0.07716049378395,
93 0.12345679007654, 0.19753086415802, 0.12345679007654,
94 0.07716049378395, 0.12345679007654, 0.07716049378395 };
95 const double gaussian_coords[9][2] = {
96 {0.11270166537950, 0.11270166537950}, {0.5, 0.11270166537950},
97 {0.88729833462050, 0.11270166537950},
98 {0.11270166537950, 0.5}, {0.5, 0.5}, {0.88729833462050, 0.5},
99 {0.11270166537950, 0.88729833462050}, {0.5, 0.88729833462050},
100 {0.88729833462050, 0.88729833462050}};
101 const unsigned int num_coords = 2;
102 const unsigned int num_points = 9;
104 coords.resize(num_points);
105 weights.resize(num_points);
106 for (
unsigned int i=0; i<num_coords; i++)
108 coords[i].resize(num_points);
109 for (
unsigned int j=0; j<num_coords; j++)
110 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
111 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
120 template <
class ARRAY1,
class ARRAY2>
123 typedef typename ARRAY1::value_type coords_type;
125 coords.resize(order*order);
126 weights.resize(order*order);
127 for (
int i=0; i< order; i++)
129 for (
int j=0; j< order; j++)
131 coords[i+order*j].resize(2);
132 coords[i+order*j][0] =
static_cast<typename coords_type::value_type
>(
static_cast<double>(i+1)/static_cast<double>(order+1));
133 coords[i+order*j][1] =
static_cast<typename coords_type::value_type
>(
static_cast<double>(j+1)/static_cast<double>(order+1));
134 weights[i+order*j] =
static_cast<typename ARRAY2::value_type
>(1.0/
static_cast<double>(order*order));
#define SCISHARE
Definition: share.h:39
void get_regular_scheme(ARRAY1 &coords, ARRAY2 &weights, int order)
Definition: QuadSamplingSchemes.h:121
Utility for specifying data invariants (Assertions)
Definition: QuadSamplingSchemes.h:42
#define REPORT_NOT_IMPLEMENTED(message)
Definition: Exception.h:106
void get_gaussian_scheme(ARRAY1 &coords, ARRAY2 &weights, int order)
Definition: QuadSamplingSchemes.h:47