MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Public Member Functions | |
void | test_unit_tri () |
void | test_unit_quad () |
void | test_unit_tet () |
void | test_unit_pyr () |
void | test_unit_wdg () |
void | test_unit_hex () |
void | test_unit_edge_tri () |
void | test_unit_edge_quad () |
void | test_unit_edge_tet () |
void | test_unit_edge_pyr () |
void | test_unit_edge_wdg () |
void | test_unit_edge_hex () |
void | test_side_height_pyr () |
void | test_unit_height_pyr () |
Private Member Functions | |
CPPUNIT_TEST_SUITE (IdealElementTest) | |
CPPUNIT_TEST (test_unit_tri) | |
CPPUNIT_TEST (test_unit_quad) | |
CPPUNIT_TEST (test_unit_tet) | |
CPPUNIT_TEST (test_unit_pyr) | |
CPPUNIT_TEST (test_unit_wdg) | |
CPPUNIT_TEST (test_unit_hex) | |
CPPUNIT_TEST (test_side_height_pyr) | |
CPPUNIT_TEST (test_unit_edge_tri) | |
CPPUNIT_TEST (test_unit_edge_quad) | |
CPPUNIT_TEST (test_unit_edge_tet) | |
CPPUNIT_TEST (test_unit_edge_pyr) | |
CPPUNIT_TEST (test_unit_edge_wdg) | |
CPPUNIT_TEST (test_unit_edge_hex) | |
CPPUNIT_TEST (test_unit_height_pyr) | |
CPPUNIT_TEST_SUITE_END () |
Definition at line 41 of file IdealElementTest.cpp.
IdealElementTest::CPPUNIT_TEST | ( | test_unit_tri | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_quad | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_tet | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_pyr | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_wdg | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_hex | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_side_height_pyr | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_edge_tri | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_edge_quad | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_edge_tet | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_edge_pyr | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_edge_wdg | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_edge_hex | ) | [private] |
IdealElementTest::CPPUNIT_TEST | ( | test_unit_height_pyr | ) | [private] |
IdealElementTest::CPPUNIT_TEST_SUITE | ( | IdealElementTest | ) | [private] |
IdealElementTest::CPPUNIT_TEST_SUITE_END | ( | ) | [private] |
Definition at line 180 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), equal_edge_lengths(), MBMesquite::length(), n, MBMesquite::Vector3D::normalize(), MBMesquite::PYRAMID, MBMesquite::QUADRILATERAL, and MBMesquite::unit_element().
{ const Vector3D* coords = unit_element( PYRAMID, true ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 5, coords ), 1e-6 ); CPPUNIT_ASSERT( equal_edge_lengths( QUADRILATERAL, coords ) ); Vector3D p1 = 0.5 * ( coords[0] + coords[1] ); Vector3D p2 = 0.5 * ( coords[1] + coords[2] ); Vector3D p3 = 0.5 * ( coords[2] + coords[3] ); Vector3D p4 = 0.5 * ( coords[3] + coords[0] ); Vector3D v1 = p1 - p3; Vector3D v2 = p2 - p4; double area = ( v1 * v2 ).length(); Vector3D n = ( v1 * v2 ); n.normalize(); Vector3D c = 0.25 * ( coords[0] + coords[1] + coords[2] + coords[3] ); double height = n % ( coords[4] - c ); double vol = area * height / 3.0; CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, vol, 1e-6 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( height, ( coords[0] - coords[1] ).length(), 1e-6 ); }
void IdealElementTest::test_unit_edge_hex | ( | ) |
Definition at line 238 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), MBMesquite::HEXAHEDRON, MBMesquite::unit_edge_element(), and unit_edge_lengths().
{ const Vector3D* coords = unit_edge_element( HEXAHEDRON ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 8, coords ), 1e-6 ); CPPUNIT_ASSERT( unit_edge_lengths( HEXAHEDRON, coords ) ); }
void IdealElementTest::test_unit_edge_pyr | ( | ) |
Definition at line 224 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), MBMesquite::PYRAMID, MBMesquite::unit_edge_element(), and unit_edge_lengths().
{ const Vector3D* coords = unit_edge_element( PYRAMID ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 5, coords ), 1e-6 ); CPPUNIT_ASSERT( unit_edge_lengths( PYRAMID, coords ) ); }
Definition at line 210 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), MBMesquite::QUADRILATERAL, MBMesquite::unit_edge_element(), and unit_edge_lengths().
{ const Vector3D* coords = unit_edge_element( QUADRILATERAL ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 4, coords ), 1e-6 ); CPPUNIT_ASSERT( unit_edge_lengths( QUADRILATERAL, coords ) ); }
void IdealElementTest::test_unit_edge_tet | ( | ) |
Definition at line 217 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), MBMesquite::TETRAHEDRON, MBMesquite::unit_edge_element(), and unit_edge_lengths().
{ const Vector3D* coords = unit_edge_element( TETRAHEDRON ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 4, coords ), 1e-6 ); CPPUNIT_ASSERT( unit_edge_lengths( TETRAHEDRON, coords ) ); }
void IdealElementTest::test_unit_edge_tri | ( | ) |
Definition at line 203 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), MBMesquite::TRIANGLE, MBMesquite::unit_edge_element(), and unit_edge_lengths().
{ const Vector3D* coords = unit_edge_element( TRIANGLE ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 3, coords ), 1e-6 ); CPPUNIT_ASSERT( unit_edge_lengths( TRIANGLE, coords ) ); }
void IdealElementTest::test_unit_edge_wdg | ( | ) |
Definition at line 231 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), MBMesquite::PRISM, MBMesquite::unit_edge_element(), and unit_edge_lengths().
{ const Vector3D* coords = unit_edge_element( PRISM ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 6, coords ), 1e-6 ); CPPUNIT_ASSERT( unit_edge_lengths( PRISM, coords ) ); }
Definition at line 245 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), MBMesquite::length(), n, MBMesquite::Vector3D::normalize(), MBMesquite::PYRAMID, MBMesquite::QUADRILATERAL, MBMesquite::unit_edge_element(), and unit_edge_lengths().
{ const Vector3D* coords = unit_edge_element( PYRAMID, true ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 5, coords ), 1e-6 ); CPPUNIT_ASSERT( unit_edge_lengths( QUADRILATERAL, coords ) ); Vector3D p1 = 0.5 * ( coords[0] + coords[1] ); Vector3D p2 = 0.5 * ( coords[1] + coords[2] ); Vector3D p3 = 0.5 * ( coords[2] + coords[3] ); Vector3D p4 = 0.5 * ( coords[3] + coords[0] ); Vector3D v1 = p1 - p3; Vector3D v2 = p2 - p4; Vector3D n = ( v1 * v2 ); n.normalize(); Vector3D c = 0.25 * ( coords[0] + coords[1] + coords[2] + coords[3] ); double height = n % ( coords[4] - c ); CPPUNIT_ASSERT_DOUBLES_EQUAL( height, ( coords[0] - coords[1] ).length(), 1e-6 ); }
void IdealElementTest::test_unit_hex | ( | ) |
Definition at line 161 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), equal_edge_lengths(), MBMesquite::HEXAHEDRON, and MBMesquite::unit_element().
{ const Vector3D* coords = unit_element( HEXAHEDRON ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 8, coords ), 1e-6 ); CPPUNIT_ASSERT( equal_edge_lengths( HEXAHEDRON, coords ) ); Vector3D p1 = 0.25 * ( coords[0] + coords[1] + coords[2] + coords[3] ); Vector3D p2 = 0.25 * ( coords[4] + coords[5] + coords[6] + coords[7] ); Vector3D p3 = 0.25 * ( coords[0] + coords[1] + coords[5] + coords[4] ); Vector3D p4 = 0.25 * ( coords[7] + coords[6] + coords[6] + coords[7] ); Vector3D p5 = 0.25 * ( coords[0] + coords[3] + coords[4] + coords[7] ); Vector3D p6 = 0.25 * ( coords[1] + coords[2] + coords[6] + coords[5] ); Vector3D v1 = p1 - p2; Vector3D v2 = p3 - p4; Vector3D v3 = p5 - p6; double vol = v3 % ( v1 * v2 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, vol, 1e-6 ); }
void IdealElementTest::test_unit_pyr | ( | ) |
Definition at line 126 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), equal_edge_lengths(), MBMesquite::length(), n, MBMesquite::Vector3D::normalize(), MBMesquite::PYRAMID, and MBMesquite::unit_element().
{ const Vector3D* coords = unit_element( PYRAMID ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 5, coords ), 1e-6 ); CPPUNIT_ASSERT( equal_edge_lengths( PYRAMID, coords ) ); Vector3D p1 = 0.5 * ( coords[0] + coords[1] ); Vector3D p2 = 0.5 * ( coords[1] + coords[2] ); Vector3D p3 = 0.5 * ( coords[2] + coords[3] ); Vector3D p4 = 0.5 * ( coords[3] + coords[0] ); Vector3D v1 = p1 - p3; Vector3D v2 = p2 - p4; double area = ( v1 * v2 ).length(); Vector3D n = ( v1 * v2 ); n.normalize(); Vector3D c = 0.25 * ( coords[0] + coords[1] + coords[2] + coords[3] ); double height = n % ( coords[4] - c ); double vol = area * height / 3.0; CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, vol, 1e-6 ); }
void IdealElementTest::test_unit_quad | ( | ) |
Definition at line 97 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), equal_edge_lengths(), MBMesquite::length(), MBMesquite::QUADRILATERAL, and MBMesquite::unit_element().
{ const Vector3D* coords = unit_element( QUADRILATERAL ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 4, coords ), 1e-6 ); CPPUNIT_ASSERT( equal_edge_lengths( QUADRILATERAL, coords ) ); Vector3D p1 = 0.5 * ( coords[0] + coords[1] ); Vector3D p2 = 0.5 * ( coords[1] + coords[2] ); Vector3D p3 = 0.5 * ( coords[2] + coords[3] ); Vector3D p4 = 0.5 * ( coords[3] + coords[0] ); Vector3D v1 = p1 - p3; Vector3D v2 = p2 - p4; double area = ( v1 * v2 ).length(); CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, area, 1e-6 ); }
void IdealElementTest::test_unit_tet | ( | ) |
Definition at line 113 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), equal_edge_lengths(), MBMesquite::TETRAHEDRON, and MBMesquite::unit_element().
{ const Vector3D* coords = unit_element( TETRAHEDRON ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 4, coords ), 1e-6 ); CPPUNIT_ASSERT( equal_edge_lengths( TETRAHEDRON, coords ) ); Vector3D v1 = coords[1] - coords[0]; Vector3D v2 = coords[2] - coords[0]; Vector3D v3 = coords[3] - coords[0]; double vol = ( v3 % ( v1 * v2 ) ) / 6.0; CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, vol, 1e-6 ); }
void IdealElementTest::test_unit_tri | ( | ) |
Definition at line 85 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), equal_edge_lengths(), MBMesquite::length(), MBMesquite::TRIANGLE, and MBMesquite::unit_element().
{ const Vector3D* coords = unit_element( TRIANGLE ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 3, coords ), 1e-6 ); CPPUNIT_ASSERT( equal_edge_lengths( TRIANGLE, coords ) ); Vector3D v1 = coords[1] - coords[0]; Vector3D v2 = coords[2] - coords[0]; double area = 0.5 * ( v1 * v2 ).length(); CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, area, 1e-6 ); }
void IdealElementTest::test_unit_wdg | ( | ) |
Definition at line 148 of file IdealElementTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, distance_from_origin(), equal_edge_lengths(), MBMesquite::PRISM, and MBMesquite::unit_element().
{ const Vector3D* coords = unit_element( PRISM ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, distance_from_origin( 6, coords ), 1e-6 ); CPPUNIT_ASSERT( equal_edge_lengths( PRISM, coords ) ); Vector3D v1 = coords[1] - coords[0]; Vector3D v2 = coords[2] - coords[0]; Vector3D v3 = coords[3] - coords[0]; double vol = 0.5 * v3 % ( v1 * v2 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, vol, 1e-6 ); }