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>
97 Point base_class_centroid = quad4.Elem::true_centroid();
116 for (
const auto & elem :
mesh.element_ptr_range())
118 Point derived_centroid = elem->true_centroid();
119 Point base_centroid = elem->Elem::true_centroid();
130 Real derived_volume = elem->volume();
131 Real base_volume = elem->Elem::volume();
164#ifdef LIBMESH_ENABLE_AMR
199 prism6->
point(1) *= -1;
205 CPPUNIT_ASSERT_LESS(
TOLERANCE, std::abs(vol-gold_vol));
224 auto & middle_node = edge3->node_ref(2);
225 auto & right_node = edge3->node_ref(1);
230 middle_node =
Point(0.5 + 1.e-3, 0., 0.);
236 middle_node =
Point(0.5 - 1.e-3, 0., 0.);
240 middle_node =
Point(0.5, 0.25, 0.);
241 right_node =
Point(1., 1., 0.);
242 LIBMESH_ASSERT_FP_EQUAL(1.4789428575446, edge3->volume(),
TOLERANCE);
247 middle_node =
Point(0.5, 0.1, 0.);
248 right_node =
Point(1., 0., 0.);
249 LIBMESH_ASSERT_FP_EQUAL(edge3->Elem::volume(), edge3->volume(), 1e-4);
263 Point(-3.566160e1, -6.690970e-1, 1.100328e2),
264 Point(-3.566160e1, -6.690970e-1, 1.176528e2),
265 Point(-3.566160e1, -6.690970e-1, 1.115568e2)},
EDGE3);
266 CPPUNIT_ASSERT(!invertible);
271 Point(-3.566160e1, -6.690970e-1, 1.100328e2),
272 Point(-3.566160e1, -6.690970e-1, 1.176528e2),
273 Point(-3.566160e1, -6.690970e-1, 113.8428)},
EDGE3);
274 CPPUNIT_ASSERT(invertible);
279 CPPUNIT_ASSERT(!invertible);
296 test_elem_invertible({
Point(-1, 0, 0),
Point(1, 0, 0),
Point(-0.5, 0, 0),
Point(
Real(1)/3, 0, 0)},
298 CPPUNIT_ASSERT(invertible);
302 test_elem_invertible({
Point(-1, 0, 0),
Point(1, 0, 0),
Point(-0.57, 0, 0),
Point(
Real(1)/3, 0, 0)},
304 CPPUNIT_ASSERT(!invertible);
311 test_elem_invertible({
Point(-1, 0, 0),
Point(1, 0, 0),
Point(
Real(3)/21, 0, 0),
Point(
Real(1)/3, 0, 0)},
313 CPPUNIT_ASSERT(invertible);
317 test_elem_invertible({
Point(-1, 0, 0),
Point(1, 0, 0),
Point(
Real(6)/21, 0, 0),
Point(
Real(1)/3, 0, 0)},
319 CPPUNIT_ASSERT(!invertible);
331 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)};
333 CPPUNIT_ASSERT(invertible);
342 for (
auto & pt : pts)
346 CPPUNIT_ASSERT(invertible);
353 for (
auto & pt : pts)
357 CPPUNIT_ASSERT(invertible);
364 for (
int cnt=0; cnt<3; ++cnt)
365 for (
auto & pt : pts)
369 CPPUNIT_ASSERT(invertible);
380 const Real alpha = .5;
383 test_elem_invertible({
Point(0, 0, 0),
Point(1, 0, 0),
Point(alpha, alpha, 0),
Point(0, 1, 0)},
QUAD4);
385 CPPUNIT_ASSERT(!invertible);
391 const Real alpha = -0.25;
394 test_elem_invertible({
Point(0, 0, 0),
Point(1, 0, 0),
Point(alpha, 1, 0),
Point(0, 1, 0)},
QUAD4);
396 CPPUNIT_ASSERT(!invertible);
402 const Real alpha = std::log(2);
406 Point(alpha, alpha, alpha),
407 Point(alpha, alpha, alpha),
410 CPPUNIT_ASSERT(!invertible);
423 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)};
429 LIBMESH_ASSERT_FP_EQUAL(1.0, aspect_ratio,
TOLERANCE);
438 for (
auto & pt : pts)
442 LIBMESH_ASSERT_FP_EQUAL(1.0, aspect_ratio,
TOLERANCE);
449 for (
auto & pt : pts)
453 LIBMESH_ASSERT_FP_EQUAL(1.0, aspect_ratio,
TOLERANCE);
460 for (
int cnt=0; cnt<3; ++cnt)
461 for (
auto & pt : pts)
465 LIBMESH_ASSERT_FP_EQUAL(1.0, aspect_ratio,
TOLERANCE);
474 auto test_rhombus_quad = [
this](
Real theta)
476 Real ct = std::cos(theta);
477 Real st = std::sin(theta);
478 std::vector<Point> pts = {
481 Point(1. + ct, st, 0),
488 LIBMESH_ASSERT_FP_EQUAL(1.0/st, aspect_ratio,
TOLERANCE);
504 auto test_rectangle_quad = [
this](
Real a)
506 std::vector<Point> pts = {
Point(0, 0, 0),
Point(a, 0, 0),
Point(a, 1, 0),
Point(0, 1, 0)};
512 LIBMESH_ASSERT_FP_EQUAL(a, aspect_ratio,
TOLERANCE);
516 test_rectangle_quad(2.0);
519 test_rectangle_quad(1e6);
533 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 0, 0),
Point(0, 1, 0)};
538 LIBMESH_ASSERT_FP_EQUAL(2.5, aspect_ratio,
TOLERANCE);
543 auto test_trapezoid_quad = [
this](
Real a)
546 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1-a, 1, 0),
Point(a, 1, 0)};
551 LIBMESH_ASSERT_FP_EQUAL(1./(1. - a), aspect_ratio,
TOLERANCE);
555 test_trapezoid_quad(1./3);
558 test_trapezoid_quad(0.5);
568 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(0, 1, 0)};
581 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(0.5, 0.5*std::sqrt(3), 0)};
595 std::vector<Point> pts = {
Point(0, 0, 0),
Point(L, 0, 0),
Point(0, 1, 0)};
616 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)};
622 LIBMESH_ASSERT_FP_EQUAL(1.0, warpage,
TOLERANCE);
631 for (
auto & pt : pts)
634 warpage = elem->quality(
WARP);
635 LIBMESH_ASSERT_FP_EQUAL(1.0, warpage,
TOLERANCE);
642 for (
auto & pt : pts)
645 warpage = elem->quality(
WARP);
646 LIBMESH_ASSERT_FP_EQUAL(1.0, warpage,
TOLERANCE);
653 for (
int cnt=0; cnt<3; ++cnt)
654 for (
auto & pt : pts)
657 warpage = elem->quality(
WARP);
658 LIBMESH_ASSERT_FP_EQUAL(1.0, warpage,
TOLERANCE);
663 auto test_warped_quad = [
this](
Real h)
665 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, h),
Point(0, 1, 0)};
673 LIBMESH_ASSERT_FP_EQUAL(
Real(1) / (h*h + 1), warpage,
TOLERANCE);
678 test_warped_quad(0.1);
683 test_warped_quad(0.3);
696 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)};
704 LIBMESH_ASSERT_FP_EQUAL(90, min_angle,
TOLERANCE);
705 LIBMESH_ASSERT_FP_EQUAL(90, max_angle,
TOLERANCE);
715 for (
auto & pt : pts)
721 LIBMESH_ASSERT_FP_EQUAL(90, min_angle,
TOLERANCE);
722 LIBMESH_ASSERT_FP_EQUAL(90, max_angle,
TOLERANCE);
730 for (
auto & pt : pts)
736 LIBMESH_ASSERT_FP_EQUAL(90, min_angle,
TOLERANCE);
737 LIBMESH_ASSERT_FP_EQUAL(90, max_angle,
TOLERANCE);
745 for (
int cnt=0; cnt<3; ++cnt)
746 for (
auto & pt : pts)
752 LIBMESH_ASSERT_FP_EQUAL(90, min_angle,
TOLERANCE);
753 LIBMESH_ASSERT_FP_EQUAL(90, max_angle,
TOLERANCE);
764 auto test_rhombus_quad = [
this](
Real theta)
766 Real ct = std::cos(theta);
767 Real st = std::sin(theta);
768 std::vector<Point> pts = {
771 Point(1. + ct, st, 0),
802 auto test_rhombus_quad = [
this](
Real theta)
804 Real ct = std::cos(theta);
805 Real st = std::sin(theta);
806 std::vector<Point> pts = {
809 Point(1. + ct, st, 0),
821 LIBMESH_ASSERT_FP_EQUAL(std::abs(std::sin(theta)), jac,
TOLERANCE);
822 LIBMESH_ASSERT_FP_EQUAL(std::abs(std::sin(theta)), scaled_jac,
TOLERANCE);
844 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0)};
856 auto test_rhombus_quad = [
this](
Real theta)
858 const Real ct = std::cos(theta);
859 const Real st = std::sin(theta);
860 std::vector<Point> pts = {
863 Point(1. + ct, st, 0),
873 for (
auto & pt : pts)
893 std::vector<Point> pts = {
Point(0, 0, 0),
Point(0, 0, 0),
Point(1, 1, 0),
Point(1, 1, 0)};
908 std::vector<Point> pts = {
909 Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0),
910 Point(0, 0, 1),
Point(1, 0, 1),
Point(1, 1, 1),
Point(0, 1, 1)};
922 auto test_sheared_hex = [
this](
Real k)
924 std::vector<Point> pts = {
925 Point(0, 0, 0),
Point(1, 0, 0),
Point(1, 1, 0),
Point(0, 1, 0),
926 Point(k, 0, 1),
Point(1+k, 0, 1),
Point(1+k, 1, 1),
Point(k, 1, 1)};
930 LIBMESH_ASSERT_FP_EQUAL(std::abs(k) / std::sqrt(k*k + 1),
935 test_sheared_hex(1.0);
937 test_sheared_hex(0.5);
951 auto size_of = [
this](
const std::vector<Point> & pts)
955 return elem->quality(
SIZE);
961 LIBMESH_ASSERT_FP_EQUAL(1.0,
962 size_of({
Point(0,0,0),
Point(1,0,0),
Point(1,1,0),
Point(0,1,0)}),
TOLERANCE);
963 LIBMESH_ASSERT_FP_EQUAL(1.0,
964 size_of({
Point(0,0,0),
Point(2,0,0),
Point(2,2,0),
Point(0,2,0)}),
TOLERANCE);
965 LIBMESH_ASSERT_FP_EQUAL(1.0,
966 size_of({
Point(0,0,0),
Point(2,0,0),
Point(2,1,0),
Point(0,1,0)}),
TOLERANCE);
969 LIBMESH_ASSERT_FP_EQUAL(1.0,
970 size_of({
Point(0,0,0),
Point(1,0,0),
Point(1.+c,s,0),
Point(c,s,0)}),
TOLERANCE);
975 LIBMESH_ASSERT_FP_EQUAL(0.8,
976 size_of({
Point(0,0,0),
Point(3,0,0),
Point(2,2,0),
Point(0,2,0)}),
TOLERANCE);
983 auto size_of = [
this](
const std::vector<Point> & pts)
987 return elem->quality(
SIZE);
991 LIBMESH_ASSERT_FP_EQUAL(1.0,
992 size_of({
Point(0,0,0),
Point(1,0,0),
Point(1,1,0),
Point(0,1,0),
993 Point(0,0,1),
Point(1,0,1),
Point(1,1,1),
Point(0,1,1)}),
TOLERANCE);
994 LIBMESH_ASSERT_FP_EQUAL(1.0,
995 size_of({
Point(0,0,0),
Point(2,0,0),
Point(2,1,0),
Point(0,1,0),
996 Point(0,0,1),
Point(2,0,1),
Point(2,1,1),
Point(0,1,1)}),
TOLERANCE);
1003 LIBMESH_ASSERT_FP_EQUAL(
Real(3)/7,
1004 size_of({
Point(0,0,0),
Point(2,0,0),
Point(2,2,0),
Point(0,2,0),
1005 Point(0.5,0.5,1),
Point(1.5,0.5,1),
Point(1.5,1.5,1),
Point(0.5,1.5,1)}),
TOLERANCE);
1014 auto taper_of = [
this](
const std::vector<Point> & pts)
1018 return elem->quality(
TAPER);
1022 LIBMESH_ASSERT_FP_EQUAL(1.0,
1023 taper_of({
Point(0,0,0),
Point(1,0,0),
Point(1,1,0),
Point(0,1,0)}),
TOLERANCE);
1026 LIBMESH_ASSERT_FP_EQUAL(1.0,
1027 taper_of({
Point(0,0,0),
Point(2,0,0),
Point(2,1,0),
Point(0,1,0)}),
TOLERANCE);
1032 LIBMESH_ASSERT_FP_EQUAL(1.0,
1033 taper_of({
Point(0,0,0),
Point(1,0,0),
Point(1.+c,s,0),
Point(c,s,0)}),
TOLERANCE);
1038 LIBMESH_ASSERT_FP_EQUAL(0.5,
1039 taper_of({
Point(0,0,0),
Point(4,0,0),
Point(3,1,0),
Point(1,1,0)}),
TOLERANCE);
1049 auto cond_of = [
this](
const std::vector<Point> & pts)
1057 LIBMESH_ASSERT_FP_EQUAL(1.0,
1058 cond_of({
Point(0,0,0),
Point(1,0,0),
Point(1,1,0),
Point(0,1,0)}),
TOLERANCE);
1061 LIBMESH_ASSERT_FP_EQUAL(1.25,
1062 cond_of({
Point(0,0,0),
Point(2,0,0),
Point(2,1,0),
Point(0,1,0)}),
TOLERANCE);
1066 auto rhombus_condition = [&cond_of](
Real theta)
1068 const Real c = std::cos(theta), s = std::sin(theta);
1069 return cond_of({
Point(0,0,0),
Point(1,0,0),
Point(1.+c,s,0),
Point(c,s,0)});
1073 LIBMESH_ASSERT_FP_EQUAL(1./std::sin(
libMesh::pi/6),
1076 LIBMESH_ASSERT_FP_EQUAL(1./std::sin(
libMesh::pi/3),
1085 auto cond_of = [
this](
const std::vector<Point> & pts)
1093 LIBMESH_ASSERT_FP_EQUAL(1.0,
1094 cond_of({
Point(0,0,0),
Point(1,0,0),
Point(1,1,0),
Point(0,1,0),
1095 Point(0,0,1),
Point(1,0,1),
Point(1,1,1),
Point(0,1,1)}),
TOLERANCE);
1099 LIBMESH_ASSERT_FP_EQUAL(std::sqrt(
Real(6))/2.,
1100 cond_of({
Point(0,0,0),
Point(2,0,0),
Point(2,1,0),
Point(0,1,0),
1101 Point(0,0,1),
Point(2,0,1),
Point(2,1,1),
Point(0,1,1)}),
TOLERANCE);
1113 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(0, 1, 0),
Point(1, 1, 0.01)};
1128 LIBMESH_ASSERT_FP_EQUAL(44.9985676771277, min_angle,
TOLERANCE);
1129 LIBMESH_ASSERT_FP_EQUAL(90, max_angle,
TOLERANCE);
1132 CPPUNIT_ASSERT_LESS(
Real(1), min_dihedral_angle);
1133 CPPUNIT_ASSERT_LESS(
Real(1), max_dihedral_angle);
1145 std::vector<Point> pts = {
Point(0, 0, 0),
Point(1, 0, 0),
Point(0, 1, 0),
Point(1, 1, h)};
1156 LIBMESH_ASSERT_FP_EQUAL(h, jac,
TOLERANCE);
1157 LIBMESH_ASSERT_FP_EQUAL(h/(h*h+1)/std::sqrt(h*h+2),
1168 std::vector<Point> pts = {
1169 Point(2.5, 2.5, 4.5),
1170 Point(3.5, 1.5, 5.5),
1171 Point(1.5, 1.5, 5.5),
1172 Point(2.5, 2.5, 5.5)
1184 LIBMESH_ASSERT_FP_EQUAL(2, jac,
TOLERANCE);
1192 Real expected_volume)
1196 const auto np = points.size();
1197 std::unique_ptr<Elem> polygon = std::make_unique<C0Polygon>(np);
1202 polygon->set_id() = 0;
1206 const Real base_volume = elem->Elem::volume();
1230 testC0Polygon({{0,0}, {1,0}, {1.5,0.5}, {1,1}, {0,1}}, 1.25);
1236 testC0Polygon({{0,0}, {1,0}, {1.5,0.5}, {1,1}, {0,1}, {-0.5, 0.5}}, 1.5);
1245 std::pair<std::unique_ptr<Elem>, std::vector<std::unique_ptr<Node>>>
1249 const unsigned int n_points = pts.size();
1252 std::vector<std::unique_ptr<Node>> nodes(n_points);
1253 for (
unsigned int i=0; i<n_points; i++)
1257 std::unique_ptr<Elem> elem =
Elem::build(elem_type,
nullptr);
1260 libmesh_error_msg_if(elem->n_nodes() != n_points,
1261 "Wrong number of points "
1263 <<
" provided to build a "
1266 for (
unsigned int i=0; i<n_points; i++)
1267 elem->set_node(i, nodes[i].get());
1270 return std::make_pair(std::move(elem), std::move(nodes));
1277 std::unique_ptr<libMesh::Node> mid_elem_node;
1278 std::unique_ptr<Elem> polyhedron = std::make_unique<C0Polyhedron>(sides, mid_elem_node);
1281 polyhedron->
set_id() = 0;
1291 unsigned int n_sides)
1294 bool found_elem = elem;
1296 CPPUNIT_ASSERT(found_elem);
1302 CPPUNIT_ASSERT_EQUAL(elem->
n_nodes(), n_sides);
1303 CPPUNIT_ASSERT_EQUAL(elem->
n_sub_elem(), n_sides);
1304 CPPUNIT_ASSERT_EQUAL(elem->
n_sides(), n_sides);
1305 CPPUNIT_ASSERT_EQUAL(elem->
n_vertices(), n_sides);
1306 CPPUNIT_ASSERT_EQUAL(elem->
n_edges(), n_sides);
1311 const unsigned int nsover2 = n_sides/2;
1322 CPPUNIT_ASSERT(!elem->
is_edge(i));
1323 CPPUNIT_ASSERT(!elem->
is_face(i));
1329 CPPUNIT_ASSERT_EQUAL(nodes.size(), std::size_t(2));
1330 CPPUNIT_ASSERT(nodes[0] == i ||
1332 CPPUNIT_ASSERT(nodes[0] == (i+1)%n_sides ||
1333 nodes[1] == (i+1)%n_sides);
1334 std::vector<unsigned int> edge_nodes = elem->
nodes_on_edge(i);
1335 CPPUNIT_ASSERT(nodes == edge_nodes);
1344 CPPUNIT_ASSERT_EQUAL(edge->type(),
EDGE2);
1345 CPPUNIT_ASSERT_EQUAL(edge->node_ptr(0),
mesh.
node_ptr(i));
1346 CPPUNIT_ASSERT_EQUAL(edge->node_ptr(1),
mesh.
node_ptr((i+1)%n_sides));
1360 bool found_elem = elem;
1362 CPPUNIT_ASSERT(found_elem);
1370 const int E = elem->
n_edges();
1371 const int F = elem->
n_faces();
1374 CPPUNIT_ASSERT_EQUAL(
int(elem->
n_nodes()), V);
1376 CPPUNIT_ASSERT_EQUAL(
int(elem->
n_nodes()), V + 1);
1377 CPPUNIT_ASSERT_EQUAL(
int(elem->
n_sides()), F);
1380 CPPUNIT_ASSERT_EQUAL(V-E+F, 2);
1385 std::vector<int> sides_on_vertex(V, 0);
1389 CPPUNIT_ASSERT_EQUAL(side->type(),
C0POLYGON);
1390 FE += side->n_edges();
1391 const int SV = side->n_vertices();
1395 CPPUNIT_ASSERT_EQUAL(nos.size(), std::size_t(SV));
1399 Node * sidenode = side->node_ptr(v);
1402 ++sides_on_vertex[n];
1405 CPPUNIT_ASSERT(side->is_vertex(v));
1406 CPPUNIT_ASSERT(!side->is_edge(v));
1408 CPPUNIT_ASSERT(!elem->
is_edge(n));
1409 CPPUNIT_ASSERT(!elem->
is_face(n));
1411 CPPUNIT_ASSERT(std::find(nos.begin(), nos.end(), n) != nos.end());
1416 CPPUNIT_ASSERT_EQUAL(E*2,
FE);
1419 CPPUNIT_ASSERT_LESSEQUAL(FV, V*3);
1420 for (
auto sov : sides_on_vertex)
1421 CPPUNIT_ASSERT_LESSEQUAL(sov, 3);
1429 Real expected_volume)
1432 const Real base_volume = elem->Elem::volume();
1453 const std::vector<std::vector<unsigned int>> nodes_on_side =
1462 std::vector<std::shared_ptr<Polygon>> sides(nodes_on_side.size());
1466 const auto & nodes_on_s = nodes_on_side[s];
1467 sides[s] = std::make_shared<C0Polygon>(nodes_on_s.size());
1474 #ifdef LIBMESH_ENABLE_EXCEPTIONS
1479 const auto subtet0_sides_to_poly_sides = poly->subelement_sides_to_poly_sides(0);
1481 CPPUNIT_ASSERT_EQUAL(1, subtet0_sides_to_poly_sides[1]);
1482 CPPUNIT_ASSERT_EQUAL(0, subtet0_sides_to_poly_sides[2]);
1483 CPPUNIT_ASSERT_EQUAL(2, subtet0_sides_to_poly_sides[3]);
1510 const std::vector<std::vector<unsigned int>> nodes_on_side =
1511 { {0, 1, 2, 3, 4, 5},
1518 {6, 7, 8, 9, 10, 11} };
1521 std::vector<std::shared_ptr<Polygon>> sides(nodes_on_side.size());
1525 const auto & nodes_on_s = nodes_on_side[s];
1526 sides[s] = std::make_shared<C0Polygon>(nodes_on_s.size());
1532 CPPUNIT_ASSERT_EQUAL((
unsigned int)13, poly->n_nodes());
1537 const auto subtet0_sides_to_poly_sides = poly->subelement_sides_to_poly_sides(0);
1538 CPPUNIT_ASSERT_EQUAL(0, subtet0_sides_to_poly_sides[0]);
1557 return elem->has_invertible_map();
1581 for (
const auto & elem :
mesh.element_ptr_range())
1583 Point derived_centroid = elem->true_centroid();
1584 Point base_centroid = elem->Elem::true_centroid();
1596 Real derived_volume = elem->volume();
1597 Real base_volume = elem->Elem::volume();
void max(const T &r, T &o, Request &req) const
void testHex20PLevelTrueCentroid()
void test_true_centroid_and_volume(ElemType elem_type)
void testC0Polygon(const std::vector< Point > &points, Real expected_volume)
void testHex8TrueCentroid()
void testQuad4AspectRatio()
CPPUNIT_TEST(testQuad4Invertible)
CPPUNIT_TEST(testTri3AspectRatio)
CPPUNIT_TEST(testC0PolyhedronCube)
std::pair< std::unique_ptr< Elem >, std::vector< std::unique_ptr< Node > > > construct_elem(const std::vector< Point > &pts, ElemType elem_type)
CPPUNIT_TEST(testQuad4MinMaxAngle)
CPPUNIT_TEST(testEdge4Invertible)
void testC0PolyhedronCube()
CPPUNIT_TEST(testQuad4TrueCentroid)
void testElemVolume(const Elem *elem, Real expected_volume)
CPPUNIT_TEST(testPyramid5TrueCentroid)
CPPUNIT_TEST(testHex8Size)
CPPUNIT_TEST(testQuad4SkewAngle)
void testC0PolyhedronHexagonalPrism()
void testQuad4Invertible()
LIBMESH_CPPUNIT_TEST_SUITE(VolumeTest)
CPPUNIT_TEST(testQuad4Warpage)
void testTet4DihedralAngle()
CPPUNIT_TEST(testTri3TrueCentroid)
void testC0PolygonPentagon()
CPPUNIT_TEST(testHex20PLevelTrueCentroid)
Elem * buildC0Polyhedron(std::vector< std::shared_ptr< Polygon > > sides, MeshBase &mesh)
CPPUNIT_TEST(testTwistedVolume)
void testEdge3Invertible()
CPPUNIT_TEST(testTet4Jacobian)
void testTri3AspectRatio()
void testC0PolygonHexagon()
void testTri3TrueCentroid()
void testC0PolyhedronMethods(MeshBase &mesh, bool has_midnode)
CPPUNIT_TEST(testQuad4Condition)
void testEdge4Invertible()
CPPUNIT_TEST(testPrism6TrueCentroid)
CPPUNIT_TEST(testQuad4Size)
CPPUNIT_TEST(testQuad4AspectRatio)
CPPUNIT_TEST(testEdge3Invertible)
CPPUNIT_TEST(testHex8SkewAngle)
void testPyramid5TrueCentroid()
void testPrism6TrueCentroid()
void testQuad4MinMaxAngle()
void testC0PolygonSquare()
CPPUNIT_TEST(testHex8Condition)
CPPUNIT_TEST(testQuad4Taper)
void testQuad4SkewAngle()
CPPUNIT_TEST(testHex8TrueCentroid)
CPPUNIT_TEST(testEdge3Volume)
CPPUNIT_TEST(testC0PolygonPentagon)
void testQuad4Condition()
CPPUNIT_TEST(testC0PolyhedronHexagonalPrism)
bool test_elem_invertible(const std::vector< Point > &pts, ElemType elem_type)
CPPUNIT_TEST(testC0PolygonQuad)
CPPUNIT_TEST(testTet4DihedralAngle)
CPPUNIT_TEST(testQuad4Jacobian)
void testC0PolygonMethods(MeshBase &mesh, unsigned int n_sides)
CPPUNIT_TEST(testC0PolygonHexagon)
void testQuad4TrueCentroid()
CPPUNIT_TEST(testC0PolygonSquare)
The C0Polyhedron is an element in 3D with an arbitrary (but fixed) number of polygonal first-order (C...
This is the base class from which all geometric element types are derived.
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
virtual unsigned int n_vertices() const =0
const Point & point(const unsigned int i) const
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const =0
virtual Point true_centroid() const
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0
virtual unsigned int n_nodes() const =0
virtual bool is_flipped() const =0
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const =0
virtual bool is_face(const unsigned int i) const =0
virtual bool has_invertible_map(Real tol=TOLERANCE *TOLERANCE) const
virtual std::vector< unsigned int > nodes_on_edge(const unsigned int) const =0
virtual void flip(BoundaryInfo *boundary_info)=0
Flips the element (by swapping node and neighbor pointers) to have a mapping Jacobian of opposite sig...
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 ...
virtual unsigned int n_sub_elem() const =0
virtual bool is_edge(const unsigned int i) const =0
virtual unsigned int n_faces() const =0
virtual unsigned int opposite_side(const unsigned int s) const
virtual Real volume() const
virtual bool is_vertex(const unsigned int i) const =0
unsigned int get_node_index(const Node *node_ptr) const
virtual ElemType type() const =0
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const =0
virtual unsigned int n_edges() const =0
virtual unsigned int n_sides() const =0
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
A specific instantiation of the FEBase class.
This is the MeshBase class.
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
virtual const Node * node_ptr(const dof_id_type i) const =0
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.
virtual dof_id_type n_nodes() 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.
virtual const Elem * elem_ptr(const dof_id_type i) const =0
virtual Node * add_node(Node *n)=0
Add Node n to the end of the vertex array.
virtual const Elem * query_elem_ptr(const dof_id_type i) const =0
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
A Node is like a Point, but with more information.
static std::unique_ptr< Node > build(const Node &n)
const Parallel::Communicator & comm() const
A Point defines a location in LIBMESH_DIM dimensional Real space.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
This class defines a tensor in LIBMESH_DIM dimensional Real or Complex space.
bool absolute_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
Communicator * TestCommWorld
const Elem & get(const ElemType type_in)
std::string enum_to_string(const T e)
The libMesh namespace provides an interface to certain functionality in the library.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
ElemType
Defines an enum for geometric element types.
void libmesh_ignore(const Args &...)
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
const int invalid_int
A number which is used quite often to represent an invalid or uninitialized value for an integer.
static constexpr Real TOLERANCE
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...
CPPUNIT_TEST_SUITE_REGISTRATION(VolumeTest)