31 #ifndef CORE_BASIS_HEXSAMPLINGSCHEMES_H
32 #define CORE_BASIS_HEXSAMPLINGSCHEMES_H 1
47 template <
class ARRAY1,
class ARRAY2>
50 typedef typename ARRAY1::value_type coords_type;
52 if (order == 0 || order == 1)
54 const double gaussian_weights[1] = { 1.0};
55 const double gaussian_coords[1][3] = {{0.5, 0.5, 0.5}};
56 const unsigned int num_coords = 3;
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[8] = {.125, .125, .125, .125,
72 .125, .125, .125, .125};
73 const double gaussian_coords[8][3] = {
74 {0.211324865405, 0.211324865405, 0.211324865405},
75 {0.788675134595, 0.211324865405, 0.211324865405},
76 {0.788675134595, 0.788675134595, 0.211324865405},
77 {0.211324865405, 0.788675134595, 0.211324865405},
78 {0.211324865405, 0.211324865405, 0.788675134595},
79 {0.788675134595, 0.211324865405, 0.788675134595},
80 {0.788675134595, 0.788675134595, 0.788675134595},
81 {0.211324865405, 0.788675134595, 0.788675134595}};
82 const unsigned int num_coords = 3;
83 const unsigned int num_points = 8;
85 coords.resize(num_points);
86 weights.resize(num_points);
87 for (
unsigned int i=0; i<num_points; i++)
89 coords[i].resize(num_coords);
90 for (
unsigned int j=0; j<num_coords; j++)
91 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
92 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
97 const double gaussian_weights[27] = {
98 0.03429355278944, 0.05486968447298, 0.03429355278944,
99 0.05486968447298, 0.08779149517257, 0.05486968447298,
100 0.03429355278944, 0.05486968447298, 0.03429355278944,
102 0.03429355278944, 0.05486968447298, 0.03429355278944,
103 0.05486968447298, 0.08779149517257, 0.05486968447298,
104 0.03429355278944, 0.05486968447298, 0.03429355278944,
106 0.03429355278944, 0.05486968447298, 0.03429355278944,
107 0.05486968447298, 0.08779149517257, 0.05486968447298,
108 0.03429355278944, 0.05486968447298, 0.03429355278944
110 const double gaussian_coords[27][3] = {
111 {0.11270166537950, 0.11270166537950, 0.11270166537950},
112 {0.5, 0.11270166537950, 0.11270166537950},
113 {0.88729833462050, 0.11270166537950, 0.11270166537950},
114 {0.11270166537950, 0.5, 0.11270166537950},
115 {0.5, 0.5, 0.11270166537950},
116 {0.88729833462050, 0.5, 0.11270166537950},
117 {0.11270166537950, 0.88729833462050, 0.11270166537950},
118 {0.5, 0.88729833462050, 0.11270166537950},
119 {0.88729833462050, 0.88729833462050, 0.11270166537950},
121 {0.11270166537950, 0.11270166537950, 0.5},
122 {0.5, 0.11270166537950, 0.5},
123 {0.88729833462050, 0.11270166537950, 0.5},
124 {0.11270166537950, 0.5, 0.5},
126 {0.88729833462050, 0.5, 0.5},
127 {0.11270166537950, 0.88729833462050, 0.5},
128 {0.5, 0.88729833462050, 0.5},
129 {0.88729833462050, 0.88729833462050, 0.5},
131 {0.11270166537950, 0.11270166537950, 0.88729833462050},
132 {0.5, 0.11270166537950, 0.88729833462050},
133 {0.88729833462050, 0.11270166537950, 0.88729833462050},
134 {0.11270166537950, 0.5, 0.88729833462050},
135 {0.5, 0.5, 0.88729833462050},
136 {0.88729833462050, 0.5, 0.88729833462050},
137 {0.11270166537950, 0.88729833462050, 0.88729833462050},
138 {0.5, 0.88729833462050, 0.88729833462050},
139 {0.88729833462050, 0.88729833462050, 0.88729833462050}
141 const unsigned int num_coords = 3;
142 const unsigned int num_points = 27;
144 coords.resize(num_points);
145 weights.resize(num_points);
146 for (
unsigned int i=0; i<num_points; i++)
148 coords[i].resize(num_coords);
149 for (
unsigned int j=0; j<num_coords; j++)
150 coords[i][j] = static_cast<typename coords_type::value_type>(gaussian_coords[i][j]);
151 weights[i] =
static_cast<typename ARRAY2::value_type
>(gaussian_weights[i]);
160 template <
class ARRAY1,
class ARRAY2>
163 typedef typename ARRAY1::value_type coords_type;
165 coords.resize(order*order*order);
166 weights.resize(order*order*order);
167 for (
int i=0; i< order; i++)
169 for (
int j=0; j< order; j++)
171 for (
int k=0; k< order; k++)
173 coords[i+order*j+order*order*k].resize(3);
174 coords[i+order*j+order*order*k][0] =
175 static_cast<typename coords_type::value_type
>(
static_cast<double>(i+1)/static_cast<double>(order+1));
176 coords[i+order*j+order*order*k][1] =
177 static_cast<typename coords_type::value_type
>(
static_cast<double>(j+1)/static_cast<double>(order+1));
178 coords[i+order*j+order*order*k][2] =
179 static_cast<typename coords_type::value_type
>(
static_cast<double>(k+1)/static_cast<double>(order+1));
180 weights[i+order*j+order*order*k] =
181 static_cast<typename ARRAY2::value_type
>(1.0/
static_cast<double>(order*order*order));
#define SCISHARE
Definition: share.h:39
Utility for specifying data invariants (Assertions)
void get_regular_scheme(ARRAY1 &coords, ARRAY2 &weights, int order)
Definition: HexSamplingSchemes.h:161
void get_gaussian_scheme(ARRAY1 &coords, ARRAY2 &weights, int order)
Definition: HexSamplingSchemes.h:48
#define REPORT_NOT_IMPLEMENTED(message)
Definition: Exception.h:106
Definition: HexSamplingSchemes.h:43