libMesh
Public Member Functions | Protected Member Functions | List of all members
AllRBBTest Class Reference
Inheritance diagram for AllRBBTest:
[legend]

Public Member Functions

 LIBMESH_CPPUNIT_TEST_SUITE (AllRBBTest)
 The goal of this test is to verify proper operation of the all_rbb() mesh modification, by converting meshes of classic "isogeometric" types from Lagrange interpolants to Rational Bezier-Bernstein splines, then verifying that the converted geometry is exact to within floating-point error (for point radii) or quadrature error (for element volume). More...
 
 CPPUNIT_TEST (testAllRBBNodeElem)
 
 CPPUNIT_TEST (testAllRBBEdge)
 
 CPPUNIT_TEST (testAllRBBEdge3)
 
 CPPUNIT_TEST (testAllRBBTri)
 
 CPPUNIT_TEST (testAllRBBTri6)
 
 CPPUNIT_TEST (testAllRBBQuad)
 
 CPPUNIT_TEST (testAllRBBQuad8)
 
 CPPUNIT_TEST (testAllRBBQuad9)
 
 CPPUNIT_TEST (testAllRBBCircle4)
 
 CPPUNIT_TEST (testAllRBBCircle8)
 
 CPPUNIT_TEST (testAllRBBCircle16)
 
 CPPUNIT_TEST (testAllRBBDisk5)
 
 CPPUNIT_TEST (testAllRBBDisk20)
 
 CPPUNIT_TEST (testAllRBBDisk80)
 
 CPPUNIT_TEST (testAllRBBTri6Disk10)
 
 CPPUNIT_TEST (testAllRBBTri6Disk40)
 
 CPPUNIT_TEST (testAllRBBTri6Disk160)
 
 CPPUNIT_TEST (testAllRBBTet)
 
 CPPUNIT_TEST (testAllRBBTet10)
 
 CPPUNIT_TEST (testAllRBBHex)
 
 CPPUNIT_TEST (testAllRBBHex20)
 
 CPPUNIT_TEST (testAllRBBHex27)
 
 CPPUNIT_TEST (testAllRBBCylinder10)
 
 CPPUNIT_TEST (testAllRBBCylinder80)
 
 CPPUNIT_TEST_SUITE_END ()
 
void setUp ()
 
void tearDown ()
 
void testAllRBBNodeElem ()
 
void testAllRBBEdge ()
 
void testAllRBBEdge3 ()
 
void testAllRBBTri ()
 
void testAllRBBTri6 ()
 
void testAllRBBQuad ()
 
void testAllRBBQuad8 ()
 
void testAllRBBQuad9 ()
 
void testAllRBBTet ()
 
void testAllRBBTet10 ()
 
void testAllRBBHex ()
 
void testAllRBBHex20 ()
 
void testAllRBBHex27 ()
 
void testAllRBBCircle4 ()
 
void testAllRBBCircle8 ()
 
void testAllRBBCircle16 ()
 
void testAllRBBDisk5 ()
 
void testAllRBBDisk20 ()
 
void testAllRBBDisk80 ()
 
void testAllRBBTri6Disk10 ()
 
void testAllRBBTri6Disk40 ()
 
void testAllRBBTri6Disk160 ()
 
void testAllRBBCylinder10 ()
 
void testAllRBBCylinder80 ()
 

Protected Member Functions

void test_box (ElemType elem_type)
 
void test_circle (unsigned int n_refinements)
 
void test_disk (unsigned int n_refinements, const ElemType type=QUAD9)
 
void test_cylinder (unsigned int n_refinements, const ElemType type=HEX27)
 

Detailed Description

Definition at line 17 of file all_rbb.C.

Member Function Documentation

◆ CPPUNIT_TEST() [1/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBNodeElem  )

◆ CPPUNIT_TEST() [2/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBEdge  )

◆ CPPUNIT_TEST() [3/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBEdge3  )

◆ CPPUNIT_TEST() [4/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBTri  )

◆ CPPUNIT_TEST() [5/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBTri6  )

◆ CPPUNIT_TEST() [6/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBQuad  )

◆ CPPUNIT_TEST() [7/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBQuad8  )

◆ CPPUNIT_TEST() [8/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBQuad9  )

◆ CPPUNIT_TEST() [9/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBCircle4  )

◆ CPPUNIT_TEST() [10/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBCircle8  )

◆ CPPUNIT_TEST() [11/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBCircle16  )

◆ CPPUNIT_TEST() [12/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBDisk5  )

◆ CPPUNIT_TEST() [13/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBDisk20  )

◆ CPPUNIT_TEST() [14/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBDisk80  )

◆ CPPUNIT_TEST() [15/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBTri6Disk10  )

◆ CPPUNIT_TEST() [16/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBTri6Disk40  )

◆ CPPUNIT_TEST() [17/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBTri6Disk160  )

◆ CPPUNIT_TEST() [18/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBTet  )

◆ CPPUNIT_TEST() [19/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBTet10  )

◆ CPPUNIT_TEST() [20/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBHex  )

◆ CPPUNIT_TEST() [21/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBHex20  )

◆ CPPUNIT_TEST() [22/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBHex27  )

◆ CPPUNIT_TEST() [23/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBCylinder10  )

◆ CPPUNIT_TEST() [24/24]

AllRBBTest::CPPUNIT_TEST ( testAllRBBCylinder80  )

◆ CPPUNIT_TEST_SUITE_END()

AllRBBTest::CPPUNIT_TEST_SUITE_END ( )

◆ LIBMESH_CPPUNIT_TEST_SUITE()

AllRBBTest::LIBMESH_CPPUNIT_TEST_SUITE ( AllRBBTest  )

The goal of this test is to verify proper operation of the all_rbb() mesh modification, by converting meshes of classic "isogeometric" types from Lagrange interpolants to Rational Bezier-Bernstein splines, then verifying that the converted geometry is exact to within floating-point error (for point radii) or quadrature error (for element volume).

◆ setUp()

void AllRBBTest::setUp ( )
inline

Definition at line 360 of file all_rbb.C.

360 {}

◆ tearDown()

void AllRBBTest::tearDown ( )
inline

Definition at line 362 of file all_rbb.C.

362 {}

◆ test_box()

void AllRBBTest::test_box ( ElemType  elem_type)
inlineprotected

Definition at line 82 of file all_rbb.C.

References libMesh::MeshTools::Modification::all_rbb(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshBase::default_mapping_data(), dim, libMesh::MeshBase::max_elem_id(), mesh, libMesh::MeshBase::n_elem(), libMesh::RATIONAL_BERNSTEIN_MAP, libMesh::Real, TestCommWorld, libMesh::TOLERANCE, libMesh::Elem::type_to_dim_map, and libMesh::MeshTools::volume().

83  {
85 
86  auto dim = Elem::type_to_dim_map[elem_type];
87 
89  dim > 0 ? 2 : 0, dim > 1 ? 1 : 0, dim > 2 ? 1 : 0,
90  0., 1.,
91  0., 1.,
92  0., 1.,
93  elem_type);
94 
95  const auto n_orig_elem = mesh.n_elem();
96  CPPUNIT_ASSERT_EQUAL(n_orig_elem, mesh.max_elem_id());
97 
98  const Real orig_volume = MeshTools::volume(mesh) / n_orig_elem;
99 
100  std::vector<Real> orig_hmin(n_orig_elem), orig_hmax(n_orig_elem);
101 
102  // In the tet case our elements all have the same volume but
103  // they're stretched differently and have different hmin/hmax
104  for (auto & elem : mesh.element_ptr_range())
105  {
106  orig_hmin[elem->id()] = elem->hmin();
107  orig_hmax[elem->id()] = elem->hmax();
108  }
109 
111 
112  CPPUNIT_ASSERT_EQUAL(n_orig_elem, mesh.n_elem());
113  CPPUNIT_ASSERT_EQUAL(n_orig_elem, mesh.max_elem_id());
114 
115  unsigned char weight_index = mesh.default_mapping_data();
116 
117  for (auto & elem : mesh.element_ptr_range())
118  {
119  CPPUNIT_ASSERT_EQUAL(elem->mapping_type(),
121  CPPUNIT_ASSERT(elem->has_affine_map());
122 
123  // Tri6 has this much FP error??
124  LIBMESH_ASSERT_FP_EQUAL(elem->volume(), orig_volume,
125  20*TOLERANCE*TOLERANCE);
126  LIBMESH_ASSERT_FP_EQUAL(elem->hmax(), orig_hmax[elem->id()],
128  LIBMESH_ASSERT_FP_EQUAL(elem->hmin(), orig_hmin[elem->id()],
130  }
131 
132  for (auto & node : mesh.node_ptr_range())
133  {
134  const Real w = node->get_extra_datum<Real>(weight_index);
135 
136  CPPUNIT_ASSERT_EQUAL(Real(1), w);
137  }
138  }
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:218
static constexpr Real TOLERANCE
void all_rbb(MeshBase &mesh)
Converts all element geometric mappings from the default Lagrange to the more flexible Rational-Bezie...
unsigned int dim
MeshBase & mesh
unsigned char default_mapping_data() const
Returns any default data value used by the master space to physical space mapping.
Definition: mesh_base.h:949
virtual dof_id_type max_elem_id() const =0
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 =...
Definition: mesh_tools.C:1020
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual dof_id_type n_elem() const =0
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
Definition: mesh.h:50
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.

◆ test_circle()

void AllRBBTest::test_circle ( unsigned int  n_refinements)
inlineprotected

Definition at line 140 of file all_rbb.C.

References libMesh::MeshTools::Modification::all_rbb(), libMesh::MeshTools::Generation::build_sphere(), libMesh::FEMap::map(), libMesh::DistributedMesh::n_elem(), libMesh::TypeVector< T >::norm(), libMesh::pi, libMesh::QUAD9, radius, libMesh::RATIONAL_BERNSTEIN_MAP, libMesh::Real, TestCommWorld, libMesh::TOLERANCE, and libMesh::MeshTools::volume().

141  {
142  Mesh interior_mesh(*TestCommWorld),
143  boundary_mesh(*TestCommWorld);
144 
145  const Real radius = 1;
146  const Real circumference = 2 * pi * radius;
147  const Real tol = TOLERANCE*TOLERANCE;
148 
149  // Build a filled circle
151  n_refinements, QUAD9);
152 
153  // Get just the outer EDGE3 circle mesh
154  interior_mesh.get_boundary_info().sync(boundary_mesh);
155 
156  const dof_id_type n_edges = 4 << n_refinements;
157 
158  CPPUNIT_ASSERT_EQUAL(boundary_mesh.n_elem(), n_edges);
159  CPPUNIT_ASSERT_EQUAL(boundary_mesh.n_elem(), n_edges);
160 
161  for (auto & node : boundary_mesh.node_ptr_range())
162  {
163  const Point p = *node;
164  LIBMESH_ASSERT_FP_EQUAL(p.norm(), radius, tol);
165  }
166 
167  // We just did Lagrange interpolation, so our mesh measure
168  // shouldn't be *quite* right. Empirically, we converge from
169  // beneath, and our error looks like Ch^4.
170  const Real max_lagrange_error =
171  radius * 5e-2 / (1 << (4*n_refinements));
172  LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(boundary_mesh),
173  circumference, max_lagrange_error);
174 
175  MeshTools::Modification::all_rbb(boundary_mesh);
176 
177  for (auto & elem : boundary_mesh.element_ptr_range())
178  {
179  CPPUNIT_ASSERT_EQUAL(RATIONAL_BERNSTEIN_MAP, elem->mapping_type());
180 
181  // We can no longer assert that each Node is at a specified
182  // radius from the circle center, because these are now spline
183  // control nodes, but we can assert that physical points
184  // within the element are at the desired radius.
185  constexpr int n_intervals = 4;
186  Point master_pt;
187  for (master_pt(0) = -1; master_pt(0) <= 1 + TOLERANCE;
188  master_pt(0) += Real(2)/n_intervals)
189  {
190  const Point p = FEMap::map(elem->dim(), elem, master_pt);
191  LIBMESH_ASSERT_FP_EQUAL(radius, p.norm(), tol);
192  }
193  }
194 
195  // We're using quadrature for volume approximation, so we still
196  // have error, but our quadrature error looks something like Ch^6
197  // with a much smaller C.
198  const Real max_rbb_error =
199  radius * 1e-3 / (1 << (6*n_refinements));
200  LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(boundary_mesh),
201  circumference, max_rbb_error);
202  }
const Real radius
auto norm() const
Definition: type_vector.h:908
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:218
static constexpr Real TOLERANCE
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 =...
Definition: mesh_tools.C:1020
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)
Meshes a spherical or mapped-spherical domain.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
Definition: mesh.h:50
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
uint8_t dof_id_type
Definition: id_types.h:67
const Real pi
.
Definition: libmesh.h:292

◆ test_cylinder()

void AllRBBTest::test_cylinder ( unsigned int  n_refinements,
const ElemType  type = HEX27 
)
inlineprotected

Definition at line 269 of file all_rbb.C.

References libMesh::MeshTools::Modification::all_rbb(), libMesh::QBase::build(), libMesh::Elem::build(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::MeshTools::Generation::build_sphere(), libMesh::make_range(), libMesh::FEMap::map(), mesh, libMesh::MeshTools::n_elem(), libMesh::MeshBase::n_elem(), libMesh::TypeVector< T >::norm(), libMesh::pi, libMesh::QGRID, libMesh::QUAD9, radius, libMesh::RATIONAL_BERNSTEIN_MAP, libMesh::Real, TestCommWorld, libMesh::TOLERANCE, and libMesh::MeshTools::volume().

270  {
271  Mesh disk_mesh(*TestCommWorld), mesh(*TestCommWorld);
272 
273  const Real radius = 1;
274  const Real height = 3;
275  const Real volume = pi * radius * radius * height;
276  const Real tol = TOLERANCE*TOLERANCE;
277 
278  // We're extruding a circle from side 0 up
279  const ElemType side_type = Elem::build(type)->side_type(0);
280 
281  // Build a filled circle
283  n_refinements, side_type);
284 
285  // Then extrude it into a cylinder
286  const unsigned int nz = 2;
287  const RealVectorValue extrusion_vector{0,0,height};
288  MeshTools::Generation::build_extrusion (mesh, disk_mesh, nz, extrusion_vector);
289 
290  const dof_id_type n_elem =
291  (5 << (n_refinements*2)) * (side_type == QUAD9 ? 1 : 2) * nz;
292 
293  CPPUNIT_ASSERT_EQUAL(mesh.n_elem(), n_elem);
294 
295  // We just did Lagrange interpolation, so our mesh measure
296  // shouldn't be *quite* right, but we should converge similarly to
297  // how we did with the filled disk.
298  const Real max_lagrange_error =
299  radius * 5e-2 / (1 << (4*n_refinements)) *
300  radius * radius * height;
301 
302  LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(mesh),
303  volume, max_lagrange_error);
304 
306 
307  std::unique_ptr<const Elem> elem_side;
308  constexpr int n_intervals = 4;
309  auto qrule = QBase::build(QGRID, /*dim=*/2, Order(n_intervals));
310 
311  for (const Elem * elem : mesh.element_ptr_range())
312  {
313  CPPUNIT_ASSERT_EQUAL(RATIONAL_BERNSTEIN_MAP, elem->mapping_type());
314 
315  // We cannot assert that each Node is at a specified radius
316  // from the cylinder axis, because these are now spline
317  // control nodes, but we can assert that physical points
318  // within the rounded surface are at the desired radius.
319  for (auto s : make_range(elem->n_sides()))
320  {
321  if (elem->neighbor_ptr(s))
322  continue;
323 
324  const Point side_normal =
325  elem->side_vertex_average_normal(s);
326 
327  // We ought to either be on the rounded surface or the end
328  // caps
329  if (std::abs(side_normal(2)) > TOLERANCE*TOLERANCE)
330  {
331  LIBMESH_ASSERT_FP_EQUAL(side_normal(0), 0, TOLERANCE*TOLERANCE);
332  LIBMESH_ASSERT_FP_EQUAL(side_normal(1), 0, TOLERANCE*TOLERANCE);
333  continue;
334  }
335 
336  elem->build_side_ptr(elem_side, s);
337  qrule->init(*elem_side);
338 
339  for (auto i : make_range(qrule->n_points()))
340  {
341  Point p = FEMap::map(elem_side->dim(), elem_side.get(), qrule->qp(i));
342  p(2) = 0; // Just look at r in cylindrical coordinates
343  LIBMESH_ASSERT_FP_EQUAL(radius, p.norm(), tol);
344  }
345  }
346  }
347 
348  // We're using quadrature for volume approximation, so we still
349  // have error, but our quadrature error looks like Ch^6 with a
350  // much smaller C.
351  const Real max_rbb_error =
352  radius * 2e-3 / (1 << (6*n_refinements)) *
353  radius * radius * height;
354  LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(mesh),
355  volume, max_rbb_error);
356  }
ElemType
Defines an enum for geometric element types.
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.
Order
defines an enum for polynomial orders.
Definition: enum_order.h:40
const Real radius
auto norm() const
Definition: type_vector.h:908
dof_id_type n_elem(const MeshBase::const_element_iterator &begin, const MeshBase::const_element_iterator &end)
Count up the number of elements of a specific type (as defined by an iterator range).
Definition: mesh_tools.C:1004
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:218
static constexpr Real TOLERANCE
void all_rbb(MeshBase &mesh)
Converts all element geometric mappings from the default Lagrange to the more flexible Rational-Bezie...
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
MeshBase & mesh
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 =...
Definition: mesh_tools.C:1020
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)
Meshes a spherical or mapped-spherical domain.
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
virtual dof_id_type n_elem() const =0
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
Definition: mesh.h:50
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
uint8_t dof_id_type
Definition: id_types.h:67
const Real pi
.
Definition: libmesh.h:292

◆ test_disk()

void AllRBBTest::test_disk ( unsigned int  n_refinements,
const ElemType  type = QUAD9 
)
inlineprotected

Definition at line 204 of file all_rbb.C.

References libMesh::MeshTools::Modification::all_rbb(), libMesh::MeshTools::Generation::build_sphere(), libMesh::libmesh_ignore(), libMesh::make_range(), libMesh::FEMap::map(), mesh, libMesh::MeshTools::n_elem(), libMesh::MeshBase::n_elem(), libMesh::TypeVector< T >::norm(), libMesh::pi, libMesh::QUAD9, radius, libMesh::RATIONAL_BERNSTEIN_MAP, libMesh::Real, TestCommWorld, libMesh::TOLERANCE, and libMesh::MeshTools::volume().

205  {
207 
208  const Real radius = 1;
209  const Real area = pi * radius * radius;
210  const Real tol = TOLERANCE*TOLERANCE;
211 
212  // Build a filled circle
214  n_refinements, type);
215 
216  const dof_id_type n_elem =
217  (5 << (n_refinements*2)) * (type == QUAD9 ? 1 : 2);
218 
219  CPPUNIT_ASSERT_EQUAL(mesh.n_elem(), n_elem);
220 
221  // We just did Lagrange interpolation, so our mesh measure
222  // shouldn't be *quite* right. Empirically, we converge from
223  // beneath, and our error looks like Ch^4.
224  const Real max_lagrange_error =
225  radius * 5e-2 / (1 << (4*n_refinements));
226 
227  LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(mesh),
228  area, max_lagrange_error);
229 
231 
232  for (const Elem * elem : mesh.element_ptr_range())
233  {
234  CPPUNIT_ASSERT_EQUAL(RATIONAL_BERNSTEIN_MAP, elem->mapping_type());
235 
236  // We can no longer assert that each Node is at a specified
237  // radius from the circle center, because these are now spline
238  // control nodes, but we can assert that physical points
239  // within the element are at the desired radius.
240  for (auto s : make_range(elem->n_sides()))
241  {
242  if (elem->neighbor_ptr(s))
243  continue;
244 
245  constexpr int n_intervals = 4;
246  Point master_pt = elem->master_point(s);
247  const Point step =
248  (elem->master_point((s+1)%elem->n_sides()) - master_pt)
249  / n_intervals;
250  for (auto i : make_range(n_intervals+1))
251  {
252  libmesh_ignore(i);
253  const Point p = FEMap::map(elem->dim(), elem, master_pt);
254  LIBMESH_ASSERT_FP_EQUAL(radius, p.norm(), tol);
255  master_pt += step;
256  }
257  }
258  }
259 
260  // We're using quadrature for volume approximation, so we still
261  // have error, but our quadrature error looks like Ch^6 with a
262  // much smaller C.
263  const Real max_rbb_error =
264  radius * 2e-3 / (1 << (6*n_refinements));
265  LIBMESH_ASSERT_FP_EQUAL(MeshTools::volume(mesh),
266  area, max_rbb_error);
267  }
const Real radius
auto norm() const
Definition: type_vector.h:908
dof_id_type n_elem(const MeshBase::const_element_iterator &begin, const MeshBase::const_element_iterator &end)
Count up the number of elements of a specific type (as defined by an iterator range).
Definition: mesh_tools.C:1004
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:218
static constexpr Real TOLERANCE
void all_rbb(MeshBase &mesh)
Converts all element geometric mappings from the default Lagrange to the more flexible Rational-Bezie...
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
MeshBase & mesh
void libmesh_ignore(const Args &...)
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 =...
Definition: mesh_tools.C:1020
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)
Meshes a spherical or mapped-spherical domain.
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
virtual dof_id_type n_elem() const =0
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
Definition: mesh.h:50
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
uint8_t dof_id_type
Definition: id_types.h:67
const Real pi
.
Definition: libmesh.h:292

◆ testAllRBBCircle16()

void AllRBBTest::testAllRBBCircle16 ( )
inline

Definition at line 388 of file all_rbb.C.

388 { LOG_UNIT_TEST; test_circle(2); }
void test_circle(unsigned int n_refinements)
Definition: all_rbb.C:140

◆ testAllRBBCircle4()

void AllRBBTest::testAllRBBCircle4 ( )
inline

Definition at line 386 of file all_rbb.C.

386 { LOG_UNIT_TEST; test_circle(0); }
void test_circle(unsigned int n_refinements)
Definition: all_rbb.C:140

◆ testAllRBBCircle8()

void AllRBBTest::testAllRBBCircle8 ( )
inline

Definition at line 387 of file all_rbb.C.

387 { LOG_UNIT_TEST; test_circle(1); }
void test_circle(unsigned int n_refinements)
Definition: all_rbb.C:140

◆ testAllRBBCylinder10()

void AllRBBTest::testAllRBBCylinder10 ( )
inline

Definition at line 402 of file all_rbb.C.

402 { LOG_UNIT_TEST; test_cylinder(0); }
void test_cylinder(unsigned int n_refinements, const ElemType type=HEX27)
Definition: all_rbb.C:269

◆ testAllRBBCylinder80()

void AllRBBTest::testAllRBBCylinder80 ( )
inline

Definition at line 403 of file all_rbb.C.

403 { LOG_UNIT_TEST; test_cylinder(1); }
void test_cylinder(unsigned int n_refinements, const ElemType type=HEX27)
Definition: all_rbb.C:269

◆ testAllRBBDisk20()

void AllRBBTest::testAllRBBDisk20 ( )
inline

Definition at line 393 of file all_rbb.C.

393 { LOG_UNIT_TEST; test_disk(1); }
void test_disk(unsigned int n_refinements, const ElemType type=QUAD9)
Definition: all_rbb.C:204

◆ testAllRBBDisk5()

void AllRBBTest::testAllRBBDisk5 ( )
inline

Definition at line 392 of file all_rbb.C.

392 { LOG_UNIT_TEST; test_disk(0); }
void test_disk(unsigned int n_refinements, const ElemType type=QUAD9)
Definition: all_rbb.C:204

◆ testAllRBBDisk80()

void AllRBBTest::testAllRBBDisk80 ( )
inline

Definition at line 394 of file all_rbb.C.

394 { LOG_UNIT_TEST; test_disk(2); }
void test_disk(unsigned int n_refinements, const ElemType type=QUAD9)
Definition: all_rbb.C:204

◆ testAllRBBEdge()

void AllRBBTest::testAllRBBEdge ( )
inline

Definition at line 365 of file all_rbb.C.

References libMesh::EDGE2.

365 { LOG_UNIT_TEST; test_box(EDGE2); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBEdge3()

void AllRBBTest::testAllRBBEdge3 ( )
inline

Definition at line 366 of file all_rbb.C.

References libMesh::EDGE3.

366 { LOG_UNIT_TEST; test_box(EDGE3); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBHex()

void AllRBBTest::testAllRBBHex ( )
inline

Definition at line 374 of file all_rbb.C.

References libMesh::HEX8.

374 { LOG_UNIT_TEST; test_box(HEX8); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBHex20()

void AllRBBTest::testAllRBBHex20 ( )
inline

Definition at line 375 of file all_rbb.C.

References libMesh::HEX20.

375 { LOG_UNIT_TEST; test_box(HEX20); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBHex27()

void AllRBBTest::testAllRBBHex27 ( )
inline

Definition at line 376 of file all_rbb.C.

References libMesh::HEX27.

376 { LOG_UNIT_TEST; test_box(HEX27); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBNodeElem()

void AllRBBTest::testAllRBBNodeElem ( )
inline

Definition at line 364 of file all_rbb.C.

References libMesh::NODEELEM.

364 { LOG_UNIT_TEST; test_box(NODEELEM); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBQuad()

void AllRBBTest::testAllRBBQuad ( )
inline

Definition at line 369 of file all_rbb.C.

References libMesh::QUAD4.

369 { LOG_UNIT_TEST; test_box(QUAD4); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBQuad8()

void AllRBBTest::testAllRBBQuad8 ( )
inline

Definition at line 370 of file all_rbb.C.

References libMesh::QUAD8.

370 { LOG_UNIT_TEST; test_box(QUAD8); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBQuad9()

void AllRBBTest::testAllRBBQuad9 ( )
inline

Definition at line 371 of file all_rbb.C.

References libMesh::QUAD9.

371 { LOG_UNIT_TEST; test_box(QUAD9); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBTet()

void AllRBBTest::testAllRBBTet ( )
inline

Definition at line 372 of file all_rbb.C.

References libMesh::TET4.

372 { LOG_UNIT_TEST; test_box(TET4); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBTet10()

void AllRBBTest::testAllRBBTet10 ( )
inline

Definition at line 373 of file all_rbb.C.

References libMesh::TET10.

373 { LOG_UNIT_TEST; test_box(TET10); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBTri()

void AllRBBTest::testAllRBBTri ( )
inline

Definition at line 367 of file all_rbb.C.

References libMesh::TRI3.

367 { LOG_UNIT_TEST; test_box(TRI3); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBTri6()

void AllRBBTest::testAllRBBTri6 ( )
inline

Definition at line 368 of file all_rbb.C.

References libMesh::TRI6.

368 { LOG_UNIT_TEST; test_box(TRI6); }
void test_box(ElemType elem_type)
Definition: all_rbb.C:82

◆ testAllRBBTri6Disk10()

void AllRBBTest::testAllRBBTri6Disk10 ( )
inline

Definition at line 396 of file all_rbb.C.

References libMesh::TRI6.

396 { LOG_UNIT_TEST; test_disk(0, TRI6); }
void test_disk(unsigned int n_refinements, const ElemType type=QUAD9)
Definition: all_rbb.C:204

◆ testAllRBBTri6Disk160()

void AllRBBTest::testAllRBBTri6Disk160 ( )
inline

Definition at line 398 of file all_rbb.C.

References libMesh::TRI6.

398 { LOG_UNIT_TEST; test_disk(2, TRI6); }
void test_disk(unsigned int n_refinements, const ElemType type=QUAD9)
Definition: all_rbb.C:204

◆ testAllRBBTri6Disk40()

void AllRBBTest::testAllRBBTri6Disk40 ( )
inline

Definition at line 397 of file all_rbb.C.

References libMesh::TRI6.

397 { LOG_UNIT_TEST; test_disk(1, TRI6); }
void test_disk(unsigned int n_refinements, const ElemType type=QUAD9)
Definition: all_rbb.C:204

The documentation for this class was generated from the following file: