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

Public Member Functions

 CylinderDomainTest ()
void setUp ()
void tearDown ()
void test_z_basic ()
void test_z_snap_to ()
void test_z_normal_at ()
void test_z_closest_point ()
void test_x_basic ()
void test_x_snap_to ()
void test_x_normal_at ()
void test_x_closest_point ()
void test_domain_DoF ()

Private Member Functions

 CPPUNIT_TEST_SUITE (CylinderDomainTest)
 CPPUNIT_TEST (test_z_basic)
 CPPUNIT_TEST (test_z_snap_to)
 CPPUNIT_TEST (test_z_normal_at)
 CPPUNIT_TEST (test_z_closest_point)
 CPPUNIT_TEST (test_x_basic)
 CPPUNIT_TEST (test_x_snap_to)
 CPPUNIT_TEST (test_x_normal_at)
 CPPUNIT_TEST (test_x_closest_point)
 CPPUNIT_TEST (test_domain_DoF)
 CPPUNIT_TEST_SUITE_END ()

Private Attributes

CylinderDomain z
CylinderDomain x

Detailed Description

Definition at line 10 of file CylinderDomainTest.cpp.


Constructor & Destructor Documentation

Definition at line 28 of file CylinderDomainTest.cpp.

: z( 1 ), x( 2, Vector3D( 1, 0, 0 ) ) {}

Member Function Documentation

void CylinderDomainTest::setUp ( ) [inline]

Definition at line 30 of file CylinderDomainTest.cpp.

{}
void CylinderDomainTest::tearDown ( ) [inline]

Definition at line 31 of file CylinderDomainTest.cpp.

{}

Definition at line 180 of file CylinderDomainTest.cpp.

References CPPUNIT_ASSERT, CPPUNIT_ASSERT_EQUAL, and z.

{
    const size_t count = 3;
    unsigned short dof_vals[count];
    MsqError err;
    z.domain_DoF( 0, dof_vals, count, err );
    CPPUNIT_ASSERT( !err );
    for( size_t i = 0; i < count; ++i )
        CPPUNIT_ASSERT_EQUAL( (unsigned short)2, dof_vals[i] );
}

Definition at line 53 of file CylinderDomainTest.cpp.

References CPPUNIT_ASSERT_EQUAL.

Definition at line 169 of file CylinderDomainTest.cpp.

References ASSERT_VECTORS_EQUAL, and CPPUNIT_ASSERT.

{
    MsqError err;
    Vector3D point( 20, 0, x.radius() );
    Vector3D close, normal;
    x.closest_point( 0, point, close, normal, err );
    CPPUNIT_ASSERT( !err );
    ASSERT_VECTORS_EQUAL( point, close );
    ASSERT_VECTORS_EQUAL( Vector3D( 0, 0, 1 ), normal );
}

Definition at line 127 of file CylinderDomainTest.cpp.

References ASSERT_VECTORS_EQUAL, CPPUNIT_ASSERT_DOUBLES_EQUAL, MBMesquite::EPSILON, MBMesquite::Vector3D::length(), MBMesquite::Vector3D::set(), and MBMesquite::Vector3D::x().

{
    Vector3D vect;

    vect.set( 1, 0, 0.5 );
    x.vertex_normal_at( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( 0, 0, 1 ), vect );

    vect.set( -5, 100, 0 );
    x.vertex_normal_at( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( 0, 1, 0 ), vect );

    vect = x.center();
    x.vertex_normal_at( 0, vect );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, vect.x(), EPSILON );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, vect.length(), EPSILON );

    vect.set( 1, 0, 0.5 );
    x.element_normal_at( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( 0, 0, 1 ), vect );

    vect.set( -5, 100, 0 );
    x.element_normal_at( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( 0, 1, 0 ), vect );

    vect = x.center();
    x.element_normal_at( 0, vect );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, vect.x(), EPSILON );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, vect.length(), EPSILON );
}

Definition at line 78 of file CylinderDomainTest.cpp.

References ASSERT_VECTORS_EQUAL, CPPUNIT_ASSERT_DOUBLES_EQUAL, MBMesquite::EPSILON, MBMesquite::length(), MBMesquite::Vector3D::set(), and MBMesquite::Vector3D::x().

{
    Vector3D vect;

    vect.set( 1, 0, 0.5 );
    x.snap_to( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( 1, 0, x.radius() ), vect );

    vect.set( -5, 100, 0 );
    x.snap_to( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( -5, x.radius(), 0 ), vect );

    vect = x.center();
    x.snap_to( 0, vect );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, vect.x(), EPSILON );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( x.radius(), ( vect - x.center() ).length(), EPSILON );
}

Definition at line 46 of file CylinderDomainTest.cpp.

References CPPUNIT_ASSERT_EQUAL, and z.

Definition at line 158 of file CylinderDomainTest.cpp.

References ASSERT_VECTORS_EQUAL, CPPUNIT_ASSERT, and z.

{
    MsqError err;
    Vector3D point( z.radius(), 0, 20 );
    Vector3D close, normal;
    z.closest_point( 0, point, close, normal, err );
    CPPUNIT_ASSERT( !err );
    ASSERT_VECTORS_EQUAL( point, close );
    ASSERT_VECTORS_EQUAL( Vector3D( 1, 0, 0 ), normal );
}

Definition at line 96 of file CylinderDomainTest.cpp.

References ASSERT_VECTORS_EQUAL, CPPUNIT_ASSERT_DOUBLES_EQUAL, MBMesquite::EPSILON, MBMesquite::Vector3D::length(), MBMesquite::Vector3D::set(), z, and MBMesquite::Vector3D::z().

{
    Vector3D vect;

    vect.set( 0.5, 0, 1 );
    z.vertex_normal_at( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( 1, 0, 0 ), vect );

    vect.set( 0, 100, -5 );
    z.vertex_normal_at( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( 0, 1, 0 ), vect );

    vect = z.center();
    z.vertex_normal_at( 0, vect );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, vect.z(), EPSILON );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, vect.length(), EPSILON );

    vect.set( 0.5, 0, 1 );
    z.element_normal_at( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( 1, 0, 0 ), vect );

    vect.set( 0, 100, -5 );
    z.element_normal_at( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( 0, 1, 0 ), vect );

    vect = z.center();
    z.element_normal_at( 0, vect );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, vect.z(), EPSILON );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( 1.0, vect.length(), EPSILON );
}

Definition at line 60 of file CylinderDomainTest.cpp.

References ASSERT_VECTORS_EQUAL, CPPUNIT_ASSERT_DOUBLES_EQUAL, MBMesquite::EPSILON, MBMesquite::length(), MBMesquite::Vector3D::set(), z, and MBMesquite::Vector3D::z().

{
    Vector3D vect;

    vect.set( 0.5, 0, 1 );
    z.snap_to( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( z.radius(), 0, 1 ), vect );

    vect.set( 0, 100, -5 );
    z.snap_to( 0, vect );
    ASSERT_VECTORS_EQUAL( Vector3D( 0, z.radius(), -5 ), vect );

    vect = z.center();
    z.snap_to( 0, vect );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( 0, vect.z(), EPSILON );
    CPPUNIT_ASSERT_DOUBLES_EQUAL( z.radius(), ( vect - z.center() ).length(), EPSILON );
}

Member Data Documentation

Definition at line 25 of file CylinderDomainTest.cpp.

Definition at line 25 of file CylinderDomainTest.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