MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Public Member Functions | |
void | test_coeff_corners () |
void | test_coeff_edges () |
void | test_coeff_center () |
void | test_deriv_corners () |
void | test_deriv_edges () |
void | test_deriv_center () |
void | test_ideal_jacobian () |
Private Member Functions | |
CPPUNIT_TEST_SUITE (TriLagrangeShapeTest) | |
CPPUNIT_TEST (test_coeff_corners) | |
CPPUNIT_TEST (test_coeff_edges) | |
CPPUNIT_TEST (test_coeff_center) | |
CPPUNIT_TEST (test_deriv_corners) | |
CPPUNIT_TEST (test_deriv_edges) | |
CPPUNIT_TEST (test_deriv_center) | |
CPPUNIT_TEST (test_ideal_jacobian) | |
CPPUNIT_TEST_SUITE_END () | |
void | test_corner_coeff (int corner, NodeSet nodeset) |
void | test_edge_coeff (int edge, NodeSet nodeset) |
void | test_mid_coeff (NodeSet nodeset) |
void | test_corner_derivs (int corner, NodeSet nodeset) |
void | test_edge_derivs (int edge, NodeSet nodeset) |
void | test_mid_derivs (NodeSet nodeset) |
Private Attributes | |
TriLagrangeShape | sf |
Definition at line 82 of file TriLagrangeShapeTest.cpp.
TriLagrangeShapeTest::CPPUNIT_TEST | ( | test_coeff_corners | ) | [private] |
TriLagrangeShapeTest::CPPUNIT_TEST | ( | test_coeff_edges | ) | [private] |
TriLagrangeShapeTest::CPPUNIT_TEST | ( | test_coeff_center | ) | [private] |
TriLagrangeShapeTest::CPPUNIT_TEST | ( | test_deriv_corners | ) | [private] |
TriLagrangeShapeTest::CPPUNIT_TEST | ( | test_deriv_edges | ) | [private] |
TriLagrangeShapeTest::CPPUNIT_TEST | ( | test_deriv_center | ) | [private] |
TriLagrangeShapeTest::CPPUNIT_TEST | ( | test_ideal_jacobian | ) | [private] |
TriLagrangeShapeTest::CPPUNIT_TEST_SUITE | ( | TriLagrangeShapeTest | ) | [private] |
TriLagrangeShapeTest::CPPUNIT_TEST_SUITE_END | ( | ) | [private] |
Definition at line 511 of file TriLagrangeShapeTest.cpp.
References MBMesquite::NodeSet::clear(), MBMesquite::NodeSet::clear_mid_edge_node(), and MBMesquite::NodeSet::set_mid_edge_node().
{ NodeSet ns; ns.clear(); test_mid_coeff( ns ); ns.set_mid_edge_node( 0 ); test_mid_coeff( ns ); ns.clear(); ns.set_mid_edge_node( 1 ); test_mid_coeff( ns ); ns.set_mid_edge_node( 0 ); test_mid_coeff( ns ); ns.clear(); ns.set_mid_edge_node( 2 ); test_mid_coeff( ns ); ns.set_mid_edge_node( 0 ); test_mid_coeff( ns ); ns.set_mid_edge_node( 1 ); test_mid_coeff( ns ); ns.clear_mid_edge_node( 0 ); test_mid_coeff( ns ); }
Definition at line 417 of file TriLagrangeShapeTest.cpp.
References MBMesquite::NodeSet::clear(), MBMesquite::NodeSet::clear_mid_edge_node(), and MBMesquite::NodeSet::set_mid_edge_node().
{ NodeSet ns; ns.clear(); test_corner_coeff( 0, ns ); test_corner_coeff( 1, ns ); test_corner_coeff( 2, ns ); ns.set_mid_edge_node( 0 ); test_corner_coeff( 0, ns ); test_corner_coeff( 1, ns ); test_corner_coeff( 2, ns ); ns.clear(); ns.set_mid_edge_node( 1 ); test_corner_coeff( 0, ns ); test_corner_coeff( 1, ns ); test_corner_coeff( 2, ns ); ns.set_mid_edge_node( 0 ); test_corner_coeff( 0, ns ); test_corner_coeff( 1, ns ); test_corner_coeff( 2, ns ); ns.clear(); ns.set_mid_edge_node( 2 ); test_corner_coeff( 0, ns ); test_corner_coeff( 1, ns ); test_corner_coeff( 2, ns ); ns.set_mid_edge_node( 0 ); test_corner_coeff( 0, ns ); test_corner_coeff( 1, ns ); test_corner_coeff( 2, ns ); ns.set_mid_edge_node( 1 ); test_corner_coeff( 0, ns ); test_corner_coeff( 1, ns ); test_corner_coeff( 2, ns ); ns.clear_mid_edge_node( 0 ); test_corner_coeff( 0, ns ); test_corner_coeff( 1, ns ); test_corner_coeff( 2, ns ); }
Definition at line 464 of file TriLagrangeShapeTest.cpp.
References MBMesquite::NodeSet::clear(), MBMesquite::NodeSet::clear_mid_edge_node(), and MBMesquite::NodeSet::set_mid_edge_node().
{ NodeSet ns; ns.clear(); test_edge_coeff( 0, ns ); test_edge_coeff( 1, ns ); test_edge_coeff( 2, ns ); ns.set_mid_edge_node( 0 ); test_edge_coeff( 0, ns ); test_edge_coeff( 1, ns ); test_edge_coeff( 2, ns ); ns.clear(); ns.set_mid_edge_node( 1 ); test_edge_coeff( 0, ns ); test_edge_coeff( 1, ns ); test_edge_coeff( 2, ns ); ns.set_mid_edge_node( 0 ); test_edge_coeff( 0, ns ); test_edge_coeff( 1, ns ); test_edge_coeff( 2, ns ); ns.clear(); ns.set_mid_edge_node( 2 ); test_edge_coeff( 0, ns ); test_edge_coeff( 1, ns ); test_edge_coeff( 2, ns ); ns.set_mid_edge_node( 0 ); test_edge_coeff( 0, ns ); test_edge_coeff( 1, ns ); test_edge_coeff( 2, ns ); ns.set_mid_edge_node( 1 ); test_edge_coeff( 0, ns ); test_edge_coeff( 1, ns ); test_edge_coeff( 2, ns ); ns.clear_mid_edge_node( 0 ); test_edge_coeff( 0, ns ); test_edge_coeff( 1, ns ); test_edge_coeff( 2, ns ); }
void TriLagrangeShapeTest::test_corner_coeff | ( | int | corner, |
NodeSet | nodeset | ||
) | [private] |
Definition at line 327 of file TriLagrangeShapeTest.cpp.
References compare_coefficients(), CPPUNIT_ASSERT, get_coeff(), and rs_corner.
{ MsqPrintError err( std::cout ); double expected[6]; get_coeff( nodebits, rs_corner[corner], expected ); double coeff[27]; size_t num_coeff = 17, indices[27]; sf.coefficients( Sample( 0, corner ), nodebits, coeff, indices, num_coeff, err ); CPPUNIT_ASSERT( !err ); compare_coefficients( coeff, indices, expected, num_coeff, corner, nodebits ); }
void TriLagrangeShapeTest::test_corner_derivs | ( | int | corner, |
NodeSet | nodeset | ||
) | [private] |
Definition at line 372 of file TriLagrangeShapeTest.cpp.
References compare_derivatives(), CPPUNIT_ASSERT, get_derivs(), n, and rs_corner.
{ MsqPrintError err( std::cout ); double expected[12]; get_derivs( nodebits, rs_corner[corner], expected ); size_t n = 19, vertices[100]; MsqVector< 2 > derivs[100]; sf.derivatives( Sample( 0, corner ), nodebits, vertices, derivs, n, err ); CPPUNIT_ASSERT( !err ); compare_derivatives( vertices, n, derivs, expected, corner, nodebits ); }
Definition at line 629 of file TriLagrangeShapeTest.cpp.
References MBMesquite::NodeSet::clear(), MBMesquite::NodeSet::clear_mid_edge_node(), and MBMesquite::NodeSet::set_mid_edge_node().
{ NodeSet ns; ns.clear(); test_mid_derivs( ns ); ns.set_mid_edge_node( 0 ); test_mid_derivs( ns ); ns.clear(); ns.set_mid_edge_node( 1 ); test_mid_derivs( ns ); ns.set_mid_edge_node( 0 ); test_mid_derivs( ns ); ns.clear(); ns.set_mid_edge_node( 2 ); test_mid_derivs( ns ); ns.set_mid_edge_node( 0 ); test_mid_derivs( ns ); ns.set_mid_edge_node( 1 ); test_mid_derivs( ns ); ns.clear_mid_edge_node( 0 ); test_mid_derivs( ns ); }
Definition at line 535 of file TriLagrangeShapeTest.cpp.
References MBMesquite::NodeSet::clear(), MBMesquite::NodeSet::clear_mid_edge_node(), and MBMesquite::NodeSet::set_mid_edge_node().
{ NodeSet ns; ns.clear(); test_corner_derivs( 0, ns ); test_corner_derivs( 1, ns ); test_corner_derivs( 2, ns ); ns.set_mid_edge_node( 0 ); test_corner_derivs( 0, ns ); test_corner_derivs( 1, ns ); test_corner_derivs( 2, ns ); ns.clear(); ns.set_mid_edge_node( 1 ); test_corner_derivs( 0, ns ); test_corner_derivs( 1, ns ); test_corner_derivs( 2, ns ); ns.set_mid_edge_node( 0 ); test_corner_derivs( 0, ns ); test_corner_derivs( 1, ns ); test_corner_derivs( 2, ns ); ns.clear(); ns.set_mid_edge_node( 2 ); test_corner_derivs( 0, ns ); test_corner_derivs( 1, ns ); test_corner_derivs( 2, ns ); ns.set_mid_edge_node( 0 ); test_corner_derivs( 0, ns ); test_corner_derivs( 1, ns ); test_corner_derivs( 2, ns ); ns.set_mid_edge_node( 1 ); test_corner_derivs( 0, ns ); test_corner_derivs( 1, ns ); test_corner_derivs( 2, ns ); ns.clear_mid_edge_node( 0 ); test_corner_derivs( 0, ns ); test_corner_derivs( 1, ns ); test_corner_derivs( 2, ns ); }
Definition at line 582 of file TriLagrangeShapeTest.cpp.
References MBMesquite::NodeSet::clear(), MBMesquite::NodeSet::clear_mid_edge_node(), and MBMesquite::NodeSet::set_mid_edge_node().
{ NodeSet ns; ns.clear(); test_edge_derivs( 0, ns ); test_edge_derivs( 1, ns ); test_edge_derivs( 2, ns ); ns.set_mid_edge_node( 0 ); test_edge_derivs( 0, ns ); test_edge_derivs( 1, ns ); test_edge_derivs( 2, ns ); ns.clear(); ns.set_mid_edge_node( 1 ); test_edge_derivs( 0, ns ); test_edge_derivs( 1, ns ); test_edge_derivs( 2, ns ); ns.set_mid_edge_node( 0 ); test_edge_derivs( 0, ns ); test_edge_derivs( 1, ns ); test_edge_derivs( 2, ns ); ns.clear(); ns.set_mid_edge_node( 2 ); test_edge_derivs( 0, ns ); test_edge_derivs( 1, ns ); test_edge_derivs( 2, ns ); ns.set_mid_edge_node( 0 ); test_edge_derivs( 0, ns ); test_edge_derivs( 1, ns ); test_edge_derivs( 2, ns ); ns.set_mid_edge_node( 1 ); test_edge_derivs( 0, ns ); test_edge_derivs( 1, ns ); test_edge_derivs( 2, ns ); ns.clear_mid_edge_node( 0 ); test_edge_derivs( 0, ns ); test_edge_derivs( 1, ns ); test_edge_derivs( 2, ns ); }
void TriLagrangeShapeTest::test_edge_coeff | ( | int | edge, |
NodeSet | nodeset | ||
) | [private] |
Definition at line 342 of file TriLagrangeShapeTest.cpp.
References compare_coefficients(), CPPUNIT_ASSERT, get_coeff(), and rs_edge.
{ MsqPrintError err( std::cout ); double expected[6]; get_coeff( nodebits, rs_edge[edge], expected ); double coeff[27]; size_t num_coeff = 17, indices[27]; sf.coefficients( Sample( 1, edge ), nodebits, coeff, indices, num_coeff, err ); CPPUNIT_ASSERT( !err ); compare_coefficients( coeff, indices, expected, num_coeff, edge + 3, nodebits ); }
void TriLagrangeShapeTest::test_edge_derivs | ( | int | edge, |
NodeSet | nodeset | ||
) | [private] |
Definition at line 387 of file TriLagrangeShapeTest.cpp.
References compare_derivatives(), CPPUNIT_ASSERT, get_derivs(), n, and rs_edge.
{ MsqPrintError err( std::cout ); double expected[12]; get_derivs( nodebits, rs_edge[edge], expected ); size_t n = 19, vertices[100]; MsqVector< 2 > derivs[100]; sf.derivatives( Sample( 1, edge ), nodebits, vertices, derivs, n, err ); CPPUNIT_ASSERT( !err ); compare_derivatives( vertices, n, derivs, expected, edge + 3, nodebits ); }
Definition at line 653 of file TriLagrangeShapeTest.cpp.
References ASSERT_MATRICES_EQUAL, ASSERT_NO_ERROR, CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, MBMesquite::MsqMatrix< R, C >::data(), MBMesquite::det(), MBMesquite::JacobianCalculator::get_Jacobian_2D(), MBMesquite::inverse(), moab::R, MBMesquite::transpose(), MBMesquite::TRIANGLE, and MBMesquite::unit_edge_element().
{ MsqError err; MsqMatrix< 3, 2 > J_prime; sf.ideal( Sample( 2, 0 ), J_prime, err ); ASSERT_NO_ERROR( err ); // for this test that everything is in the xy-plane CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, J_prime( 2, 0 ), 1e-12 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, J_prime( 2, 1 ), 1e-12 ); MsqMatrix< 2, 2 > J_act( J_prime.data() ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, det( J_act ), 1e-6 ); const Vector3D* verts = unit_edge_element( TRIANGLE ); CPPUNIT_ASSERT( verts ); JacobianCalculator jc; jc.get_Jacobian_2D( &sf, NodeSet(), Sample( 2, 0 ), verts, 3, J_prime, err ); ASSERT_NO_ERROR( err ); // for this test that everything is in the xy-plane CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, J_prime( 2, 0 ), 1e-12 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, J_prime( 2, 1 ), 1e-12 ); MsqMatrix< 2, 2 > J_exp( J_prime.data() ); J_exp /= sqrt( det( J_exp ) ); // Matrices should be a rotation of each other. // First, calculate tentative rotation matrix MsqMatrix< 2, 2 > R = inverse( J_exp ) * J_act; // next check that it is a rotation CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, det( R ), 1e-6 ); // no scaling ASSERT_MATRICES_EQUAL( transpose( R ), inverse( R ), 1e-6 ); // orthogonal }
void TriLagrangeShapeTest::test_mid_coeff | ( | NodeSet | nodeset | ) | [private] |
Definition at line 357 of file TriLagrangeShapeTest.cpp.
References compare_coefficients(), CPPUNIT_ASSERT, get_coeff(), and rs_mid.
{ MsqPrintError err( std::cout ); double expected[6]; get_coeff( nodebits, rs_mid, expected ); double coeff[27]; size_t num_coeff = 17, indices[27]; sf.coefficients( Sample( 2, 0 ), nodebits, coeff, indices, num_coeff, err ); CPPUNIT_ASSERT( !err ); compare_coefficients( coeff, indices, expected, num_coeff, 6, nodebits ); }
void TriLagrangeShapeTest::test_mid_derivs | ( | NodeSet | nodeset | ) | [private] |
Definition at line 402 of file TriLagrangeShapeTest.cpp.
References compare_derivatives(), CPPUNIT_ASSERT, get_derivs(), n, and rs_mid.
{ MsqPrintError err( std::cout ); double expected[12]; get_derivs( nodebits, rs_mid, expected ); size_t n = 19, vertices[100]; MsqVector< 2 > derivs[100]; sf.derivatives( Sample( 2, 0 ), nodebits, vertices, derivs, n, err ); CPPUNIT_ASSERT( !err ); compare_derivatives( vertices, n, derivs, expected, 6, nodebits ); }
TriLagrangeShape TriLagrangeShapeTest::sf [private] |
Definition at line 99 of file TriLagrangeShapeTest.cpp.