MOAB: Mesh Oriented datABase  (version 5.4.1)
HexLagrangeShapeTest Class Reference
+ Inheritance diagram for HexLagrangeShapeTest:
+ Collaboration diagram for HexLagrangeShapeTest:

Public Member Functions

void test_corner_coeff (int corner)
void test_edge_coeff (int edge)
void test_face_coeff (int face)
void test_mid_coeff ()
void test_corner_derivs (int corner)
void test_edge_derivs (int edge)
void test_face_derivs (int face)
void test_mid_derivs ()
void setUp ()
void test_corners_coeff ()
void test_edges_coeff ()
void test_faces_coeff ()
void test_corners_derivs ()
void test_edges_derivs ()
void test_faces_derivs ()
void test_ideal_jacobian ()

Public Attributes

NodeSet allNodes

Private Member Functions

 CPPUNIT_TEST_SUITE (HexLagrangeShapeTest)
 CPPUNIT_TEST (test_corners_coeff)
 CPPUNIT_TEST (test_edges_coeff)
 CPPUNIT_TEST (test_faces_coeff)
 CPPUNIT_TEST (test_mid_coeff)
 CPPUNIT_TEST (test_corners_derivs)
 CPPUNIT_TEST (test_edges_derivs)
 CPPUNIT_TEST (test_faces_derivs)
 CPPUNIT_TEST (test_mid_derivs)
 CPPUNIT_TEST (test_ideal_jacobian)
 CPPUNIT_TEST_SUITE_END ()

Private Attributes

HexLagrangeShape sf

Detailed Description

Definition at line 118 of file HexLagrangeShapeTest.cpp.


Member Function Documentation

Definition at line 427 of file HexLagrangeShapeTest.cpp.

References compare_coefficients(), CPPUNIT_ASSERT, get_coeffs(), and XI_corner().

{
    MsqPrintError err( std::cout );

    double expected[27];
    get_coeffs( XI_corner( corner ), expected );

    double coeff[100];
    size_t num_coeff = 11, indices[100];
    sf.coefficients( Sample( 0, corner ), allNodes, coeff, indices, num_coeff, err );
    CPPUNIT_ASSERT( !err );

    compare_coefficients( coeff, indices, num_coeff, expected, corner );
}

Definition at line 487 of file HexLagrangeShapeTest.cpp.

References compare_derivatives(), CPPUNIT_ASSERT, get_derivs(), and XI_corner().

{
    MsqPrintError err( std::cout );

    MsqVector< 3 > expected[27];
    get_derivs( XI_corner( corner ), expected );

    size_t vertices[100], num_vtx = 23;
    MsqVector< 3 > derivs[100];
    sf.derivatives( Sample( 0, corner ), allNodes, vertices, derivs, num_vtx, err );
    CPPUNIT_ASSERT( !err );

    compare_derivatives( vertices, num_vtx, derivs, expected, corner );
}

Definition at line 547 of file HexLagrangeShapeTest.cpp.

{
    for( unsigned i = 0; i < 8; ++i )
        test_corner_coeff( i );
}

Definition at line 565 of file HexLagrangeShapeTest.cpp.

{
    for( unsigned i = 0; i < 8; ++i )
        test_corner_derivs( i );
}

Definition at line 442 of file HexLagrangeShapeTest.cpp.

References compare_coefficients(), CPPUNIT_ASSERT, get_coeffs(), and XI_edge().

{
    MsqPrintError err( std::cout );

    double expected[27];
    get_coeffs( XI_edge( edge ), expected );

    double coeff[100];
    size_t num_coeff = 11, indices[100];
    sf.coefficients( Sample( 1, edge ), allNodes, coeff, indices, num_coeff, err );
    CPPUNIT_ASSERT( !err );

    compare_coefficients( coeff, indices, num_coeff, expected, edge + 8 );
}

Definition at line 502 of file HexLagrangeShapeTest.cpp.

References compare_derivatives(), CPPUNIT_ASSERT, get_derivs(), and XI_edge().

{
    MsqPrintError err( std::cout );

    MsqVector< 3 > expected[27];
    get_derivs( XI_edge( edge ), expected );

    size_t vertices[100], num_vtx = 23;
    MsqVector< 3 > derivs[100];
    sf.derivatives( Sample( 1, edge ), allNodes, vertices, derivs, num_vtx, err );
    CPPUNIT_ASSERT( !err );

    compare_derivatives( vertices, num_vtx, derivs, expected, edge + 8 );
}

Definition at line 553 of file HexLagrangeShapeTest.cpp.

{
    for( unsigned i = 0; i < 12; ++i )
        test_edge_coeff( i );
}

Definition at line 571 of file HexLagrangeShapeTest.cpp.

{
    for( unsigned i = 0; i < 12; ++i )
        test_edge_derivs( i );
}

Definition at line 457 of file HexLagrangeShapeTest.cpp.

References compare_coefficients(), CPPUNIT_ASSERT, get_coeffs(), and XI_face().

{
    MsqPrintError err( std::cout );

    double expected[27];
    get_coeffs( XI_face( face ), expected );

    double coeff[100];
    size_t num_coeff = 11, indices[100];
    sf.coefficients( Sample( 2, face ), allNodes, coeff, indices, num_coeff, err );
    CPPUNIT_ASSERT( !err );

    compare_coefficients( coeff, indices, num_coeff, expected, face + 20 );
}

Definition at line 517 of file HexLagrangeShapeTest.cpp.

References compare_derivatives(), CPPUNIT_ASSERT, get_derivs(), and XI_face().

{
    MsqPrintError err( std::cout );

    MsqVector< 3 > expected[27];
    get_derivs( XI_face( face ), expected );

    size_t vertices[100], num_vtx = 23;
    MsqVector< 3 > derivs[100];
    sf.derivatives( Sample( 2, face ), allNodes, vertices, derivs, num_vtx, err );
    CPPUNIT_ASSERT( !err );

    compare_derivatives( vertices, num_vtx, derivs, expected, face + 20 );
}

Definition at line 559 of file HexLagrangeShapeTest.cpp.

{
    for( unsigned i = 0; i < 6; ++i )
        test_face_coeff( i );
}

Definition at line 577 of file HexLagrangeShapeTest.cpp.

{
    for( unsigned i = 0; i < 6; ++i )
        test_face_derivs( i );
}

Definition at line 583 of file HexLagrangeShapeTest.cpp.

References ASSERT_MATRICES_EQUAL, ASSERT_NO_ERROR, CPPUNIT_ASSERT_DOUBLES_EQUAL, MBMesquite::det(), MBMesquite::inverse(), moab::R, and MBMesquite::transpose().

{
    MsqError err;
    MsqMatrix< 3, 3 > J_act, J_exp( 1.0 );
    sf.ideal( Sample( 3, 0 ), J_act, err );
    ASSERT_NO_ERROR( err );

    // Matrices should be a rotation of each other.
    // First, calculate tentative rotation matrix
    MsqMatrix< 3, 3 > 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
}

Definition at line 472 of file HexLagrangeShapeTest.cpp.

References compare_coefficients(), CPPUNIT_ASSERT, get_coeffs(), and XI_elem().

{
    MsqPrintError err( std::cout );

    double expected[27];
    get_coeffs( XI_elem(), expected );

    double coeff[100];
    size_t num_coeff = 11, indices[100];
    sf.coefficients( Sample( 3, 0 ), allNodes, coeff, indices, num_coeff, err );
    CPPUNIT_ASSERT( !err );

    compare_coefficients( coeff, indices, num_coeff, expected, 26 );
}

Definition at line 532 of file HexLagrangeShapeTest.cpp.

References compare_derivatives(), CPPUNIT_ASSERT, get_derivs(), and XI_elem().

{
    MsqPrintError err( std::cout );

    MsqVector< 3 > expected[27];
    get_derivs( XI_elem(), expected );

    size_t vertices[100], num_vtx = 23;
    MsqVector< 3 > derivs[100];
    sf.derivatives( Sample( 3, 0 ), allNodes, vertices, derivs, num_vtx, err );
    CPPUNIT_ASSERT( !err );

    compare_derivatives( vertices, num_vtx, derivs, expected, 26 );
}

Member Data Documentation

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines