libMesh
Loading...
Searching...
No Matches
all_rbb.C
Go to the documentation of this file.
1#include <libmesh/boundary_info.h>
2#include <libmesh/elem.h>
3#include <libmesh/enum_quadrature_type.h>
4#include <libmesh/fe_map.h>
5#include <libmesh/mesh.h>
6#include <libmesh/mesh_generation.h>
7#include <libmesh/mesh_modification.h>
8#include <libmesh/mesh_tools.h>
9#include <libmesh/quadrature.h>
10
11#include "test_comm.h"
12#include "libmesh_cppunit.h"
13
14
15using namespace libMesh;
16
17class AllRBBTest : public CppUnit::TestCase
18{
27public:
29
33
34 // 2D tests
35#if LIBMESH_DIM > 1
41
42 // We use AMR when generating circles
43# ifdef LIBMESH_ENABLE_AMR
47
51
55# endif
56#endif
57
58 // 3D tests
59#if LIBMESH_DIM > 2
65
66// We need to add BERNSTEIN support for Prisms!
67// CPPUNIT_TEST( testAllRBBPrism6 );
68// CPPUNIT_TEST( testAllRBBPrism18 );
69
70 // We use AMR when generating circles or spheres
71# ifdef LIBMESH_ENABLE_AMR
74
78
82# endif
83
84#endif
85
87
88protected:
89 // We don't do anything interesting to affine elements in all_rbb(),
90 // but we can verify that we're not screwing them up.
91 void test_box(ElemType elem_type)
92 {
94
95 auto dim = Elem::type_to_dim_map[elem_type];
96
98 dim > 0 ? 2 : 0, dim > 1 ? 1 : 0, dim > 2 ? 1 : 0,
99 0., 1.,
100 0., 1.,
101 0., 1.,
102 elem_type);
103
104 const auto n_orig_elem = mesh.n_elem();
105 CPPUNIT_ASSERT_EQUAL(n_orig_elem, mesh.max_elem_id());
106
107 const Real orig_volume = MeshTools::volume(mesh) / n_orig_elem;
108
109 std::vector<Real> orig_hmin(n_orig_elem), orig_hmax(n_orig_elem);
110
111 // In the tet case our elements all have the same volume but
112 // they're stretched differently and have different hmin/hmax
113 for (auto & elem : mesh.element_ptr_range())
114 {
115 orig_hmin[elem->id()] = elem->hmin();
116 orig_hmax[elem->id()] = elem->hmax();
117 }
118
120
121 CPPUNIT_ASSERT_EQUAL(n_orig_elem, mesh.n_elem());
122 CPPUNIT_ASSERT_EQUAL(n_orig_elem, mesh.max_elem_id());
123
124 unsigned char weight_index = mesh.default_mapping_data();
125
126 for (auto & elem : mesh.element_ptr_range())
127 {
128 CPPUNIT_ASSERT_EQUAL(elem->mapping_type(),
130 CPPUNIT_ASSERT(elem->has_affine_map());
131
132 // Tri6 has this much FP error??
133 LIBMESH_ASSERT_FP_EQUAL(elem->volume(), orig_volume,
135 LIBMESH_ASSERT_FP_EQUAL(elem->hmax(), orig_hmax[elem->id()],
137 LIBMESH_ASSERT_FP_EQUAL(elem->hmin(), orig_hmin[elem->id()],
139 }
140
141 for (auto & node : mesh.node_ptr_range())
142 {
143 const Real w = node->get_extra_datum<Real>(weight_index);
144
145 CPPUNIT_ASSERT_EQUAL(Real(1), w);
146 }
147 }
148
149 void test_circle(unsigned int n_refinements)
150 {
151 Mesh interior_mesh(*TestCommWorld),
152 boundary_mesh(*TestCommWorld);
153
154 const Real radius = 1;
155 const Real circumference = 2 * pi * radius;
156 const Real tol = TOLERANCE*TOLERANCE;
157
158 // Build a filled circle
160 n_refinements, QUAD9);
161
162 // Get just the outer EDGE3 circle mesh
163 interior_mesh.get_boundary_info().sync(boundary_mesh);
164
165 const dof_id_type n_edges = 4 << n_refinements;
166
167 CPPUNIT_ASSERT_EQUAL(boundary_mesh.n_elem(), n_edges);
168 CPPUNIT_ASSERT_EQUAL(boundary_mesh.n_nodes(), n_edges*2);
169
170 for (auto & node : boundary_mesh.node_ptr_range())
171 {
172 const Point p = *node;
173 LIBMESH_ASSERT_FP_EQUAL(p.norm(), radius, tol);
174 }
175
176 // We just did Lagrange interpolation, so our mesh measure
177 // shouldn't be *quite* right. Empirically, we converge from
178 // beneath, and our error looks like Ch^4.
179 const Real max_lagrange_error =
180 radius * 5e-2 / (1 << (4*n_refinements));
181 LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(boundary_mesh),
182 circumference, max_lagrange_error);
183
185
186 for (auto & elem : boundary_mesh.element_ptr_range())
187 {
188 CPPUNIT_ASSERT_EQUAL(RATIONAL_BERNSTEIN_MAP, elem->mapping_type());
189
190 // We can no longer assert that each Node is at a specified
191 // radius from the circle center, because these are now spline
192 // control nodes, but we can assert that physical points
193 // within the element are at the desired radius.
194 constexpr int n_intervals = 4;
195 Point master_pt;
196 for (master_pt(0) = -1; master_pt(0) <= 1 + TOLERANCE;
197 master_pt(0) += Real(2)/n_intervals)
198 {
199 const Point p = FEMap::map(elem->dim(), elem, master_pt);
200 LIBMESH_ASSERT_FP_EQUAL(radius, p.norm(), tol);
201 }
202 }
203
204 // We're using quadrature for volume approximation, so we still
205 // have error, but our quadrature error looks something like Ch^6
206 // with a much smaller C.
207 const Real max_rbb_error =
208 radius * 1e-3 / (1 << (6*n_refinements));
209 LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(boundary_mesh),
210 circumference, max_rbb_error);
211 }
212
213 void test_disk(unsigned int n_refinements, const ElemType type = QUAD9)
214 {
216
217 const Real radius = 1;
218 const Real area = pi * radius * radius;
219 const Real tol = TOLERANCE*TOLERANCE;
220
221 // Build a filled circle
223 n_refinements, type);
224
225 const dof_id_type n_elem =
226 (5 << (n_refinements*2)) * (type == QUAD9 ? 1 : 2);
227
228 CPPUNIT_ASSERT_EQUAL(mesh.n_elem(), n_elem);
229
230 // We just did Lagrange interpolation, so our mesh measure
231 // shouldn't be *quite* right. Empirically, we converge from
232 // beneath, and our error looks like Ch^4.
233 const Real max_lagrange_error =
234 radius * 5e-2 / (1 << (4*n_refinements));
235
236 LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(mesh),
237 area, max_lagrange_error);
238
240
241 for (const Elem * elem : mesh.element_ptr_range())
242 {
243 CPPUNIT_ASSERT_EQUAL(RATIONAL_BERNSTEIN_MAP, elem->mapping_type());
244
245 // We can no longer assert that each Node is at a specified
246 // radius from the circle center, because these are now spline
247 // control nodes, but we can assert that physical points
248 // within the element are at the desired radius.
249 for (auto s : make_range(elem->n_sides()))
250 {
251 if (elem->neighbor_ptr(s))
252 continue;
253
254 constexpr int n_intervals = 4;
255 Point master_pt = elem->master_point(s);
256 const Point step =
257 (elem->master_point((s+1)%elem->n_sides()) - master_pt)
258 / n_intervals;
259 for (auto i : make_range(n_intervals+1))
260 {
262 const Point p = FEMap::map(elem->dim(), elem, master_pt);
263 LIBMESH_ASSERT_FP_EQUAL(radius, p.norm(), tol);
264 master_pt += step;
265 }
266 }
267 }
268
269 // We're using quadrature for volume approximation, so we still
270 // have error, but our quadrature error looks like Ch^6 with a
271 // much smaller C.
272 const Real max_rbb_error =
273 radius * 2e-3 / (1 << (6*n_refinements));
274 LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(mesh),
275 area, max_rbb_error);
276 }
277
278 void test_cylinder (unsigned int n_refinements, const ElemType type = HEX27)
279 {
280 Mesh disk_mesh(*TestCommWorld), mesh(*TestCommWorld);
281
282 const Real radius = 1;
283 const Real height = 3;
284 const Real volume = pi * radius * radius * height;
285 const Real tol = TOLERANCE*TOLERANCE;
286
287 // We're extruding a circle from side 0 up
288 const ElemType side_type = Elem::build(type)->side_type(0);
289
290 // Build a filled circle
292 n_refinements, side_type);
293
294 // Then extrude it into a cylinder
295 const unsigned int nz = 2;
296 const RealVectorValue extrusion_vector{0,0,height};
297 MeshTools::Generation::build_extrusion (mesh, disk_mesh, nz, extrusion_vector);
298
299 const dof_id_type n_elem =
300 (5 << (n_refinements*2)) * (side_type == QUAD9 ? 1 : 2) * nz;
301
302 CPPUNIT_ASSERT_EQUAL(mesh.n_elem(), n_elem);
303
304 // We just did Lagrange interpolation, so our mesh measure
305 // shouldn't be *quite* right, but we should converge similarly to
306 // how we did with the filled disk.
307 const Real max_lagrange_error =
308 radius * 5e-2 / (1 << (4*n_refinements)) *
309 radius * radius * height;
310
311 LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(mesh),
312 volume, max_lagrange_error);
313
315
316 std::unique_ptr<const Elem> elem_side;
317 constexpr int n_intervals = 4;
318 auto qrule = QBase::build(QGRID, /*dim=*/2, Order(n_intervals));
319
320 for (const Elem * elem : mesh.element_ptr_range())
321 {
322 CPPUNIT_ASSERT_EQUAL(RATIONAL_BERNSTEIN_MAP, elem->mapping_type());
323
324 // We cannot assert that each Node is at a specified radius
325 // from the cylinder axis, because these are now spline
326 // control nodes, but we can assert that physical points
327 // within the rounded surface are at the desired radius.
328 for (auto s : make_range(elem->n_sides()))
329 {
330 if (elem->neighbor_ptr(s))
331 continue;
332
333 const Point side_normal =
334 elem->side_vertex_average_normal(s);
335
336 // We ought to either be on the rounded surface or the end
337 // caps
338 if (std::abs(side_normal(2)) > TOLERANCE*TOLERANCE)
339 {
340 LIBMESH_ASSERT_FP_EQUAL(side_normal(0), 0, TOLERANCE*TOLERANCE);
341 LIBMESH_ASSERT_FP_EQUAL(side_normal(1), 0, TOLERANCE*TOLERANCE);
342 continue;
343 }
344
345 elem->build_side_ptr(elem_side, s);
346 qrule->init(*elem_side);
347
348 for (auto i : make_range(qrule->n_points()))
349 {
350 Point p = FEMap::map(elem_side->dim(), elem_side.get(), qrule->qp(i));
351 p(2) = 0; // Just look at r in cylindrical coordinates
352 LIBMESH_ASSERT_FP_EQUAL(radius, p.norm(), tol);
353 }
354 }
355 }
356
357 // We're using quadrature for volume approximation, so we still
358 // have error, but our quadrature error looks like Ch^6 with a
359 // much smaller C.
360 const Real max_rbb_error =
361 radius * 2e-3 / (1 << (6*n_refinements)) *
362 radius * radius * height;
363 LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(mesh),
364 volume, max_rbb_error);
365 }
366
367 void test_sphere(unsigned int n_refinements, const ElemType type = QUAD9)
368 {
369 Mesh interior_mesh(*TestCommWorld),
370 boundary_mesh(*TestCommWorld);
371
372 const Real radius = 1;
373 const Real surface_area = 4 * pi * radius * radius;
374 const Real tol = TOLERANCE*TOLERANCE;
375
376 // Build a filled sphere. We're going to avoid using the `flat`
377 // direct 2D option here because that only currently supports
378 // TRI3.
380 n_refinements, HEX27);
381
382 // Get just the outer QUAD9 sphere mesh
383 interior_mesh.get_boundary_info().sync(boundary_mesh);
384
385 const dof_id_type n_faces = 6 << (2*n_refinements);
386
387 CPPUNIT_ASSERT_EQUAL(boundary_mesh.n_elem(), n_faces);
388
389 auto check_radii = [&boundary_mesh, radius, type](Real radius_tol) {
390 constexpr int n_intervals = 4;
391
392 Real max_radius_error = 0;
393 for (auto & elem : boundary_mesh.element_ptr_range())
394 {
395 // We can't necessarily assert that each Node is at a
396 // specified radius from the circle center, because these
397 // may be spline control nodes. We want physical points
398 // within an element to all be at the desired radius, but on
399 // rational quadratics that's only possible for "latitude /
400 // longitude" quad edges, so we need a non-trivial tolerance
401 // here.
402 Point master_pt;
403 if (type == TRI6)
404 {
405 for (master_pt(0) = 0; master_pt(0) <= 1 + TOLERANCE;
406 master_pt(0) += Real(1)/n_intervals)
407 {
408 for (master_pt(1) = 0; master_pt(1) <= 1 - master_pt(0) + TOLERANCE;
409 master_pt(1) += Real(1)/n_intervals)
410 {
411 const Point p = FEMap::map(elem->dim(), elem, master_pt);
412 max_radius_error = std::max(max_radius_error, std::abs(radius-p.norm()));
413 }
414 }
415 }
416 else
417 {
418 libmesh_assert_equal_to(type, QUAD9);
419 for (master_pt(0) = -1; master_pt(0) <= 1 + TOLERANCE;
420 master_pt(0) += Real(2)/n_intervals)
421 {
422 for (master_pt(1) = -1; master_pt(1) <= 1 + TOLERANCE;
423 master_pt(1) += Real(2)/n_intervals)
424 {
425 const Point p = FEMap::map(elem->dim(), elem, master_pt);
426 max_radius_error = std::max(max_radius_error, std::abs(radius-p.norm()));
427 }
428 }
429 }
430 LIBMESH_ASSERT_FP_EQUAL(max_radius_error, 0, radius_tol);
431 }
432 };
433
434 auto verify_equispaced_midnodes = [&boundary_mesh, type]()
435 {
436 std::unique_ptr<Elem> side_ptr;
437 for (auto & elem : boundary_mesh.element_ptr_range())
438 {
439 // We expect midnodes to be and to remain equispaced on
440 // quad edges. But our QUAD9 elements can be curved
441 // trapezoids, so we don't expect "diagonal" edges to have
442 // an equispaced mid-face node.
443 if (type != TRI6)
444 for (auto s : elem->side_index_range())
445 {
446 elem->build_side_ptr(side_ptr, s);
447
448 auto c02 = side_ptr->point(2) - side_ptr->point(0);
449 auto c12 = side_ptr->point(2) - side_ptr->point(1);
450 LIBMESH_ASSERT_FP_EQUAL
451 (c02.norm_sq(), c12.norm_sq(), TOLERANCE*TOLERANCE);
452 }
453 }
454 };
455
456 verify_equispaced_midnodes();
457
458 if (type == TRI6)
459 {
461 verify_equispaced_midnodes();
462 }
463 else
464 libmesh_assert_equal_to(type, QUAD9);
465
466 // For our sphere construction, all of our Lagrange nodes should
467 // be at exactly the right radius.
468 for (auto & node : boundary_mesh.node_ptr_range())
469 {
470 const Point p = *node;
471 LIBMESH_ASSERT_FP_EQUAL(p.norm(), radius, tol);
472 }
473
474 // But Lagrange isn't isogeometric, so non-nodes should have
475 // radius error. Empirically, our error looks like Ch^3
476 const Real max_lagrange_rad_error =
477 radius * 0.2 / (1 << (3*n_refinements));
478 check_radii(max_lagrange_rad_error);
479
480 // We just did Lagrange interpolation, so our mesh measure
481 // shouldn't be *quite* right. Empirically, we converge from
482 // beneath, and our error looks like Ch^4.
483 const Real max_lagrange_vol_error =
484 radius * radius * 1.5 / (1 << (4*n_refinements));
485 LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(boundary_mesh),
486 surface_area, max_lagrange_vol_error);
487
489
490 // All of our vertices should still be at exactly the right
491 // radius; for these the control point is the point.
492 for (auto & elem : boundary_mesh.element_ptr_range())
493 {
494 CPPUNIT_ASSERT_EQUAL(RATIONAL_BERNSTEIN_MAP, elem->mapping_type());
495
496 for (auto v : make_range(elem->n_vertices()))
497 {
498 const Point & p = elem->point(v);
499 LIBMESH_ASSERT_FP_EQUAL(p.norm(), radius, tol);
500 }
501 }
502
503 // We're not building a stereographic mesh on the sphere, so we
504 // still have error ... of only slightly better magnitude?
505 const Real max_rbb_rad_error =
506 radius * 0.2 / (1 << (3*n_refinements));
507 check_radii(max_rbb_rad_error);
508
509 // And we also get about the same order on volume():
510 const Real max_rbb_vol_error =
511 radius * radius * 1.5 / (1 << (4*n_refinements));
512 LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(boundary_mesh),
513 surface_area, max_rbb_vol_error);
514 }
515
516
517public:
518 void setUp() {}
519
520 void tearDown() {}
521
522 void testAllRBBNodeElem() { LOG_UNIT_TEST; test_box(NODEELEM); }
523 void testAllRBBEdge() { LOG_UNIT_TEST; test_box(EDGE2); }
524 void testAllRBBEdge3() { LOG_UNIT_TEST; test_box(EDGE3); }
525 void testAllRBBTri() { LOG_UNIT_TEST; test_box(TRI3); }
526 void testAllRBBTri6() { LOG_UNIT_TEST; test_box(TRI6); }
527 void testAllRBBQuad() { LOG_UNIT_TEST; test_box(QUAD4); }
528 void testAllRBBQuad8() { LOG_UNIT_TEST; test_box(QUAD8); }
529 void testAllRBBQuad9() { LOG_UNIT_TEST; test_box(QUAD9); }
530 void testAllRBBTet() { LOG_UNIT_TEST; test_box(TET4); }
531 void testAllRBBTet10() { LOG_UNIT_TEST; test_box(TET10); }
532 void testAllRBBHex() { LOG_UNIT_TEST; test_box(HEX8); }
533 void testAllRBBHex20() { LOG_UNIT_TEST; test_box(HEX20); }
534 void testAllRBBHex27() { LOG_UNIT_TEST; test_box(HEX27); }
535
536 // We need to add BERNSTEIN support for Prisms!
537 // void testAllRBBPrism6() { LOG_UNIT_TEST; test_box(PRISM6); }
538 // void testAllRBBPrism18() { LOG_UNIT_TEST; test_box(PRISM18); }
539
540 // We still don't support general Polys, Tri7s or anything with them
541 // as faces, infinite elements, or anything above quadratic.
542
543 // 0 refinements of our default circle gives us 4 RBB edges
544 void testAllRBBCircle4() { LOG_UNIT_TEST; test_circle(0); }
545 void testAllRBBCircle8() { LOG_UNIT_TEST; test_circle(1); }
546 void testAllRBBCircle16() { LOG_UNIT_TEST; test_circle(2); }
547
548 // 0 refinements of our default disk gives us 5 RBB quads or 10 RBB
549 // triangles
550 void testAllRBBDisk5() { LOG_UNIT_TEST; test_disk(0); }
551 void testAllRBBDisk20() { LOG_UNIT_TEST; test_disk(1); }
552 void testAllRBBDisk80() { LOG_UNIT_TEST; test_disk(2); }
553
554 void testAllRBBTri6Disk10() { LOG_UNIT_TEST; test_disk(0, TRI6); }
555 void testAllRBBTri6Disk40() { LOG_UNIT_TEST; test_disk(1, TRI6); }
556 void testAllRBBTri6Disk160() { LOG_UNIT_TEST; test_disk(2, TRI6); }
557
558 // Extruding a disk into 2 layers gives us twice as many hexes as we
559 // had quads
560 void testAllRBBCylinder10() { LOG_UNIT_TEST; test_cylinder(0); }
561 void testAllRBBCylinder80() { LOG_UNIT_TEST; test_cylinder(1); }
562
563 // 0 refinements of our default sphere gives us 6 RBB quad faces or
564 // 12 RBB triangles
565 void testAllRBBSphere6() { LOG_UNIT_TEST; test_sphere(0); }
566 void testAllRBBSphere24() { LOG_UNIT_TEST; test_sphere(1); }
567 void testAllRBBSphere96() { LOG_UNIT_TEST; test_sphere(2); }
568
569 void testAllRBBTri6Sphere12() { LOG_UNIT_TEST; test_sphere(0, TRI6); }
570 void testAllRBBTri6Sphere48() { LOG_UNIT_TEST; test_sphere(1, TRI6); }
571 void testAllRBBTri6Sphere192() { LOG_UNIT_TEST; test_sphere(2, TRI6); }
572};
573
574
unsigned int dim
CPPUNIT_TEST_SUITE_REGISTRATION(AllRBBTest)
CPPUNIT_TEST(testAllRBBTet10)
CPPUNIT_TEST(testAllRBBDisk5)
void testAllRBBTet()
Definition all_rbb.C:530
CPPUNIT_TEST(testAllRBBDisk80)
void testAllRBBDisk80()
Definition all_rbb.C:552
void testAllRBBTri6Disk40()
Definition all_rbb.C:555
void testAllRBBHex()
Definition all_rbb.C:532
void testAllRBBCircle8()
Definition all_rbb.C:545
CPPUNIT_TEST(testAllRBBSphere6)
CPPUNIT_TEST(testAllRBBTri6Sphere192)
CPPUNIT_TEST(testAllRBBSphere96)
void setUp()
Definition all_rbb.C:518
void testAllRBBDisk20()
Definition all_rbb.C:551
CPPUNIT_TEST(testAllRBBQuad)
CPPUNIT_TEST(testAllRBBTri6Disk160)
void testAllRBBQuad8()
Definition all_rbb.C:528
void testAllRBBCircle4()
Definition all_rbb.C:544
void testAllRBBTri6Sphere48()
Definition all_rbb.C:570
void testAllRBBEdge3()
Definition all_rbb.C:524
void testAllRBBSphere6()
Definition all_rbb.C:565
void testAllRBBCircle16()
Definition all_rbb.C:546
void test_sphere(unsigned int n_refinements, const ElemType type=QUAD9)
Definition all_rbb.C:367
void test_cylinder(unsigned int n_refinements, const ElemType type=HEX27)
Definition all_rbb.C:278
CPPUNIT_TEST(testAllRBBTet)
CPPUNIT_TEST(testAllRBBTri6Disk40)
void testAllRBBHex27()
Definition all_rbb.C:534
CPPUNIT_TEST(testAllRBBTri)
void testAllRBBHex20()
Definition all_rbb.C:533
void testAllRBBNodeElem()
Definition all_rbb.C:522
CPPUNIT_TEST(testAllRBBNodeElem)
CPPUNIT_TEST(testAllRBBQuad9)
void test_box(ElemType elem_type)
Definition all_rbb.C:91
CPPUNIT_TEST(testAllRBBTri6)
CPPUNIT_TEST(testAllRBBTri6Sphere48)
CPPUNIT_TEST(testAllRBBSphere24)
CPPUNIT_TEST(testAllRBBCircle16)
void testAllRBBSphere24()
Definition all_rbb.C:566
void testAllRBBTri6Disk10()
Definition all_rbb.C:554
CPPUNIT_TEST(testAllRBBQuad8)
void testAllRBBQuad9()
Definition all_rbb.C:529
CPPUNIT_TEST_SUITE_END()
CPPUNIT_TEST(testAllRBBHex)
void testAllRBBQuad()
Definition all_rbb.C:527
CPPUNIT_TEST(testAllRBBTri6Disk10)
CPPUNIT_TEST(testAllRBBHex27)
CPPUNIT_TEST(testAllRBBDisk20)
CPPUNIT_TEST(testAllRBBCircle8)
void testAllRBBTri6Disk160()
Definition all_rbb.C:556
void testAllRBBCylinder80()
Definition all_rbb.C:561
void test_circle(unsigned int n_refinements)
Definition all_rbb.C:149
void testAllRBBSphere96()
Definition all_rbb.C:567
CPPUNIT_TEST(testAllRBBCylinder10)
CPPUNIT_TEST(testAllRBBEdge)
CPPUNIT_TEST(testAllRBBCylinder80)
void testAllRBBCylinder10()
Definition all_rbb.C:560
void testAllRBBDisk5()
Definition all_rbb.C:550
void testAllRBBTri6()
Definition all_rbb.C:526
void tearDown()
Definition all_rbb.C:520
void testAllRBBTri()
Definition all_rbb.C:525
void testAllRBBEdge()
Definition all_rbb.C:523
void testAllRBBTri6Sphere12()
Definition all_rbb.C:569
void test_disk(unsigned int n_refinements, const ElemType type=QUAD9)
Definition all_rbb.C:213
CPPUNIT_TEST(testAllRBBEdge3)
CPPUNIT_TEST(testAllRBBHex20)
CPPUNIT_TEST(testAllRBBCircle4)
void testAllRBBTri6Sphere192()
Definition all_rbb.C:571
CPPUNIT_TEST(testAllRBBTri6Sphere12)
LIBMESH_CPPUNIT_TEST_SUITE(AllRBBTest)
The goal of this test is to verify proper operation of the all_rbb() mesh modification,...
void testAllRBBTet10()
Definition all_rbb.C:531
virtual dof_id_type n_nodes() const override final
virtual dof_id_type n_elem() const override final
This is the base class from which all geometric element types are derived.
Definition elem.h:96
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition elem.C:442
static const unsigned int type_to_dim_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the geometric dimension of the ele...
Definition elem.h:628
static Point map(const unsigned int dim, const Elem *elem, const Point &reference_point)
Definition fe_map.C:1954
virtual dof_id_type n_elem() const =0
virtual dof_id_type max_elem_id() const =0
unsigned char default_mapping_data() const
Returns any default data value used by the master space to physical space mapping.
Definition mesh_base.h:959
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
Definition mesh.h:51
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition point.h:40
static std::unique_ptr< QBase > build(std::string_view name, const unsigned int dim, const Order order=INVALID_ORDER)
Builds a specific quadrature rule based on the name string.
auto norm() const
Communicator * TestCommWorld
MeshBase & mesh
void build_extrusion(UnstructuredMesh &mesh, const MeshBase &cross_section, const unsigned int nz, RealVectorValue extrusion_vector, QueryElemSubdomainIDBase *elem_subdomain=nullptr)
Meshes the tensor product of a 1D and a 1D-or-2D domain.
void build_sphere(UnstructuredMesh &mesh, const Real radius=1, const unsigned int n_refinements=2, const ElemType type=INVALID_ELEM, const unsigned int n_smooth=2, const bool flat=true)
Fills mesh with a mesh discretizing a ball (||x||<= radius) or sphere (||x|| = radius) domain.
void build_cube(UnstructuredMesh &mesh, const unsigned int nx=0, const unsigned int ny=0, const unsigned int nz=0, const Real xmin=0., const Real xmax=1., const Real ymin=0., const Real ymax=1., const Real zmin=0., const Real zmax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false)
Builds a (elements) cube.
void all_tri(MeshBase &mesh)
Subdivides any non-simplex elements in a Mesh to produce simplex (triangular in 2D,...
void all_rbb(MeshBase &mesh)
Converts all element geometric mappings from the default Lagrange to the more flexible Rational-Bezie...
Real volume(const MeshBase &mesh, unsigned int dim=libMesh::invalid_uint)
Find the total volume of a mesh (interpreting that as area for dim = 2, or total arc length for dim =...
The libMesh namespace provides an interface to certain functionality in the library.
ElemType
Defines an enum for geometric element types.
void libmesh_ignore(const Args &...)
@ RATIONAL_BERNSTEIN_MAP
const Real pi
.
Definition libmesh.h:292
static constexpr Real TOLERANCE
uint8_t dof_id_type
Definition id_types.h:67
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition int_range.h:176
const Real radius