xmsmesh  1.0
MeRelaxerUnitTests Class Reference

Tests for MeRelaxer. More...

Inheritance diagram for MeRelaxerUnitTests:

Public Member Functions

void testRelaxWhileMeshing ()
 Tests the relaxation code as if we were creating a mesh. More...
 
void testSpringRelaxSetup ()
 Tests the spring relax setup. Uses the TIN below. More...
 
void testSpringRelaxSetup2 ()
 Tests the spring relax setup. Uses the TIN below. This tin has missing triangles compared to the previous example. More...
 
void testSpringRelaxSinglePoint ()
 Tests the spring relax of a point. Uses the TIN below. More...
 
void testSpringRelaxSinglePoint2 ()
 Tests the spring relax of a point. Uses the TIN below. More...
 
void testSpringRelaxSinglePoint3 ()
 Tests the spring relax of a point. Uses the TIN below. We are relaxing point 4 and it has 3 connections to the upper edge, 2 connection to the middle and 1 connection to the bottom edge. The result is that the points is "pulled" toward the upper edge. This is not desirable for pre quad mesh generation. More...
 
void testNewLocationIsValid ()
 Tests that a new location for a point is within one of the triangles adjacent to that point's current position. More...
 
void testAllTrianglesHavePositiveArea ()
 Tests the spring relax of a point. Uses the TIN below. More...
 

Detailed Description

Tests for MeRelaxer.

Definition at line 24 of file MeRelaxer.t.h.

Member Function Documentation

◆ testAllTrianglesHavePositiveArea()

void MeRelaxerUnitTests::testAllTrianglesHavePositiveArea ( )

Tests the spring relax of a point. Uses the TIN below.

x is a missing triangle
6----7----8
| \ | / |
3----4----5
| / | \ |
0----1----2

Definition at line 1008 of file MeRelaxer.cpp.

References xms::MeRelaxerImpl::AllTrianglesHavePositiveArea(), and xms::TrTin::New().

◆ testNewLocationIsValid()

void MeRelaxerUnitTests::testNewLocationIsValid ( )

Tests that a new location for a point is within one of the triangles adjacent to that point's current position.

x is a missing triangle
6----7----8 //
| / | \ / //
3----4--5 //
| / | \ \ //
0----1----2 //

Definition at line 942 of file MeRelaxer.cpp.

References xms::MeRelaxerImpl::m_sizer, xms::MeRelaxerImpl::m_tin, xms::TrTin::New(), xms::MePolyRedistributePts::New(), xms::MeRelaxerImpl::NewLocationIsValid(), xms::MeRelaxerImpl::SetupNeighbors(), and xms::MeRelaxerImpl::SetupPointSizes().

◆ testRelaxWhileMeshing()

void MeRelaxerUnitTests::testRelaxWhileMeshing ( )

Tests the relaxation code as if we were creating a mesh.

//  40-   20-----21-----22-----23-----24
//    |   |\2   1|\2   1|\0   2|\1   0|
//    |   |0\ 12 |1\ 26 |2\ 25 |1\ 28 |
//    |   |  \   |  \   |  \   |  \   |
//    |   | 8 \  |   \  |   \  |   \  |
//    |   |    \0| 11 \0| 23 \1| 27 \2|
//    |   |1   2\|2   0\|0   1\|2   0\|
//  30-   15-----16-----17-----18-----19
//    |   |\2   1|\2   1|0   2/|\1   0|
//    |   |0\    |1\ 31 | 24 /2|2\ 29 |
//    |   |  \ 9 |  \   |   /  |  \   |
//    |   | 7 \  |   \  |  /   |   \  |
//    |   |    \0| 10 \0|1/ 22 | 30 \2|
//    |   |1   2\|2   0\|/0   1|0   1\|
//  20-   10-----11-----12-----13-----14
//    |   |0   2/|\1   0|\0   2|\0   2|
//    |   | 13 /2|2\ 14 |2\ 18 |2\ 21 |
//    |   |   /  |  \   |  \   |  \   |
//    |   |  / 6 | 5 \  |   \  |   \  |
//    |   |1/    |    \2| 15 \1| 19 \1|
//    |   |/0   1|0   1\|0   1\|0   1\|
//  10-   5------6------7------8------9
//    |   |\0   2|\0   2|\1   0|\1   0|
//    |   |2\    |1\    |0\ 16 |0\ 20 |
//    |   |  \ 1 |  \ 2 |  \   |  \   |
//    |   | 0 \  | 3 \  | 4 \  |   \  |
//    |   |    \1|    \1|    \2| 17 \2|
//    |   |0   1\|2   0\|1   2\|1   2\|
//  0 -   0------1------2------3------4
//
//        |------|------|------|------|
//        0     10     20     30     40
/// 

Definition at line 637 of file MeRelaxer.cpp.

References xms::TrTin::New(), xms::MeRelaxer::New(), xms::TrTriangulator::Triangulate(), TS_ASSERT_DELTA_VECPT3D, and XM_COUNTOF.

◆ testSpringRelaxSetup()

void MeRelaxerUnitTests::testSpringRelaxSetup ( )

◆ testSpringRelaxSetup2()

void MeRelaxerUnitTests::testSpringRelaxSetup2 ( )

Tests the spring relax setup. Uses the TIN below. This tin has missing triangles compared to the previous example.

x is a missing triangle
6-9 7----8
|/x/x| / |
3----4----5
| / | \ |
0----1----2

Definition at line 732 of file MeRelaxer.cpp.

References xms::MeRelaxerImpl::m_pointNeighbors, xms::MeRelaxerImpl::m_pointSizes, xms::MeRelaxerImpl::m_sizer, xms::MeRelaxerImpl::m_tin, xms::TrTin::New(), xms::MePolyRedistributePts::New(), xms::MeRelaxerImpl::SetupNeighbors(), xms::MeRelaxerImpl::SetupPointSizes(), TS_ASSERT_EQUALS_VEC, and TS_ASSERT_EQUALS_VEC2D.

◆ testSpringRelaxSinglePoint()

void MeRelaxerUnitTests::testSpringRelaxSinglePoint ( )

◆ testSpringRelaxSinglePoint2()

void MeRelaxerUnitTests::testSpringRelaxSinglePoint2 ( )

◆ testSpringRelaxSinglePoint3()

void MeRelaxerUnitTests::testSpringRelaxSinglePoint3 ( )

Tests the spring relax of a point. Uses the TIN below. We are relaxing point 4 and it has 3 connections to the upper edge, 2 connection to the middle and 1 connection to the bottom edge. The result is that the points is "pulled" toward the upper edge. This is not desirable for pre quad mesh generation.

x is a missing triangle
6----7----8
| \ | / |
3------4--5
| \ | / |
0----1----2

Definition at line 903 of file MeRelaxer.cpp.

References xms::MeRelaxerImpl::m_sizer, xms::MeRelaxerImpl::m_tin, xms::TrTin::New(), xms::MePolyRedistributePts::New(), xms::MeRelaxerImpl::NewLocationIsValid(), xms::MeRelaxerImpl::SetupNeighbors(), xms::MeRelaxerImpl::SetupPointSizes(), and xms::MeRelaxerImpl::SpringRelaxSinglePoint().


The documentation for this class was generated from the following files: