MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Definition at line 53 of file LinearMappingFunctionTest.cpp.
typedef void( * LinearMappingFunctionTest::map_func)(double *, double *) [private] |
Definition at line 147 of file LinearMappingFunctionTest.cpp.
LinearMappingFunctionTest::CPPUNIT_TEST | ( | test_linear_hex_ideal | ) | [private] |
LinearMappingFunctionTest::CPPUNIT_TEST | ( | test_linear_tet_ideal | ) | [private] |
LinearMappingFunctionTest::CPPUNIT_TEST | ( | test_linear_tri_ideal | ) | [private] |
LinearMappingFunctionTest::CPPUNIT_TEST_SUITE_END | ( | ) | [private] |
void LinearMappingFunctionTest::do_coeff_test | ( | MappingFunction & | mf, |
unsigned | subdim, | ||
map_func | mf2, | ||
unsigned | count, | ||
double * | xi | ||
) | [private] |
Definition at line 834 of file LinearMappingFunctionTest.cpp.
References ASSERT_MESSAGE, MBMesquite::MsqError::clear(), MBMesquite::MappingFunction::coefficients(), corners, CPPUNIT_ASSERT, dtostr(), MBMesquite::MappingFunction::element_topology(), itostr(), n, and MBMesquite::NodeSet::set_mid_edge_node().
{ // make sure it fails if passed a nonlinear element MsqError err; double coeff[100]; size_t indices[100]; size_t num_coeff = 100; NodeSet tmp_set; tmp_set.set_mid_edge_node( 1 ); mf.coefficients( Sample( 0, 1 ), tmp_set, coeff, indices, num_coeff, err ); CPPUNIT_ASSERT( err ); err.clear(); // get number of vertices in element const unsigned n = TopologyInfo::corners( mf.element_topology() ); const unsigned d = TopologyInfo::dimension( mf.element_topology() ); // compare coefficients at each location vector< double > comp( n ); for( unsigned i = 0; i < count; ++i ) { num_coeff = 101; mf.coefficients( Sample( subdim, i ), NodeSet(), coeff, indices, num_coeff, err ); CPPUNIT_ASSERT( !err ); mf2( xi, &comp[0] ); string xi_str; for( unsigned j = 0; j < d; ++j ) { xi_str += !j ? "(" : ", "; xi_str += dtostr( xi[j] ); } xi_str += ")"; xi += d; for( unsigned j = 0; j < n; ++j ) { double mf_val = 0.0; size_t idx = std::find( indices, indices + num_coeff, j ) - indices; if( idx < num_coeff ) mf_val = coeff[idx]; CppUnit::Message message( "Coefficients do not match." ); message.addDetail( string( "Entity: " ) + itostr( i ) ); message.addDetail( string( "Coefficient number: " ) + itostr( j ) ); message.addDetail( string( "Xi: " ) + xi_str ); message.addDetail( string( "Expected value: " ) + dtostr( comp[j] ) ); message.addDetail( string( "Actual value: " ) + dtostr( mf_val ) ); ASSERT_MESSAGE( message, fabs( comp[j] - mf_val ) < DBL_EPSILON ); } } }
void LinearMappingFunctionTest::do_deriv_test | ( | MappingFunction2D & | mf, |
unsigned | subdim, | ||
map_func | mf2, | ||
unsigned | count, | ||
double * | xi | ||
) | [private] |
Definition at line 890 of file LinearMappingFunctionTest.cpp.
References ASSERT_MESSAGE, MBMesquite::MsqError::clear(), corners, CPPUNIT_ASSERT, MBMesquite::MappingFunction2D::derivatives(), dtostr(), MBMesquite::MappingFunction::element_topology(), itostr(), n, and MBMesquite::NodeSet::set_mid_edge_node().
{ // make sure it fails if passed a nonlinear element MsqError err; MsqVector< 2 > derivs[100]; size_t verts[100], num_vtx = 37; NodeSet tmp_set; tmp_set.set_mid_edge_node( 1 ); mf.derivatives( Sample( subdim, 0 ), tmp_set, verts, derivs, num_vtx, err ); CPPUNIT_ASSERT( err ); err.clear(); // get number of vertices in element const unsigned n = TopologyInfo::corners( mf.element_topology() ); // compare coefficients at each location vector< double > comp( 2 * n ); for( unsigned i = 0; i < count; ++i ) { num_vtx = 33; mf.derivatives( Sample( subdim, i ), NodeSet(), verts, derivs, num_vtx, err ); CPPUNIT_ASSERT( !err ); CPPUNIT_ASSERT( num_vtx > 0 ); CPPUNIT_ASSERT( num_vtx <= n ); mf2( xi, &comp[0] ); string xi_str; for( unsigned j = 0; j < 2; ++j ) { xi_str += !j ? "(" : ", "; xi_str += dtostr( xi[j] ); } xi_str += ")"; xi += 2; for( unsigned j = 0; j < num_vtx; ++j ) { bool all_zero = true; for( unsigned k = 0; k < 2; ++k ) { CppUnit::Message message( "Coefficient derivatives do not match." ); message.addDetail( string( "Entity: " ) + itostr( i ) ); message.addDetail( string( "Coefficient number: " ) + itostr( j ) ); message.addDetail( string( "Xi: " ) + xi_str ); message.addDetail( string( "Axis: " ) + itostr( k ) ); message.addDetail( string( "Expected value: " ) + dtostr( comp[2 * verts[j] + k] ) ); message.addDetail( string( "Actual value: " ) + dtostr( derivs[j][k] ) ); ASSERT_MESSAGE( message, fabs( comp[2 * verts[j] + k] - derivs[j][k] ) < DBL_EPSILON ); if( fabs( derivs[j][k] ) > DBL_EPSILON ) all_zero = false; } // if vertex has all zero values, it shouldn't have been in the // vertex list at all, as the Jacobian will not depend on that vertex. CPPUNIT_ASSERT( !all_zero ); } // If any vertex is not in the list, then its values must be zero. sort( verts, verts + num_vtx ); for( unsigned j = 0; j < num_vtx; ++j ) { if( !binary_search( verts, verts + num_vtx, j ) ) { for( unsigned k = 0; k < 2; ++k ) { CppUnit::Message message( "Missing coefficient derivatives." ); message.addDetail( string( "Entity: " ) + itostr( i ) ); message.addDetail( string( "Coefficient number: " ) + itostr( j ) ); message.addDetail( string( "Axis: " ) + itostr( k ) ); message.addDetail( string( "Expected derivative: " ) + dtostr( comp[2 * j + k] ) ); ASSERT_MESSAGE( message, fabs( comp[2 * j + k] ) < DBL_EPSILON ); } } } } }
void LinearMappingFunctionTest::do_deriv_test | ( | MappingFunction3D & | mf, |
unsigned | subdim, | ||
map_func | mf2, | ||
unsigned | count, | ||
double * | xi | ||
) | [private] |
Definition at line 970 of file LinearMappingFunctionTest.cpp.
References ASSERT_MESSAGE, MBMesquite::MsqError::clear(), corners, CPPUNIT_ASSERT, MBMesquite::MappingFunction3D::derivatives(), dtostr(), MBMesquite::MappingFunction::element_topology(), itostr(), n, and MBMesquite::NodeSet::set_mid_edge_node().
{ // make sure it fails if passed a nonlinear element MsqError err; MsqVector< 3 > derivs[100]; size_t verts[100], num_vtx = 37; NodeSet tmp_set; tmp_set.set_mid_edge_node( 1 ); mf.derivatives( Sample( subdim, 0 ), tmp_set, verts, derivs, num_vtx, err ); CPPUNIT_ASSERT( err ); err.clear(); // get number of vertices in element const unsigned n = TopologyInfo::corners( mf.element_topology() ); // compare coefficients at each location vector< double > comp( 3 * n ); for( unsigned i = 0; i < count; ++i ) { num_vtx = 33; mf.derivatives( Sample( subdim, i ), NodeSet(), verts, derivs, num_vtx, err ); CPPUNIT_ASSERT( !err ); CPPUNIT_ASSERT( num_vtx > 0 ); CPPUNIT_ASSERT( num_vtx <= n ); mf2( xi, &comp[0] ); string xi_str; for( unsigned j = 0; j < 3; ++j ) { xi_str += !j ? "(" : ", "; xi_str += dtostr( xi[j] ); } xi_str += ")"; xi += 3; for( unsigned j = 0; j < num_vtx; ++j ) { bool all_zero = true; for( unsigned k = 0; k < 3; ++k ) { CppUnit::Message message( "Coefficient derivatives do not match." ); message.addDetail( string( "Entity: " ) + itostr( i ) ); message.addDetail( string( "Coefficient number: " ) + itostr( j ) ); message.addDetail( string( "Xi: " ) + xi_str ); message.addDetail( string( "Axis: " ) + itostr( k ) ); message.addDetail( string( "Expected value: " ) + dtostr( comp[3 * verts[j] + k] ) ); message.addDetail( string( "Actual value: " ) + dtostr( derivs[j][k] ) ); ASSERT_MESSAGE( message, fabs( comp[3 * verts[j] + k] - derivs[j][k] ) < DBL_EPSILON ); if( fabs( derivs[j][k] ) > DBL_EPSILON ) all_zero = false; } // if vertex has all zero values, it shouldn't have been in the // vertex list at all, as the Jacobian will not depend on that vertex. CPPUNIT_ASSERT( !all_zero ); } // If any vertex is not in the list, then its values must be zero. sort( verts, verts + num_vtx ); for( unsigned j = 0; j < num_vtx; ++j ) { if( !binary_search( verts, verts + num_vtx, j ) ) { for( unsigned k = 0; k < 3; ++k ) { CppUnit::Message message( "Missing coefficient derivatives." ); message.addDetail( string( "Entity: " ) + itostr( i ) ); message.addDetail( string( "Coefficient number: " ) + itostr( j ) ); message.addDetail( string( "Axis: " ) + itostr( k ) ); message.addDetail( string( "Expected derivative: " ) + dtostr( comp[3 * j + k] ) ); ASSERT_MESSAGE( message, fabs( comp[3 * j + k] ) < DBL_EPSILON ); } } } } }
void LinearMappingFunctionTest::do_ideal_test | ( | MappingFunction2D & | mf | ) | [private] |
Definition at line 1050 of file LinearMappingFunctionTest.cpp.
References ASSERT_MATRICES_EQUAL, ASSERT_NO_ERROR, corners, CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, MBMesquite::MsqMatrix< R, C >::data(), MBMesquite::det(), MBMesquite::MappingFunction::element_topology(), MBMesquite::JacobianCalculator::get_Jacobian_2D(), MBMesquite::MappingFunction2D::ideal(), MBMesquite::inverse(), moab::R, MBMesquite::transpose(), and MBMesquite::unit_edge_element().
{ MsqError err; MsqMatrix< 3, 2 > W_prime; mf.ideal( Sample( 2, 0 ), W_prime, err ); ASSERT_NO_ERROR( err ); // for this test that everything is in the xy-plane CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, W_prime( 2, 0 ), 1e-12 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, W_prime( 2, 1 ), 1e-12 ); MsqMatrix< 2, 2 > W( W_prime.data() ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, det( W ), 1e-6 ); const Vector3D* verts = unit_edge_element( mf.element_topology() ); CPPUNIT_ASSERT( verts ); JacobianCalculator jc; jc.get_Jacobian_2D( &mf, NodeSet(), Sample( 2, 0 ), verts, TopologyInfo::corners( mf.element_topology() ), W_prime, err ); ASSERT_NO_ERROR( err ); // for this test that everything is in the xy-plane CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, W_prime( 2, 0 ), 1e-12 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, W_prime( 2, 1 ), 1e-12 ); MsqMatrix< 2, 2 > W_exp( W_prime.data() ); W_exp /= sqrt( det( W_exp ) ); // Matrices should be a rotation of each other. // First, calculate tentative rotation matrix MsqMatrix< 2, 2 > R = inverse( W_exp ) * W; // 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 LinearMappingFunctionTest::do_ideal_test | ( | MappingFunction3D & | mf | ) | [private] |
Definition at line 1085 of file LinearMappingFunctionTest.cpp.
References ASSERT_MATRICES_EQUAL, ASSERT_NO_ERROR, MBMesquite::cbrt(), corners, CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, MBMesquite::det(), MBMesquite::MappingFunction::element_topology(), MBMesquite::JacobianCalculator::get_Jacobian_3D(), MBMesquite::MappingFunction3D::ideal(), MBMesquite::inverse(), moab::R, MBMesquite::transpose(), and MBMesquite::unit_edge_element().
{ MsqError err; MsqMatrix< 3, 3 > W, I( 1.0 ); mf.ideal( Sample( 3, 0 ), W, err ); ASSERT_NO_ERROR( err ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, det( W ), 1e-6 ); const Vector3D* verts = unit_edge_element( mf.element_topology() ); CPPUNIT_ASSERT( verts ); JacobianCalculator jc; MsqMatrix< 3, 3 > W_exp; jc.get_Jacobian_3D( &mf, NodeSet(), Sample( 3, 0 ), verts, TopologyInfo::corners( mf.element_topology() ), W_exp, err ); ASSERT_NO_ERROR( err ); W_exp /= MBMesquite::cbrt( det( W_exp ) ); // Matrices should be a rotation of each other. // First, calculate tentative rotation matrix MsqMatrix< 3, 3 > R = W * inverse( W_exp ); // next check that it is a rotation CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, det( R ), 1e-6 ); // no scaling ASSERT_MATRICES_EQUAL( I, transpose( R ) * R, 1e-6 ); // orthogonal }
void LinearMappingFunctionTest::hex_coeff | ( | double | xi[3], |
double | coeff[8] | ||
) | [static, private] |
Definition at line 641 of file LinearMappingFunctionTest.cpp.
{ coeff[0] = ( 1 - xi[0] ) * ( 1 - xi[1] ) * ( 1 - xi[2] ); coeff[1] = xi[0] * ( 1 - xi[1] ) * ( 1 - xi[2] ); coeff[2] = xi[0] * xi[1] * ( 1 - xi[2] ); coeff[3] = ( 1 - xi[0] ) * xi[1] * ( 1 - xi[2] ); coeff[4] = ( 1 - xi[0] ) * ( 1 - xi[1] ) * xi[2]; coeff[5] = xi[0] * ( 1 - xi[1] ) * xi[2]; coeff[6] = xi[0] * xi[1] * xi[2]; coeff[7] = ( 1 - xi[0] ) * xi[1] * xi[2]; }
void LinearMappingFunctionTest::hex_deriv | ( | double | xi[3], |
double | coeff_deriv[24] | ||
) | [static, private] |
Definition at line 699 of file LinearMappingFunctionTest.cpp.
{ coeff[3 * 0 + 0] = -( 1 - xi[1] ) * ( 1 - xi[2] ); coeff[3 * 0 + 1] = -( 1 - xi[0] ) * ( 1 - xi[2] ); coeff[3 * 0 + 2] = -( 1 - xi[0] ) * ( 1 - xi[1] ); coeff[3 * 1 + 0] = ( 1 - xi[1] ) * ( 1 - xi[2] ); coeff[3 * 1 + 1] = -xi[0] * ( 1 - xi[2] ); coeff[3 * 1 + 2] = -xi[0] * ( 1 - xi[1] ); coeff[3 * 2 + 0] = xi[1] * ( 1 - xi[2] ); coeff[3 * 2 + 1] = xi[0] * ( 1 - xi[2] ); coeff[3 * 2 + 2] = -xi[0] * xi[1]; coeff[3 * 3 + 0] = -xi[1] * ( 1 - xi[2] ); coeff[3 * 3 + 1] = ( 1 - xi[0] ) * ( 1 - xi[2] ); coeff[3 * 3 + 2] = -( 1 - xi[0] ) * xi[1]; coeff[3 * 4 + 0] = -( 1 - xi[1] ) * xi[2]; coeff[3 * 4 + 1] = -( 1 - xi[0] ) * xi[2]; coeff[3 * 4 + 2] = ( 1 - xi[0] ) * ( 1 - xi[1] ); coeff[3 * 5 + 0] = ( 1 - xi[1] ) * xi[2]; coeff[3 * 5 + 1] = -xi[0] * xi[2]; coeff[3 * 5 + 2] = xi[0] * ( 1 - xi[1] ); coeff[3 * 6 + 0] = xi[1] * xi[2]; coeff[3 * 6 + 1] = xi[0] * xi[2]; coeff[3 * 6 + 2] = xi[0] * xi[1]; coeff[3 * 7 + 0] = -xi[1] * xi[2]; coeff[3 * 7 + 1] = ( 1 - xi[0] ) * xi[2]; coeff[3 * 7 + 2] = ( 1 - xi[0] ) * xi[1]; }
void LinearMappingFunctionTest::prism_coeff | ( | double | xi[3], |
double | coeff[6] | ||
) | [static, private] |
void LinearMappingFunctionTest::prism_deriv | ( | double | xi[3], |
double | coeff_deriv[18] | ||
) | [static, private] |
Definition at line 761 of file LinearMappingFunctionTest.cpp.
{ coeff[0] = xi[1] + xi[2] - 1.0; ; coeff[1] = xi[0] - 1.0; coeff[2] = xi[0] - 1.0; coeff[3] = -xi[1]; coeff[4] = 1.0 - xi[0]; coeff[5] = 0.0; coeff[6] = -xi[2]; coeff[7] = 0.0; coeff[8] = 1.0 - xi[0]; coeff[9] = 1.0 - xi[1] - xi[2]; coeff[10] = -xi[0]; coeff[11] = -xi[0]; coeff[12] = xi[1]; coeff[13] = xi[0]; coeff[14] = 0.0; coeff[15] = xi[2]; coeff[16] = 0.0; coeff[17] = xi[0]; }
void LinearMappingFunctionTest::pyr_coeff | ( | double | xi[3], |
double | coeff[5] | ||
) | [static, private] |
void LinearMappingFunctionTest::pyr_deriv | ( | double | xi[3], |
double | coeff_deriv[15] | ||
) | [static, private] |
Definition at line 789 of file LinearMappingFunctionTest.cpp.
{ coeff[3 * 0 + 0] = -( 1 - xi[1] ) * ( 1 - xi[2] ); coeff[3 * 0 + 1] = -( 1 - xi[0] ) * ( 1 - xi[2] ); coeff[3 * 0 + 2] = -( 1 - xi[0] ) * ( 1 - xi[1] ); coeff[3 * 1 + 0] = ( 1 - xi[1] ) * ( 1 - xi[2] ); coeff[3 * 1 + 1] = -xi[0] * ( 1 - xi[2] ); coeff[3 * 1 + 2] = -xi[0] * ( 1 - xi[1] ); coeff[3 * 2 + 0] = xi[1] * ( 1 - xi[2] ); coeff[3 * 2 + 1] = xi[0] * ( 1 - xi[2] ); coeff[3 * 2 + 2] = -xi[0] * xi[1]; coeff[3 * 3 + 0] = -xi[1] * ( 1 - xi[2] ); coeff[3 * 3 + 1] = ( 1 - xi[0] ) * ( 1 - xi[2] ); coeff[3 * 3 + 2] = -xi[1] * ( 1 - xi[0] ); coeff[3 * 4 + 0] = 0.0; coeff[3 * 4 + 1] = 0.0; coeff[3 * 4 + 2] = 1.0; }
void LinearMappingFunctionTest::quad_coeff | ( | double | xi[2], |
double | coeff[4] | ||
) | [static, private] |
void LinearMappingFunctionTest::quad_deriv | ( | double | xi[2], |
double | coeff_deriv[8] | ||
) | [static, private] |
void LinearMappingFunctionTest::setUp | ( | ) |
Definition at line 252 of file LinearMappingFunctionTest.cpp.
{}
void LinearMappingFunctionTest::tearDown | ( | ) |
Definition at line 253 of file LinearMappingFunctionTest.cpp.
{}
void LinearMappingFunctionTest::test_coeff_fail | ( | MappingFunction & | mf, |
unsigned | subdim | ||
) | [private] |
Definition at line 1111 of file LinearMappingFunctionTest.cpp.
References MBMesquite::MsqError::clear(), MBMesquite::MappingFunction::coefficients(), and CPPUNIT_ASSERT.
{ // make sure it fails if called MsqError err; double coeff[100]; size_t num_coeff, indices[100]; mf.coefficients( Sample( subdim, 0 ), NodeSet(), coeff, indices, num_coeff, err ); CPPUNIT_ASSERT( err ); err.clear(); }
void LinearMappingFunctionTest::test_deriv_fail | ( | MappingFunction2D & | mf, |
unsigned | subdim | ||
) | [private] |
Definition at line 1122 of file LinearMappingFunctionTest.cpp.
References MBMesquite::MsqError::clear(), CPPUNIT_ASSERT, and MBMesquite::MappingFunction2D::derivatives().
{ // make sure it fails if called MsqError err; MsqVector< 2 > coeff[100]; size_t verts[100], num_coeff; mf.derivatives( Sample( subdim, 0 ), NodeSet(), verts, coeff, num_coeff, err ); CPPUNIT_ASSERT( err ); err.clear(); }
void LinearMappingFunctionTest::test_deriv_fail | ( | MappingFunction3D & | mf, |
unsigned | subdim | ||
) | [private] |
Definition at line 1133 of file LinearMappingFunctionTest.cpp.
References MBMesquite::MsqError::clear(), CPPUNIT_ASSERT, and MBMesquite::MappingFunction3D::derivatives().
{ // make sure it fails if called MsqError err; MsqVector< 3 > coeff[100]; size_t verts[100], num_coeff; mf.derivatives( Sample( subdim, 0 ), NodeSet(), verts, coeff, num_coeff, err ); CPPUNIT_ASSERT( err ); err.clear(); }
Definition at line 342 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[3] = { 0.5, 0.5, 0.5 }; do_coeff_test( hex, 3, hex_coeff, 1, xi ); }
Definition at line 321 of file LinearMappingFunctionTest.cpp.
References MBMesquite::HEXAHEDRON, HexCorners, and MBMesquite::xi.
{ double xi[24]; xi_at_corners( HEXAHEDRON, xi, &HexCorners[0][0] ); do_coeff_test( hex, 0, hex_coeff, 8, xi ); }
Definition at line 328 of file LinearMappingFunctionTest.cpp.
References MBMesquite::HEXAHEDRON, HexCorners, and MBMesquite::xi.
{ double xi[36]; xi_at_edges( HEXAHEDRON, xi, &HexCorners[0][0] ); do_coeff_test( hex, 1, hex_coeff, 12, xi ); }
Definition at line 335 of file LinearMappingFunctionTest.cpp.
References MBMesquite::HEXAHEDRON, HexCorners, and MBMesquite::xi.
{ double xi[18]; xi_at_faces( HEXAHEDRON, xi, &HexCorners[0][0] ); do_coeff_test( hex, 2, hex_coeff, 6, xi ); }
Definition at line 502 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[3] = { 0.5, 0.5, 0.5 }; do_deriv_test( hex, 3, hex_deriv, 1, xi ); }
Definition at line 481 of file LinearMappingFunctionTest.cpp.
References MBMesquite::HEXAHEDRON, HexCorners, and MBMesquite::xi.
{ double xi[24]; xi_at_corners( HEXAHEDRON, xi, &HexCorners[0][0] ); do_deriv_test( hex, 0, hex_deriv, 8, xi ); }
Definition at line 488 of file LinearMappingFunctionTest.cpp.
References MBMesquite::HEXAHEDRON, HexCorners, and MBMesquite::xi.
{ double xi[36]; xi_at_edges( HEXAHEDRON, xi, &HexCorners[0][0] ); do_deriv_test( hex, 1, hex_deriv, 12, xi ); }
Definition at line 495 of file LinearMappingFunctionTest.cpp.
References MBMesquite::HEXAHEDRON, HexCorners, and MBMesquite::xi.
{ double xi[18]; xi_at_faces( HEXAHEDRON, xi, &HexCorners[0][0] ); do_deriv_test( hex, 2, hex_deriv, 6, xi ); }
void LinearMappingFunctionTest::test_linear_hex_ideal | ( | ) | [inline] |
Definition at line 227 of file LinearMappingFunctionTest.cpp.
{ do_ideal_test( hex ); }
Definition at line 446 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[3] = { 0.5, 1. / 3, 1. / 3 }; do_coeff_test( prism, 3, prism_coeff, 1, xi ); }
Definition at line 425 of file LinearMappingFunctionTest.cpp.
References MBMesquite::PRISM, PrismCorners, and MBMesquite::xi.
{ double xi[18]; xi_at_corners( PRISM, xi, PrismCorners ); do_coeff_test( prism, 0, prism_coeff, 6, xi ); }
Definition at line 432 of file LinearMappingFunctionTest.cpp.
References MBMesquite::PRISM, PrismCorners, and MBMesquite::xi.
{ double xi[27]; xi_at_edges( PRISM, xi, PrismCorners ); do_coeff_test( prism, 1, prism_coeff, 9, xi ); }
Definition at line 439 of file LinearMappingFunctionTest.cpp.
References MBMesquite::PRISM, PrismCorners, and MBMesquite::xi.
{ double xi[15]; xi_at_faces( PRISM, xi, PrismCorners ); do_coeff_test( prism, 2, prism_coeff, 5, xi ); }
Definition at line 606 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[3] = { 0.5, 1. / 3, 1. / 3 }; do_deriv_test( prism, 3, prism_deriv, 1, xi ); }
Definition at line 585 of file LinearMappingFunctionTest.cpp.
References MBMesquite::PRISM, PrismCorners, and MBMesquite::xi.
{ double xi[18]; xi_at_corners( PRISM, xi, PrismCorners ); do_deriv_test( prism, 0, prism_deriv, 6, xi ); }
Definition at line 592 of file LinearMappingFunctionTest.cpp.
References MBMesquite::PRISM, PrismCorners, and MBMesquite::xi.
{ double xi[27]; xi_at_edges( PRISM, xi, PrismCorners ); do_deriv_test( prism, 1, prism_deriv, 9, xi ); }
Definition at line 599 of file LinearMappingFunctionTest.cpp.
References MBMesquite::PRISM, PrismCorners, and MBMesquite::xi.
{ double xi[15]; xi_at_faces( PRISM, xi, PrismCorners ); do_deriv_test( prism, 2, prism_deriv, 5, xi ); }
void LinearMappingFunctionTest::test_linear_prism_ideal | ( | ) | [inline] |
Definition at line 243 of file LinearMappingFunctionTest.cpp.
{ do_ideal_test( prism ); }
Definition at line 471 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[3] = { 0.5, 0.5, 0.5 }; do_coeff_test( pyr, 3, pyr_coeff, 1, xi ); }
Definition at line 452 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[15] = { 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1 }; do_coeff_test( pyr, 0, pyr_coeff, 5, xi ); }
Definition at line 458 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[24] = { 0.5, 0.0, 0.0, 1.0, 0.5, 0.0, 0.5, 1.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5, 1.0, 0.0, 0.5, 1.0, 1.0, 0.5, 0.0, 1.0, 0.5 }; do_coeff_test( pyr, 1, pyr_coeff, 8, xi ); }
Definition at line 465 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[15] = { 0.5, 0.0, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.0, 0.5, 0.5, 0.5, 0.5, 0.0 }; do_coeff_test( pyr, 2, pyr_coeff, 5, xi ); }
Definition at line 631 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[3] = { 0.5, 0.5, 0.5 }; do_deriv_test( pyr, 3, pyr_deriv, 1, xi ); }
Definition at line 612 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[15] = { 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0.5, 0.5, 1 }; do_deriv_test( pyr, 0, pyr_deriv, 5, xi ); }
Definition at line 618 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[24] = { 0.5, 0.0, 0.0, 1.0, 0.5, 0.0, 0.5, 1.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5, 1.0, 0.0, 0.5, 1.0, 1.0, 0.5, 0.0, 1.0, 0.5 }; do_deriv_test( pyr, 1, pyr_deriv, 8, xi ); }
Definition at line 625 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[15] = { 0.5, 0.0, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.0, 0.5, 0.5, 0.5, 0.5, 0.0 }; do_deriv_test( pyr, 2, pyr_deriv, 5, xi ); }
Definition at line 367 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[2] = { 0.5, 0.5 }; do_coeff_test( quad, 2, quad_coeff, 1, xi ); }
Definition at line 348 of file LinearMappingFunctionTest.cpp.
References QuadCorners, MBMesquite::QUADRILATERAL, and MBMesquite::xi.
{ double xi[8]; xi_at_corners( QUADRILATERAL, xi, &QuadCorners[0][0] ); do_coeff_test( quad, 0, quad_coeff, 4, xi ); }
Definition at line 355 of file LinearMappingFunctionTest.cpp.
References QuadCorners, MBMesquite::QUADRILATERAL, and MBMesquite::xi.
{ double xi[8]; xi_at_edges( QUADRILATERAL, xi, &QuadCorners[0][0] ); do_coeff_test( quad, 1, quad_coeff, 4, xi ); }
Definition at line 527 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[2] = { 0.5, 0.5 }; do_deriv_test( quad, 2, quad_deriv, 1, xi ); }
Definition at line 508 of file LinearMappingFunctionTest.cpp.
References QuadCorners, MBMesquite::QUADRILATERAL, and MBMesquite::xi.
{ double xi[8]; xi_at_corners( QUADRILATERAL, xi, &QuadCorners[0][0] ); do_deriv_test( quad, 0, quad_deriv, 4, xi ); }
Definition at line 515 of file LinearMappingFunctionTest.cpp.
References QuadCorners, MBMesquite::QUADRILATERAL, and MBMesquite::xi.
{ double xi[8]; xi_at_edges( QUADRILATERAL, xi, &QuadCorners[0][0] ); do_deriv_test( quad, 1, quad_deriv, 4, xi ); }
void LinearMappingFunctionTest::test_linear_quad_ideal | ( | ) | [inline] |
Definition at line 231 of file LinearMappingFunctionTest.cpp.
{ do_ideal_test( quad ); }
Definition at line 394 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[3] = { 0.25, 0.25, 0.25 }; do_coeff_test( tet, 3, tet_coeff, 1, xi ); }
Definition at line 373 of file LinearMappingFunctionTest.cpp.
References TetCorners, MBMesquite::TETRAHEDRON, and MBMesquite::xi.
{ double xi[12]; xi_at_corners( TETRAHEDRON, xi, TetCorners ); do_coeff_test( tet, 0, tet_coeff, 4, xi ); }
Definition at line 380 of file LinearMappingFunctionTest.cpp.
References TetCorners, MBMesquite::TETRAHEDRON, and MBMesquite::xi.
{ double xi[18]; xi_at_edges( TETRAHEDRON, xi, TetCorners ); do_coeff_test( tet, 1, tet_coeff, 6, xi ); }
Definition at line 387 of file LinearMappingFunctionTest.cpp.
References TetCorners, MBMesquite::TETRAHEDRON, and MBMesquite::xi.
{ double xi[12]; xi_at_faces( TETRAHEDRON, xi, TetCorners ); do_coeff_test( tet, 2, tet_coeff, 4, xi ); }
Definition at line 554 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[3] = { 0.25, 0.25, 0.25 }; do_deriv_test( tet, 3, tet_deriv, 1, xi ); }
Definition at line 533 of file LinearMappingFunctionTest.cpp.
References TetCorners, MBMesquite::TETRAHEDRON, and MBMesquite::xi.
{ double xi[12]; xi_at_corners( TETRAHEDRON, xi, TetCorners ); do_deriv_test( tet, 0, tet_deriv, 4, xi ); }
Definition at line 540 of file LinearMappingFunctionTest.cpp.
References TetCorners, MBMesquite::TETRAHEDRON, and MBMesquite::xi.
{ double xi[18]; xi_at_edges( TETRAHEDRON, xi, TetCorners ); do_deriv_test( tet, 1, tet_deriv, 6, xi ); }
Definition at line 547 of file LinearMappingFunctionTest.cpp.
References TetCorners, MBMesquite::TETRAHEDRON, and MBMesquite::xi.
{ double xi[12]; xi_at_faces( TETRAHEDRON, xi, TetCorners ); do_deriv_test( tet, 2, tet_deriv, 4, xi ); }
void LinearMappingFunctionTest::test_linear_tet_ideal | ( | ) | [inline] |
Definition at line 235 of file LinearMappingFunctionTest.cpp.
{ do_ideal_test( tet ); }
Definition at line 419 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[2] = { 1. / 3, 1. / 3 }; do_coeff_test( tri, 2, tri_coeff, 1, xi ); }
Definition at line 400 of file LinearMappingFunctionTest.cpp.
References MBMesquite::TRIANGLE, TriCorners, and MBMesquite::xi.
{ double xi[12]; xi_at_corners( TRIANGLE, xi, TriCorners ); do_coeff_test( tri, 0, tri_coeff, 3, xi ); }
Definition at line 407 of file LinearMappingFunctionTest.cpp.
References MBMesquite::TRIANGLE, TriCorners, and MBMesquite::xi.
{ double xi[18]; xi_at_edges( TRIANGLE, xi, TriCorners ); do_coeff_test( tri, 1, tri_coeff, 3, xi ); }
Definition at line 414 of file LinearMappingFunctionTest.cpp.
{ test_coeff_fail( tri, 3 ); }
Definition at line 579 of file LinearMappingFunctionTest.cpp.
References MBMesquite::xi.
{ double xi[2] = { 1. / 3, 1. / 3 }; do_deriv_test( tri, 2, tri_deriv, 1, xi ); }
Definition at line 560 of file LinearMappingFunctionTest.cpp.
References MBMesquite::TRIANGLE, TriCorners, and MBMesquite::xi.
{ double xi[12]; xi_at_corners( TRIANGLE, xi, TriCorners ); do_deriv_test( tri, 0, tri_deriv, 3, xi ); }
Definition at line 567 of file LinearMappingFunctionTest.cpp.
References MBMesquite::TRIANGLE, TriCorners, and MBMesquite::xi.
{ double xi[18]; xi_at_edges( TRIANGLE, xi, TriCorners ); do_deriv_test( tri, 1, tri_deriv, 3, xi ); }
void LinearMappingFunctionTest::test_linear_tri_ideal | ( | ) | [inline] |
Definition at line 239 of file LinearMappingFunctionTest.cpp.
{ do_ideal_test( tri ); }
void LinearMappingFunctionTest::tet_coeff | ( | double | xi[3], |
double | coeff[4] | ||
) | [static, private] |
Definition at line 653 of file LinearMappingFunctionTest.cpp.
void LinearMappingFunctionTest::tet_deriv | ( | double | xi[3], |
double | coeff_deriv[12] | ||
) | [static, private] |
Definition at line 734 of file LinearMappingFunctionTest.cpp.
{ static const double derivs[] = { -1, -1, -1, 1, 0, 0, 0, 1, 0, 0, 0, 1 }; memcpy( coeff, derivs, sizeof( derivs ) ); }
void LinearMappingFunctionTest::tri_coeff | ( | double | xi[2], |
double | coeff[3] | ||
) | [static, private] |
Definition at line 669 of file LinearMappingFunctionTest.cpp.
void LinearMappingFunctionTest::tri_deriv | ( | double | xi[2], |
double | coeff_deriv[6] | ||
) | [static, private] |
Definition at line 755 of file LinearMappingFunctionTest.cpp.
{ static const double derivs[] = { -1, -1, 1, 0, 0, 1 }; memcpy( coeff, derivs, sizeof( derivs ) ); }
void LinearMappingFunctionTest::xi_at_corners | ( | EntityTopology | type, |
double * | xi, | ||
const int * | corners | ||
) | [private] |
Definition at line 275 of file LinearMappingFunctionTest.cpp.
References corners.
{ unsigned d = TopologyInfo::dimension( type ); unsigned c = TopologyInfo::corners( type ); for( unsigned i = 0; i < c * d; ++i ) xi[i] = corners[i]; }
void LinearMappingFunctionTest::xi_at_edges | ( | EntityTopology | type, |
double * | xi, | ||
const int * | corners | ||
) | [private] |
Definition at line 283 of file LinearMappingFunctionTest.cpp.
References CPPUNIT_ASSERT, MBMesquite::edges, and vtx().
{ MsqError err; unsigned d = TopologyInfo::dimension( type ); unsigned e = TopologyInfo::edges( type ); for( unsigned i = 0; i < e; ++i ) { const unsigned* vtx = TopologyInfo::edge_vertices( type, i, err ); CPPUNIT_ASSERT( !err ); for( unsigned j = 0; j < d; ++j ) xi[d * i + j] = ( corners[d * vtx[0] + j] + corners[d * vtx[1] + j] ) / 2.0; } }
void LinearMappingFunctionTest::xi_at_faces | ( | EntityTopology | type, |
double * | xi, | ||
const int * | corners | ||
) | [private] |
Definition at line 297 of file LinearMappingFunctionTest.cpp.
References CPPUNIT_ASSERT, MBMesquite::faces, moab::sum(), and vtx().
{ MsqError err; unsigned d = TopologyInfo::dimension( type ); unsigned f = TopologyInfo::faces( type ); for( unsigned i = 0; i < f; ++i ) { unsigned c; const unsigned* vtx = TopologyInfo::face_vertices( type, i, c, err ); CPPUNIT_ASSERT( !err ); for( unsigned j = 0; j < d; ++j ) { int sum = 0; for( unsigned k = 0; k < c; ++k ) sum += corners[d * vtx[k] + j]; xi[d * i + j] = (double)sum / c; } } }
Definition at line 126 of file LinearMappingFunctionTest.cpp.
LinearPrism LinearMappingFunctionTest::prism [private] |
Definition at line 130 of file LinearMappingFunctionTest.cpp.
LinearPyramid LinearMappingFunctionTest::pyr [private] |
Definition at line 131 of file LinearMappingFunctionTest.cpp.
Definition at line 127 of file LinearMappingFunctionTest.cpp.
Definition at line 128 of file LinearMappingFunctionTest.cpp.
LinearTriangle LinearMappingFunctionTest::tri [private] |
Definition at line 129 of file LinearMappingFunctionTest.cpp.