2 #include <libmesh/cell_c0polyhedron.h> 3 #include <libmesh/elem.h> 4 #include <libmesh/enum_elem_type.h> 5 #include <libmesh/face_c0polygon.h> 6 #include <libmesh/mesh_generation.h> 7 #include <libmesh/mesh_modification.h> 8 #include <libmesh/mesh.h> 9 #include <libmesh/reference_elem.h> 10 #include <libmesh/replicated_mesh.h> 11 #include <libmesh/node.h> 12 #include <libmesh/enum_to_string.h> 13 #include <libmesh/tensor_value.h> 14 #include <libmesh/enum_elem_quality.h> 30 CPPUNIT_TEST( testTwistedVolume );
31 CPPUNIT_TEST( testEdge3Volume );
32 CPPUNIT_TEST( testEdge3Invertible );
33 CPPUNIT_TEST( testEdge4Invertible );
34 CPPUNIT_TEST( testQuad4Invertible );
35 CPPUNIT_TEST( testTri3TrueCentroid );
36 CPPUNIT_TEST( testQuad4TrueCentroid );
37 CPPUNIT_TEST( testPyramid5TrueCentroid );
38 CPPUNIT_TEST( testHex8TrueCentroid );
39 CPPUNIT_TEST( testPrism6TrueCentroid );
40 CPPUNIT_TEST( testHex20PLevelTrueCentroid );
41 CPPUNIT_TEST( testQuad4AspectRatio );
42 CPPUNIT_TEST( testQuad4Warpage );
43 CPPUNIT_TEST( testQuad4MinMaxAngle );
44 CPPUNIT_TEST( testQuad4Jacobian );
45 CPPUNIT_TEST( testTri3AspectRatio );
46 CPPUNIT_TEST( testTet4DihedralAngle );
47 CPPUNIT_TEST( testTet4Jacobian );
48 CPPUNIT_TEST( testC0PolygonSquare );
49 CPPUNIT_TEST( testC0PolygonQuad );
50 CPPUNIT_TEST( testC0PolygonPentagon );
51 CPPUNIT_TEST( testC0PolygonHexagon );
52 CPPUNIT_TEST( testC0PolyhedronCube );
53 CPPUNIT_TEST( testC0PolyhedronHexagonalPrism );
54 CPPUNIT_TEST_SUITE_END();
90 Point base_class_centroid = quad4.Elem::true_centroid();
109 for (
const auto & elem :
mesh.element_ptr_range())
111 Point derived_centroid = elem->true_centroid();
112 Point base_centroid = elem->Elem::true_centroid();
123 Real derived_volume = elem->volume();
124 Real base_volume = elem->Elem::volume();
144 test_true_centroid_and_volume(
PYRAMID5);
157 #ifdef LIBMESH_ENABLE_AMR 171 #endif // LIBMESH_ENABLE_AMR 192 prism6->
point(1) *= -1;
198 CPPUNIT_ASSERT_LESS(
TOLERANCE, std::abs(vol-gold_vol));
207 CPPUNIT_ASSERT_EQUAL(static_cast<dof_id_type>(3),
mesh.
n_nodes());
217 auto & middle_node = edge3->
node_ref(2);
218 auto & right_node = edge3->node_ref(1);
223 middle_node =
Point(0.5 + 1.e-3, 0., 0.);
229 middle_node =
Point(0.5 - 1.e-3, 0., 0.);
233 middle_node =
Point(0.5, 0.25, 0.);
234 right_node =
Point(1., 1., 0.);
235 LIBMESH_ASSERT_FP_EQUAL(1.4789428575446, edge3->volume(),
TOLERANCE);
240 middle_node =
Point(0.5, 0.1, 0.);
241 right_node =
Point(1., 0., 0.);
242 LIBMESH_ASSERT_FP_EQUAL(edge3->Elem::volume(), edge3->volume(), 1e-4);
255 bool invertible = test_elem_invertible({
256 Point(-3.566160e1, -6.690970e-1, 1.100328e2),
257 Point(-3.566160e1, -6.690970e-1, 1.176528e2),
258 Point(-3.566160e1, -6.690970e-1, 1.115568e2)},
EDGE3);
259 CPPUNIT_ASSERT(!invertible);
263 invertible = test_elem_invertible({
264 Point(-3.566160e1, -6.690970e-1, 1.100328e2),
265 Point(-3.566160e1, -6.690970e-1, 1.176528e2),
266 Point(-3.566160e1, -6.690970e-1, 113.8428)},
EDGE3);
267 CPPUNIT_ASSERT(invertible);
272 CPPUNIT_ASSERT(!invertible);
289 test_elem_invertible({
Point(-1, 0, 0),
Point(1, 0, 0),
Point(-0.5, 0, 0),
Point(
Real(1)/3, 0, 0)},
291 CPPUNIT_ASSERT(invertible);
295 test_elem_invertible({
Point(-1, 0, 0),
Point(1, 0, 0),
Point(-0.57, 0, 0),
Point(
Real(1)/3, 0, 0)},
297 CPPUNIT_ASSERT(!invertible);
304 test_elem_invertible({
Point(-1, 0, 0),
Point(1, 0, 0),
Point(
Real(3)/21, 0, 0),
Point(
Real(1)/3, 0, 0)},
306 CPPUNIT_ASSERT(invertible);
310 test_elem_invertible({
Point(-1, 0, 0),
Point(1, 0, 0),
Point(
Real(6)/21, 0, 0),
Point(
Real(1)/3, 0, 0)},
312 CPPUNIT_ASSERT(!invertible);
324 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)};
325 bool invertible = test_elem_invertible(pts,
QUAD4);
326 CPPUNIT_ASSERT(invertible);
335 for (
auto & pt : pts)
338 invertible = test_elem_invertible(pts,
QUAD4);
339 CPPUNIT_ASSERT(invertible);
346 for (
auto & pt : pts)
349 invertible = test_elem_invertible(pts,
QUAD4);
350 CPPUNIT_ASSERT(invertible);
357 for (
int cnt=0; cnt<3; ++cnt)
358 for (
auto & pt : pts)
361 invertible = test_elem_invertible(pts,
QUAD4);
362 CPPUNIT_ASSERT(invertible);
373 const Real alpha = .5;
376 test_elem_invertible({
Point(0, 0, 0),
Point(1, 0, 0),
Point(alpha, alpha, 0),
Point(0, 1, 0)},
QUAD4);
378 CPPUNIT_ASSERT(!invertible);
384 const Real alpha = -0.25;
387 test_elem_invertible({
Point(0, 0, 0),
Point(1, 0, 0),
Point(alpha, 1, 0),
Point(0, 1, 0)},
QUAD4);
389 CPPUNIT_ASSERT(!invertible);
395 const Real alpha = std::log(2);
398 test_elem_invertible({
Point(alpha, alpha, alpha),
399 Point(alpha, alpha, alpha),
400 Point(alpha, alpha, alpha),
403 CPPUNIT_ASSERT(!invertible);
416 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)};
417 auto [elem, nodes] = this->construct_elem(pts,
QUAD4);
422 LIBMESH_ASSERT_FP_EQUAL(1.0, aspect_ratio,
TOLERANCE);
431 for (
auto & pt : pts)
435 LIBMESH_ASSERT_FP_EQUAL(1.0, aspect_ratio,
TOLERANCE);
442 for (
auto & pt : pts)
446 LIBMESH_ASSERT_FP_EQUAL(1.0, aspect_ratio,
TOLERANCE);
453 for (
int cnt=0; cnt<3; ++cnt)
454 for (
auto & pt : pts)
458 LIBMESH_ASSERT_FP_EQUAL(1.0, aspect_ratio,
TOLERANCE);
467 auto test_rhombus_quad = [
this](
Real theta)
469 Real ct = std::cos(theta);
470 Real st = std::sin(theta);
471 std::vector<Point> pts = {
474 Point(1. + ct, st, 0),
476 auto [elem, nodes] = this->construct_elem(pts,
QUAD4);
481 LIBMESH_ASSERT_FP_EQUAL(1.0/st, aspect_ratio,
TOLERANCE);
497 auto test_rectangle_quad = [
this](
Real a)
499 std::vector<Point> pts = {
Point(0, 0, 0),
Point(a, 0, 0),
Point(a, 1, 0),
Point(0, 1, 0)};
500 auto [elem, nodes] = this->construct_elem(pts,
QUAD4);
505 LIBMESH_ASSERT_FP_EQUAL(a, aspect_ratio,
TOLERANCE);
509 test_rectangle_quad(2.0);
512 test_rectangle_quad(1e6);
526 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 0, 0),
Point(0, 1, 0)};
527 auto [elem, nodes] = this->construct_elem(pts,
QUAD4);
531 LIBMESH_ASSERT_FP_EQUAL(2.5, aspect_ratio,
TOLERANCE);
536 auto test_trapezoid_quad = [
this](
Real a)
539 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1-a, 1, 0),
Point(a, 1, 0)};
540 auto [elem, nodes] = this->construct_elem(pts,
QUAD4);
544 LIBMESH_ASSERT_FP_EQUAL(1./(1. - a), aspect_ratio,
TOLERANCE);
548 test_trapezoid_quad(1./3);
551 test_trapezoid_quad(0.5);
561 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(0, 1, 0)};
562 auto [elem, nodes] = this->construct_elem(pts,
TRI3);
574 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(0.5, 0.5*std::sqrt(3), 0)};
575 auto [elem, nodes] = this->construct_elem(pts,
TRI3);
588 std::vector<Point> pts = {
Point(0, 0, 0),
Point(L, 0, 0),
Point(0, 1, 0)};
589 auto [elem, nodes] = this->construct_elem(pts,
TRI3);
609 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)};
610 auto [elem, nodes] = this->construct_elem(pts,
QUAD4);
615 LIBMESH_ASSERT_FP_EQUAL(1.0, warpage,
TOLERANCE);
624 for (
auto & pt : pts)
627 warpage = elem->quality(
WARP);
628 LIBMESH_ASSERT_FP_EQUAL(1.0, warpage,
TOLERANCE);
635 for (
auto & pt : pts)
638 warpage = elem->quality(
WARP);
639 LIBMESH_ASSERT_FP_EQUAL(1.0, warpage,
TOLERANCE);
646 for (
int cnt=0; cnt<3; ++cnt)
647 for (
auto & pt : pts)
650 warpage = elem->quality(
WARP);
651 LIBMESH_ASSERT_FP_EQUAL(1.0, warpage,
TOLERANCE);
656 auto test_warped_quad = [
this](
Real h)
658 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, h),
Point(0, 1, 0)};
659 auto [elem, nodes] = this->construct_elem(pts,
QUAD4);
666 LIBMESH_ASSERT_FP_EQUAL(
Real(1) / (h*h + 1), warpage,
TOLERANCE);
671 test_warped_quad(0.1);
676 test_warped_quad(0.3);
689 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)};
690 auto [elem, nodes] = this->construct_elem(pts,
QUAD4);
697 LIBMESH_ASSERT_FP_EQUAL(90, min_angle,
TOLERANCE);
698 LIBMESH_ASSERT_FP_EQUAL(90, max_angle,
TOLERANCE);
708 for (
auto & pt : pts)
714 LIBMESH_ASSERT_FP_EQUAL(90, min_angle,
TOLERANCE);
715 LIBMESH_ASSERT_FP_EQUAL(90, max_angle,
TOLERANCE);
723 for (
auto & pt : pts)
729 LIBMESH_ASSERT_FP_EQUAL(90, min_angle,
TOLERANCE);
730 LIBMESH_ASSERT_FP_EQUAL(90, max_angle,
TOLERANCE);
738 for (
int cnt=0; cnt<3; ++cnt)
739 for (
auto & pt : pts)
745 LIBMESH_ASSERT_FP_EQUAL(90, min_angle,
TOLERANCE);
746 LIBMESH_ASSERT_FP_EQUAL(90, max_angle,
TOLERANCE);
757 auto test_rhombus_quad = [
this](
Real theta)
759 Real ct = std::cos(theta);
760 Real st = std::sin(theta);
761 std::vector<Point> pts = {
764 Point(1. + ct, st, 0),
766 auto [elem, nodes] = this->construct_elem(pts,
QUAD4);
795 auto test_rhombus_quad = [
this](
Real theta)
797 Real ct = std::cos(theta);
798 Real st = std::sin(theta);
799 std::vector<Point> pts = {
802 Point(1. + ct, st, 0),
804 auto [elem, nodes] = this->construct_elem(pts,
QUAD4);
814 LIBMESH_ASSERT_FP_EQUAL(std::abs(std::sin(theta)), jac,
TOLERANCE);
815 LIBMESH_ASSERT_FP_EQUAL(std::abs(std::sin(theta)), scaled_jac,
TOLERANCE);
835 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(0, 1, 0),
Point(1, 1, 0.01)};
836 auto [elem, nodes] = this->construct_elem(pts,
TET4);
850 LIBMESH_ASSERT_FP_EQUAL(44.9985676771277, min_angle,
TOLERANCE);
851 LIBMESH_ASSERT_FP_EQUAL(90, max_angle,
TOLERANCE);
854 CPPUNIT_ASSERT_LESS(
Real(1), min_dihedral_angle);
855 CPPUNIT_ASSERT_LESS(
Real(1), max_dihedral_angle);
867 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(0, 1, 0),
Point(1, 1, h)};
868 auto [elem, nodes] = this->construct_elem(pts,
TET4);
878 LIBMESH_ASSERT_FP_EQUAL(h, jac,
TOLERANCE);
879 LIBMESH_ASSERT_FP_EQUAL(h/(h*h+1)/std::sqrt(h*h+2),
890 std::vector<Point> pts = {
891 Point(2.5, 2.5, 4.5),
892 Point(3.5, 1.5, 5.5),
893 Point(1.5, 1.5, 5.5),
896 auto [elem, nodes] = this->construct_elem(pts,
TET4);
906 LIBMESH_ASSERT_FP_EQUAL(2, jac,
TOLERANCE);
914 Real expected_volume)
918 const auto np = points.size();
919 std::unique_ptr<Elem> polygon = std::make_unique<C0Polygon>(np);
924 polygon->set_id() = 0;
928 const Real base_volume = elem->Elem::volume();
932 this->testC0PolygonMethods(
mesh, np);
940 testC0Polygon({{0,0}, {1,0}, {1,1}, {0,1}}, 1);
946 testC0Polygon({{0,0}, {1,0}, {1,2}, {-1,1}}, 2.5);
952 testC0Polygon({{0,0}, {1,0}, {1.5,0.5}, {1,1}, {0,1}}, 1.25);
958 testC0Polygon({{0,0}, {1,0}, {1.5,0.5}, {1,1}, {0,1}, {-0.5, 0.5}}, 1.5);
967 std::pair<std::unique_ptr<Elem>, std::vector<std::unique_ptr<Node>>>
971 const unsigned int n_points = pts.size();
974 std::vector<std::unique_ptr<Node>> nodes(n_points);
975 for (
unsigned int i=0; i<n_points; i++)
979 std::unique_ptr<Elem> elem =
Elem::build(elem_type,
nullptr);
982 libmesh_error_msg_if(elem->n_nodes() != n_points,
983 "Wrong number of points " 985 <<
" provided to build a " 988 for (
unsigned int i=0; i<n_points; i++)
989 elem->set_node(i, nodes[i].get());
992 return std::make_pair(std::move(elem), std::move(nodes));
999 std::unique_ptr<libMesh::Node> mid_elem_node;
1000 std::unique_ptr<Elem> polyhedron = std::make_unique<C0Polyhedron>(sides, mid_elem_node);
1003 polyhedron->
set_id() = 0;
1013 unsigned int n_sides)
1016 bool found_elem = elem;
1018 CPPUNIT_ASSERT(found_elem);
1024 CPPUNIT_ASSERT_EQUAL(elem->
n_nodes(), n_sides);
1025 CPPUNIT_ASSERT_EQUAL(elem->
n_sub_elem(), n_sides);
1026 CPPUNIT_ASSERT_EQUAL(elem->
n_sides(), n_sides);
1027 CPPUNIT_ASSERT_EQUAL(elem->
n_vertices(), n_sides);
1028 CPPUNIT_ASSERT_EQUAL(elem->
n_edges(), n_sides);
1033 const unsigned int nsover2 = n_sides/2;
1044 CPPUNIT_ASSERT(!elem->
is_edge(i));
1045 CPPUNIT_ASSERT(!elem->
is_face(i));
1051 CPPUNIT_ASSERT_EQUAL(nodes.size(), std::size_t(2));
1052 CPPUNIT_ASSERT(nodes[0] == i ||
1054 CPPUNIT_ASSERT(nodes[0] == (i+1)%n_sides ||
1055 nodes[1] == (i+1)%n_sides);
1056 std::vector<unsigned int> edge_nodes = elem->
nodes_on_edge(i);
1057 CPPUNIT_ASSERT(nodes == edge_nodes);
1066 CPPUNIT_ASSERT_EQUAL(edge->type(),
EDGE2);
1067 CPPUNIT_ASSERT_EQUAL(edge->node_ptr(0),
mesh.
node_ptr(i));
1068 CPPUNIT_ASSERT_EQUAL(edge->node_ptr(1),
mesh.
node_ptr((i+1)%n_sides));
1082 bool found_elem = elem;
1084 CPPUNIT_ASSERT(found_elem);
1092 const int E = elem->
n_edges();
1093 const int F = elem->
n_faces();
1096 CPPUNIT_ASSERT_EQUAL(
int(elem->
n_nodes()), V);
1098 CPPUNIT_ASSERT_EQUAL(
int(elem->
n_nodes()), V + 1);
1099 CPPUNIT_ASSERT_EQUAL(
int(elem->
n_sides()), F);
1102 CPPUNIT_ASSERT_EQUAL(V-E+F, 2);
1107 std::vector<int> sides_on_vertex(V, 0);
1111 CPPUNIT_ASSERT_EQUAL(side->type(),
C0POLYGON);
1112 FE += side->n_edges();
1113 const int SV = side->n_vertices();
1117 CPPUNIT_ASSERT_EQUAL(nos.size(), std::size_t(SV));
1121 Node * sidenode = side->node_ptr(v);
1124 ++sides_on_vertex[n];
1127 CPPUNIT_ASSERT(side->is_vertex(v));
1128 CPPUNIT_ASSERT(!side->is_edge(v));
1130 CPPUNIT_ASSERT(!elem->
is_edge(n));
1131 CPPUNIT_ASSERT(!elem->
is_face(n));
1133 CPPUNIT_ASSERT(std::find(nos.begin(), nos.end(), n) != nos.end());
1138 CPPUNIT_ASSERT_EQUAL(E*2,
FE);
1141 CPPUNIT_ASSERT_LESSEQUAL(FV, V*3);
1142 for (
auto sov : sides_on_vertex)
1143 CPPUNIT_ASSERT_LESSEQUAL(sov, 3);
1151 Real expected_volume)
1154 const Real base_volume = elem->Elem::volume();
1175 const std::vector<std::vector<unsigned int>> nodes_on_side =
1184 std::vector<std::shared_ptr<Polygon>> sides(nodes_on_side.size());
1188 const auto & nodes_on_s = nodes_on_side[s];
1189 sides[s] = std::make_shared<C0Polygon>(nodes_on_s.size());
1194 const auto poly =
dynamic_cast<C0Polyhedron *
>(buildC0Polyhedron(sides,
mesh));
1195 testElemVolume(poly, 1);
1196 #ifdef LIBMESH_ENABLE_EXCEPTIONS 1197 testC0PolyhedronMethods(
mesh,
false);
1201 const auto subtet0_sides_to_poly_sides = poly->subelement_sides_to_poly_sides(0);
1203 CPPUNIT_ASSERT_EQUAL(1, subtet0_sides_to_poly_sides[1]);
1204 CPPUNIT_ASSERT_EQUAL(0, subtet0_sides_to_poly_sides[2]);
1205 CPPUNIT_ASSERT_EQUAL(2, subtet0_sides_to_poly_sides[3]);
1207 testC0PolyhedronMethods(
mesh,
true);
1232 const std::vector<std::vector<unsigned int>> nodes_on_side =
1233 { {0, 1, 2, 3, 4, 5},
1240 {6, 7, 8, 9, 10, 11} };
1243 std::vector<std::shared_ptr<Polygon>> sides(nodes_on_side.size());
1247 const auto & nodes_on_s = nodes_on_side[s];
1248 sides[s] = std::make_shared<C0Polygon>(nodes_on_s.size());
1253 const auto poly =
dynamic_cast<C0Polyhedron *
>(buildC0Polyhedron(sides,
mesh));
1254 CPPUNIT_ASSERT_EQUAL((
unsigned int)13, poly->n_nodes());
1255 testElemVolume(poly, 6);
1256 testC0PolyhedronMethods(
mesh,
true);
1259 const auto subtet0_sides_to_poly_sides = poly->subelement_sides_to_poly_sides(0);
1260 CPPUNIT_ASSERT_EQUAL(0, subtet0_sides_to_poly_sides[0]);
1275 auto [elem, nodes] = this->construct_elem(pts, elem_type);
1279 return elem->has_invertible_map();
1303 for (
const auto & elem :
mesh.element_ptr_range())
1305 Point derived_centroid = elem->true_centroid();
1306 Point base_centroid = elem->Elem::true_centroid();
1318 Real derived_volume = elem->volume();
1319 Real base_volume = elem->Elem::volume();
virtual Point true_centroid() const
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
Elem * buildC0Polyhedron(std::vector< std::shared_ptr< Polygon >> sides, MeshBase &mesh)
ElemType
Defines an enum for geometric element types.
void testQuad4TrueCentroid()
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
void testQuad4Invertible()
A Node is like a Point, but with more information.
void testEdge4Invertible()
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
unsigned int get_node_index(const Node *node_ptr) const
void testPrism6TrueCentroid()
virtual bool is_face(const unsigned int i) const =0
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
libMesh::Parallel::Communicator * TestCommWorld
static constexpr Real TOLERANCE
void testQuad4MinMaxAngle()
void testC0PolygonHexagon()
void testC0PolyhedronHexagonalPrism()
void prepare_for_use(const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
Prepare a newly created (or read) mesh for use.
bool test_elem_invertible(const std::vector< Point > &pts, ElemType elem_type)
This is the base class from which all geometric element types are derived.
void testC0PolyhedronMethods(MeshBase &mesh, bool has_midnode)
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
const Parallel::Communicator & comm() const
void testPyramid5TrueCentroid()
The libMesh namespace provides an interface to certain functionality in the library.
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
void testC0PolygonSquare()
virtual bool is_flipped() const =0
virtual Node * add_point(const Point &p, const dof_id_type id=DofObject::invalid_id, const processor_id_type proc_id=DofObject::invalid_processor_id)=0
Add a new Node at Point p to the end of the vertex array, with processor_id procid.
This is the MeshBase class.
void testC0Polygon(const std::vector< Point > &points, Real expected_volume)
void testElemVolume(const Elem *elem, Real expected_volume)
void testEdge3Invertible()
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const =0
A specific instantiation of the FEBase class.
void libmesh_ignore(const Args &...)
void testC0PolygonPentagon()
const int invalid_int
A number which is used quite often to represent an invalid or uninitialized value for an integer...
const Node & node_ref(const unsigned int i) const
virtual unsigned int n_nodes() const =0
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const =0
void testC0PolygonMethods(MeshBase &mesh, unsigned int n_sides)
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
void testTri3TrueCentroid()
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const =0
Similar to Elem::local_side_node(), but instead of a side id, takes an edge id and a node id on that ...
void testTet4DihedralAngle()
virtual unsigned int n_edges() const =0
CPPUNIT_TEST_SUITE_REGISTRATION(VolumeTest)
bool absolute_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
void testTri3AspectRatio()
void test_true_centroid_and_volume(ElemType elem_type)
virtual void flip(BoundaryInfo *boundary_info)=0
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
std::string enum_to_string(const T e)
void testHex20PLevelTrueCentroid()
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int) const =0
virtual Node * add_node(Node *n)=0
Add Node n to the end of the vertex array.
virtual const Elem * elem_ptr(const dof_id_type i) const =0
virtual unsigned int n_sides() const =0
static std::unique_ptr< Node > build(const Node &n)
virtual unsigned int n_vertices() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0
virtual const Elem * query_elem_ptr(const dof_id_type i) const =0
void max(const T &r, T &o, Request &req) const
std::pair< std::unique_ptr< Elem >, std::vector< std::unique_ptr< Node > > > construct_elem(const std::vector< Point > &pts, ElemType elem_type)
virtual bool is_vertex(const unsigned int i) const =0
virtual Real volume() const
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...
virtual bool has_invertible_map(Real tol=TOLERANCE *TOLERANCE) const
virtual unsigned int n_faces() const =0
The C0Polyhedron is an element in 3D with an arbitrary (but fixed) number of polygonal first-order (C...
virtual unsigned int n_sub_elem() const =0
void testQuad4AspectRatio()
virtual const Node * node_ptr(const dof_id_type i) const =0
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
virtual unsigned int opposite_side(const unsigned int s) const
virtual ElemType type() const =0
A Point defines a location in LIBMESH_DIM dimensional Real space.
const Point & point(const unsigned int i) const
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
void testC0PolyhedronCube()
virtual bool is_edge(const unsigned int i) const =0
const Elem & get(const ElemType type_in)
virtual dof_id_type n_nodes() const =0
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const =0
void testHex8TrueCentroid()
This class defines a tensor in LIBMESH_DIM dimensional Real or Complex space.