MOAB: Mesh Oriented datABase  (version 5.4.1)
XYRectangleTest.cpp File Reference
#include "Mesquite.hpp"
#include "XYRectangle.hpp"
#include "ArrayMesh.hpp"
#include "MsqVertex.hpp"
#include "UnitUtil.hpp"
#include "MsqError.hpp"
+ Include dependency graph for XYRectangleTest.cpp:

Go to the source code of this file.

Classes

class  XYRectangleTest

Functions

 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION (XYRectangleTest,"Unit")
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION (XYRectangleTest,"XYRectangleTest")
Vector3D snap_to (const Vector3D &vertex, const Vector3D &point)
unsigned short dof (const Vector3D &point)

Variables

const double WIDTH = 4
const double HEIGHT = 2
const double XMIN = 0
const double YMIN = 0
double TEST_MESH_COORDS []
const int NUM_TEST_MESH_VERTS = sizeof( TEST_MESH_COORDS ) / sizeof( double ) / 3
const unsigned long TEST_MESH_CONN []
const int NUM_TEST_MESH_TRIS = sizeof( TEST_MESH_CONN ) / sizeof( TEST_MESH_CONN[0] ) / 3

Detailed Description

Author:
Jason Kraftcheck

Definition in file XYRectangleTest.cpp.


Function Documentation

unsigned short dof ( const Vector3D point)

Definition at line 265 of file XYRectangleTest.cpp.

References HEIGHT, WIDTH, XMIN, and YMIN.

Referenced by check_results(), MBMesquite::Instruction::initialize_vertex_byte(), MBMesquite::SlaveBoundaryVertices::loop_over_mesh(), main(), ConicDomainTest::test_domain_DoF(), SphericalDomainTest::test_domain_DoF(), XYRectangleTest::test_domain_DoF(), and MBMesquite::DomainClassifier::test_valid_classification().

{
    unsigned short result = 2;
    if( ( fabs( point[0] - XMIN ) < 1e-6 ) || ( fabs( point[0] - XMIN - WIDTH ) < 1e-6 ) ) --result;
    if( ( fabs( point[1] - YMIN ) < 1e-6 ) || ( fabs( point[1] - YMIN - HEIGHT ) < 1e-6 ) ) --result;
    return result;
}
Vector3D snap_to ( const Vector3D vertex,
const Vector3D point 
)

Definition at line 142 of file XYRectangleTest.cpp.

References HEIGHT, WIDTH, XMIN, and YMIN.

Referenced by XYRectangleTest::test_snap_to().

{
    Vector3D result;
    result[2] = 0.0;

    if( fabs( vertex[0] - XMIN ) < 1e-6 )
        result[0] = XMIN;
    else if( fabs( vertex[0] - XMIN - WIDTH ) < 1e-6 )
        result[0] = XMIN + WIDTH;
    else
        result[0] = point[0];

    if( fabs( vertex[1] - YMIN ) < 1e-6 )
        result[1] = YMIN;
    else if( fabs( vertex[1] - YMIN - HEIGHT ) < 1e-6 )
        result[1] = YMIN + HEIGHT;
    else
        result[1] = point[1];

    return result;
}

Variable Documentation

const int NUM_TEST_MESH_TRIS = sizeof( TEST_MESH_CONN ) / sizeof( TEST_MESH_CONN[0] ) / 3

Definition at line 125 of file XYRectangleTest.cpp.

Referenced by XYRectangleTest::setUp().

const int NUM_TEST_MESH_VERTS = sizeof( TEST_MESH_COORDS ) / sizeof( double ) / 3

Definition at line 122 of file XYRectangleTest.cpp.

Referenced by XYRectangleTest::setUp().

const unsigned long TEST_MESH_CONN[]
Initial value:
 { 0, 1, 4, 1, 2, 5, 0, 4, 3, 1, 5, 4, 2, 6, 5,
                                         3, 4, 7, 4, 5, 8, 5, 6, 9, 4, 8, 7, 5, 9, 8 }

Definition at line 123 of file XYRectangleTest.cpp.

Referenced by XYRectangleTest::setUp().

double TEST_MESH_COORDS[]
Initial value:
 { XMIN,
                              YMIN,
                              0,
                              XMIN + 0.5 * WIDTH,
                              YMIN,
                              0,
                              XMIN + WIDTH,
                              YMIN,
                              0,
                              XMIN,
                              YMIN + 0.5 * HEIGHT,
                              0,
                              XMIN + .25 * WIDTH,
                              YMIN + 0.5 * HEIGHT,
                              0,
                              XMIN + .75 * WIDTH,
                              YMIN + 0.5 * HEIGHT,
                              0,
                              XMIN + WIDTH,
                              YMIN + 0.5 * HEIGHT,
                              0,
                              XMIN,
                              YMIN + HEIGHT,
                              0,
                              XMIN + 0.5 * WIDTH,
                              YMIN + HEIGHT,
                              0,
                              XMIN + WIDTH,
                              YMIN + HEIGHT,
                              0 }

Definition at line 92 of file XYRectangleTest.cpp.

Referenced by XYRectangleTest::setUp().

const double WIDTH = 4

Definition at line 43 of file XYRectangleTest.cpp.

const double XMIN = 0

Definition at line 43 of file XYRectangleTest.cpp.

Referenced by dof(), and snap_to().

const double YMIN = 0

Definition at line 43 of file XYRectangleTest.cpp.

Referenced by dof(), and snap_to().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines