MOAB: Mesh Oriented datABase  (version 5.3.1)
MsqVertexTest Class Reference
+ Inheritance diagram for MsqVertexTest:
+ Collaboration diagram for MsqVertexTest:

Public Member Functions

void setUp ()
void tearDown ()
 MsqVertexTest ()
void test_hex_vertices ()
void test_flags ()

Private Member Functions

 CPPUNIT_TEST_SUITE (MsqVertexTest)
 CPPUNIT_TEST (test_flags)
 CPPUNIT_TEST_SUITE_END ()

Private Attributes

PatchData one_hex_patch
PatchData one_tet_patch
PatchData one_qua_patch
PatchData one_tri_patch
Vector3D e1
Vector3D e2
Vector3D e3
double tolEps

Detailed Description

Definition at line 64 of file MsqVertexTest.cpp.


Constructor & Destructor Documentation

Definition at line 123 of file MsqVertexTest.cpp.

{}

Member Function Documentation

void MsqVertexTest::setUp ( ) [inline]

Definition at line 81 of file MsqVertexTest.cpp.

References MBMesquite::HEXAHEDRON, MBMesquite::QUADRILATERAL, MBMesquite::TETRAHEDRON, and MBMesquite::TRIANGLE.

    {
        tolEps = 1.e-12;
        // set up the unit vectors
        e1.set( 1, 0, 0 );
        e2.set( 0, 1, 0 );
        e3.set( 0, 0, 1 );

        MsqPrintError err( cout );

        double hcoords[] = { 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 1.0,
                             1.0, 1.0, 2.0, 2.0, 1.0, 2.0, 2.0, 2.0, 2.0, 1.0, 2.0, 2.0 };
        size_t hconn[]   = { 0, 1, 2, 3, 4, 5, 6, 7 };
        one_hex_patch.fill( 8, hcoords, 1, HEXAHEDRON, hconn, 0, err );

        double tcoords[] = { 1.0,
                             1.0,
                             1.0,
                             2.0,
                             1.0,
                             1.0,
                             1.5,
                             1 + sqrt( 3.0 ) / 2.0,
                             1.0,
                             1.5,
                             1 + sqrt( 3.0 ) / 6.0,
                             1 + sqrt( 2.0 ) / sqrt( 3.0 ) };
        size_t tconn[]   = { 0, 1, 2, 3 };
        one_tet_patch.fill( 4, tcoords, 1, TETRAHEDRON, tconn, 0, err );

        double qcoords[] = { 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 1.0 };
        size_t qconn[]   = { 0, 1, 2, 3 };
        one_qua_patch.fill( 4, qcoords, 1, QUADRILATERAL, qconn, 0, err );

        double rcoords[] = { 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.5, 1 + sqrt( 3.0 ) / 2.0, 1.0 };
        size_t rconn[]   = { 0, 1, 2 };
        one_tri_patch.fill( 3, rcoords, 1, TRIANGLE, rconn, 0, err );
    }
void MsqVertexTest::tearDown ( ) [inline]

Definition at line 120 of file MsqVertexTest.cpp.

{}
void MsqVertexTest::test_flags ( ) [inline]

Definition at line 146 of file MsqVertexTest.cpp.

References CPPUNIT_ASSERT, MBMesquite::MsqVertex::is_flag_set(), MBMesquite::MsqVertex::MSQ_CULLED, MBMesquite::MsqVertex::MSQ_HARD_FIXED, MBMesquite::MsqVertex::set_hard_fixed_flag(), and vtx().

    {
        MsqVertex vtx( 1, 2, 3 );
        CPPUNIT_ASSERT( vtx.is_flag_set( MsqVertex::MSQ_HARD_FIXED ) == false );
        vtx.set_hard_fixed_flag();
        CPPUNIT_ASSERT( vtx.is_flag_set( MsqVertex::MSQ_CULLED ) == false );
        CPPUNIT_ASSERT( vtx.is_flag_set( MsqVertex::MSQ_HARD_FIXED ) == true );
        CPPUNIT_ASSERT( ( vtx.is_flag_set( MsqVertex::MSQ_CULLED ) || vtx.is_flag_set( MsqVertex::MSQ_HARD_FIXED ) ) ==
                        true );
        CPPUNIT_ASSERT( ( vtx.is_flag_set( MsqVertex::MSQ_CULLED ) && vtx.is_flag_set( MsqVertex::MSQ_HARD_FIXED ) ) ==
                        false );
    }

Definition at line 125 of file MsqVertexTest.cpp.

References CPPUNIT_ASSERT, CPPUNIT_ASSERT_EQUAL, MBMesquite::Vector3D::set(), and vtx().

    {
        MsqPrintError err( cout );
        // prints out the vertices.
        const MsqVertex* ideal_vertices = one_hex_patch.get_vertex_array( err );
        CPPUNIT_ASSERT( !err );
        int num_vtx = one_hex_patch.num_nodes();
        CPPUNIT_ASSERT_EQUAL( 8, num_vtx );

        MsqVertex vtx;

        vtx.set( 1, 1, 1 );
        CPPUNIT_ASSERT_EQUAL( vtx, ideal_vertices[0] );

        vtx.set( 2, 2, 2 );
        CPPUNIT_ASSERT_EQUAL( vtx, ideal_vertices[6] );

        vtx.set( 1, 2, 2 );
        CPPUNIT_ASSERT_EQUAL( vtx, ideal_vertices[7] );
    }

Member Data Documentation

Definition at line 77 of file MsqVertexTest.cpp.

Definition at line 77 of file MsqVertexTest.cpp.

Definition at line 77 of file MsqVertexTest.cpp.

Definition at line 73 of file MsqVertexTest.cpp.

Definition at line 75 of file MsqVertexTest.cpp.

Definition at line 74 of file MsqVertexTest.cpp.

Definition at line 76 of file MsqVertexTest.cpp.

double MsqVertexTest::tolEps [private]

Definition at line 78 of file MsqVertexTest.cpp.

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