7 #ifndef WONTON_ADAPTIVE_REFINEMENT_MESH_UTILITIES_H_ 8 #define WONTON_ADAPTIVE_REFINEMENT_MESH_UTILITIES_H_ 17 #include "gtest/gtest.h" 33 using BoxList = std::pair<std::vector<int>,std::vector<Wonton::BoundingBox<D>>>;
69 r_norm[0] = (r[0] - lo1) / (hi1 - lo1);
70 int result = (int) std::ceil(2.0 + 3.0*r_norm[0]);
86 std::vector<int> id_list;
87 std::vector<Wonton::BoundingBox<1>> box_list;
96 box_list[n][0][
LO] = 0.0;
97 box_list[n][0][
HI] = 1.0 / 8.0;
102 box_list.resize(n+1);
105 box_list[n][0][
LO] = 9.0 / 16.0;
106 box_list[n][0][
HI] = 10.0 / 16.0;
111 box_list.resize(n+1);
114 box_list[n][0][
LO] = 1.0 - 4.0 / 32.0;
115 box_list[n][0][
HI] = 1.0 - 3.0 / 32.0;
117 return std::make_pair(id_list,box_list);
126 for (
int d = 0; d < 2; ++d) {
127 r_norm[d] = (r[d] - lo1) / (hi1 - lo1);
129 int result = (int) std::ceil(1.2 - 1.1*r_norm[0] + 2.4*r_norm[1]);
145 std::vector<int> id_list;
146 std::vector<Wonton::BoundingBox<2>> box_list;
152 box_list.resize(n+1);
155 box_list[n][0][
LO] = 0.5;
156 box_list[n][0][
HI] = 1.0;
157 box_list[n][1][
LO] = 0.0;
158 box_list[n][1][
HI] = 0.5;
163 box_list.resize(n+1);
166 box_list[n][0][
LO] = 0.0;
167 box_list[n][0][
HI] = 1.0 / 16.0;
168 box_list[n][1][
LO] = 1.0 - 1.0 / 16.0;
169 box_list[n][1][
HI] = 1.0;
174 box_list.resize(n+1);
177 box_list[n][0][
LO] = 4.0 / 8.0;
178 box_list[n][0][
HI] = 5.0 / 8.0;
179 box_list[n][1][
LO] = 5.0 / 8.0;
180 box_list[n][1][
HI] = 6.0 / 8.0;
182 return std::make_pair(id_list,box_list);
191 for (
int d = 0; d < 3; ++d) {
192 r_norm[d] = (r[d] - lo1) / (hi1 - lo1);
196 for (
int d = 0; d < DIM; ++d) {
197 double x = r_norm[d] - 0.5;
200 radius = sqrt(radius);
201 int result = (int) std::ceil(2.5 - 6.0*radius*radius);
217 std::vector<int> id_list;
218 std::vector<Wonton::BoundingBox<3>> box_list;
224 box_list.resize(n+1);
227 box_list[n][0][
LO] = 0.0;
228 box_list[n][0][
HI] = 0.25;
229 box_list[n][1][
LO] = 0.0;
230 box_list[n][1][
HI] = 0.25;
231 box_list[n][2][
LO] = 0.0;
232 box_list[n][2][
HI] = 0.25;
237 box_list.resize(n+1);
240 box_list[n][0][
LO] = 3.0 / 8.0;
241 box_list[n][0][
HI] = 4.0 / 8.0;
242 box_list[n][1][
LO] = 4.0 / 8.0;
243 box_list[n][1][
HI] = 5.0 / 8.0;
244 box_list[n][2][
LO] = 4.0 / 8.0;
245 box_list[n][2][
HI] = 5.0 / 8.0;
250 box_list.resize(n+1);
253 box_list[n][0][
LO] = 0.75;
254 box_list[n][0][
HI] = 1.0;
255 box_list[n][1][
LO] = 0.75;
256 box_list[n][1][
HI] = 1.0;
257 box_list[n][2][
LO] = 0.75;
258 box_list[n][2][
HI] = 1.0;
260 return std::make_pair(id_list,box_list);
269 for (
int d = 0; d < 4; ++d) {
270 r_norm[d] = (r[d] - lo1) / (hi1 - lo1);
272 int result = (int) std::ceil(
293 std::vector<int> id_list;
294 std::vector<Wonton::BoundingBox<4>> box_list;
300 box_list.resize(n+1);
303 box_list[n][0][
LO] = 0.0;
304 box_list[n][0][
HI] = 0.25;
305 box_list[n][1][
LO] = 0.0;
306 box_list[n][1][
HI] = 0.25;
307 box_list[n][2][
LO] = 0.0;
308 box_list[n][2][
HI] = 0.25;
309 box_list[n][3][
LO] = 0.0;
310 box_list[n][3][
HI] = 0.25;
315 box_list.resize(n+1);
318 box_list[n][0][
LO] = 1.0 / 8.0;
319 box_list[n][0][
HI] = 2.0 / 8.0;
320 box_list[n][1][
LO] = 5.0 / 8.0;
321 box_list[n][1][
HI] = 6.0 / 8.0;
322 box_list[n][2][
LO] = 2.0 / 8.0;
323 box_list[n][2][
HI] = 3.0 / 8.0;
324 box_list[n][3][
LO] = 1.0 / 8.0;
325 box_list[n][3][
HI] = 2.0 / 8.0;
330 box_list.resize(n+1);
333 box_list[n][0][
LO] = 0.0;
334 box_list[n][0][
HI] = 1.0 / 8.0;
335 box_list[n][1][
LO] = 4.0 / 8.0;
336 box_list[n][1][
HI] = 5.0 / 8.0;
337 box_list[n][2][
LO] = 1.0 / 8.0;
338 box_list[n][2][
HI] = 2.0 / 8.0;
339 box_list[n][3][
LO] = 2.0 / 8.0;
340 box_list[n][3][
HI] = 3.0 / 8.0;
342 return std::make_pair(id_list,box_list);
349 #endif // WONTON_ADAPTIVE_REFINEMENT_MESH_UTILITIES_H_ BoxList< 3 > get_sample_points< 3 >()
Definition: test_adaptive_refinement_utilities.h:215
int num_cells< 1 >()
Definition: test_adaptive_refinement_utilities.h:77
BoxList< 2 > get_sample_points< 2 >()
Definition: test_adaptive_refinement_utilities.h:143
int num_cells()
Definition: test_adaptive_refinement_utilities.h:50
int refinement_function< 1 >(const Wonton::Point< 1 > r, double lo1, double hi1)
Definition: test_adaptive_refinement_utilities.h:66
const int HI
Definition: test_adaptive_refinement_utilities.h:37
int num_cells< 2 >()
Definition: test_adaptive_refinement_utilities.h:136
BoxList< 4 > get_sample_points< 4 >()
Definition: test_adaptive_refinement_utilities.h:291
std::pair< std::vector< int >, std::vector< Wonton::BoundingBox< D > >> BoxList
Definition: test_adaptive_refinement_utilities.h:33
int num_cells< 3 >()
Definition: test_adaptive_refinement_utilities.h:208
int num_cells< 4 >()
Definition: test_adaptive_refinement_utilities.h:284
const int LO
Definition: test_adaptive_refinement_utilities.h:36
Represents a point in an N-dimensional space.
Definition: Point.h:50
Definition: test_adaptive_refinement_utilities.h:29
BoxList< D > get_sample_points()
Definition: test_adaptive_refinement_utilities.h:57
int refinement_function< 4 >(const Wonton::Point< 4 > r, double lo1, double hi1)
Definition: test_adaptive_refinement_utilities.h:266
BoxList< 1 > get_sample_points< 1 >()
Definition: test_adaptive_refinement_utilities.h:84
int refinement_function< 3 >(const Wonton::Point< 3 > r, double lo1, double hi1)
Definition: test_adaptive_refinement_utilities.h:188
int refinement_function< 2 >(const Wonton::Point< 2 > r, double lo1, double hi1)
Definition: test_adaptive_refinement_utilities.h:123
const int HI
Definition: BoundingBox.h:24
int refinement_function(const Wonton::Point< D > r, double lo1, double hi1)
Definition: test_adaptive_refinement_utilities.h:43
const int LO
Definition: BoundingBox.h:23