MOAB: Mesh Oriented datABase  (version 5.3.0)
HigherOrderTest.cpp File Reference
#include "Mesquite.hpp"
#include "MsqError.hpp"
#include "ArrayMesh.hpp"
#include "DomainClassifier.hpp"
#include "PlanarDomain.hpp"
#include "MeshDomain1D.hpp"
#include "IdealShapeTarget.hpp"
#include "TInverseMeanRatio.hpp"
#include "TShapeSizeOrientNB1.hpp"
#include "TShapeSizeNB3.hpp"
#include "TQualityMetric.hpp"
#include "PMeanPTemplate.hpp"
#include "LPtoPTemplate.hpp"
#include "SteepestDescent.hpp"
#include "FeasibleNewton.hpp"
#include "InstructionQueue.hpp"
#include "TerminationCriterion.hpp"
#include "HexLagrangeShape.hpp"
#include "UnitUtil.hpp"
#include <iostream>
+ Include dependency graph for HigherOrderTest.cpp:

Go to the source code of this file.

Classes

class  HigherOrderTest

Defines

#define HAVE_HO_HEX
#define TEST_HO_QUAD

Functions

 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION (HigherOrderTest,"HigherOrderTest")
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION (HigherOrderTest,"Regression")
static double dist (double x1, double y1, double x2, double y2)
int tri_mid_edge_nodes_edge_center (double x2, double y2, double x3, double y3, double x4, double y4, double x5, double y5, double epsilon)
int quad_all_in_xy_plane (const Vector3D &p2, const Vector3D &p3, const Vector3D &p4, const Vector3D &p5, const Vector3D &p6, const Vector3D &p7, double epsilon)
int quad_mid_edge_nodes_edge_center (const Vector3D &p2, const Vector3D &p3, const Vector3D &p4, const Vector3D &p5, const Vector3D &p6, const Vector3D &p7, double epsilon)
static void get_ideal_quad (Vector3D &p2, Vector3D &p3, Vector3D &p4, Vector3D &p5, Vector3D &p6, Vector3D &p7)
int tet_mid_edge_nodes_edge_center (const Vector3D &p3, const Vector3D &p4, const Vector3D &p5, const Vector3D &p6, const Vector3D &p7, const Vector3D &p8, const Vector3D &p9, double epsilon)
static void get_ideal_tet (Vector3D &p3, Vector3D &p4, Vector3D &p5, Vector3D &p6, Vector3D &p7, Vector3D &p8, Vector3D &p9)

Variables

const int MAX_ITERATIONS = 1000
const double QEL = 1.0
const double IDEAL_TRI_SIDE = sqrt( 2.0 / sqrt( 3.0 ) )
const double IDEAL_TRI_HEIGHT = 1 / IDEAL_TRI_SIDE
const double IDEAL_TET_SIDE = 2.0 / pow( 33, 1.0 / 6.0 )
const double IDEAL_TET_BASE = sqrt( 3.0 ) * 0.5 * IDEAL_TET_SIDE
const double IDEAL_TET_HEIGHT = sqrt( 2.0 / 3.0 ) * IDEAL_TET_SIDE

Detailed Description

Author:
Jason Kraftcheck

Definition in file HigherOrderTest.cpp.


Define Documentation

#define HAVE_HO_HEX

Definition at line 32 of file HigherOrderTest.cpp.

#define TEST_HO_QUAD

Definition at line 33 of file HigherOrderTest.cpp.


Function Documentation

static double dist ( double  x1,
double  y1,
double  x2,
double  y2 
) [inline, static]

Definition at line 189 of file HigherOrderTest.cpp.

{
    return sqrt( ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) );
}
static void get_ideal_tet ( Vector3D p3,
Vector3D p4,
Vector3D p5,
Vector3D p6,
Vector3D p7,
Vector3D p8,
Vector3D p9 
) [inline, static]

Definition at line 613 of file HigherOrderTest.cpp.

References IDEAL_TET_BASE, IDEAL_TET_HEIGHT, IDEAL_TET_SIDE, and MBMesquite::Vector3D::set().

Referenced by HigherOrderTest::test_tet_basic_apex_down(), HigherOrderTest::test_tet_basic_apex_over(), HigherOrderTest::test_tet_basic_apex_up(), HigherOrderTest::test_tet_basic_ideal(), and HigherOrderTest::test_tet_basic_mid_convex().

{
    const Vector3D p0( 0.0, 0.0, 0.0 );
    const Vector3D p1( IDEAL_TET_SIDE, 0.0, 0.0 );
    const Vector3D p2( 0.5 * IDEAL_TET_SIDE, IDEAL_TET_BASE, 0.0 );
    p3.set( 0.5 * IDEAL_TET_SIDE, IDEAL_TET_BASE / 3.0, IDEAL_TET_HEIGHT );
    p4.set( 0.5 * ( p0 + p1 ) );
    p5.set( 0.5 * ( p1 + p2 ) );
    p6.set( 0.5 * ( p2 + p0 ) );
    p7.set( 0.5 * ( p0 + p3 ) );
    p8.set( 0.5 * ( p1 + p3 ) );
    p9.set( 0.5 * ( p2 + p3 ) );
}
int quad_all_in_xy_plane ( const Vector3D p2,
const Vector3D p3,
const Vector3D p4,
const Vector3D p5,
const Vector3D p6,
const Vector3D p7,
double  epsilon 
)

Definition at line 375 of file HigherOrderTest.cpp.

References epsilon, n, and z.

Referenced by HigherOrderTest::test_quad_basic_ideal(), HigherOrderTest::test_quad_basic_left_down(), HigherOrderTest::test_quad_basic_left_over(), HigherOrderTest::test_quad_basic_mid_convex(), HigherOrderTest::test_quad_basic_mid_spin(), HigherOrderTest::test_quad_basic_right_up(), and HigherOrderTest::test_quad_basic_top_down().

{
    Vector3D list[] = { p2, p3, p4, p5, p6, p7 };
    const int n     = sizeof( list ) / sizeof( list[0] );
    int result      = 0;
    for( int i = 0; i < n; ++i )
        if( fabs( list[i].z() ) > epsilon ) result |= ( 1 << i );
    return result;
}
int quad_mid_edge_nodes_edge_center ( const Vector3D p2,
const Vector3D p3,
const Vector3D p4,
const Vector3D p5,
const Vector3D p6,
const Vector3D p7,
double  epsilon 
)

Definition at line 386 of file HigherOrderTest.cpp.

References epsilon, and QEL.

Referenced by HigherOrderTest::test_quad_basic_ideal(), HigherOrderTest::test_quad_basic_left_down(), HigherOrderTest::test_quad_basic_left_over(), HigherOrderTest::test_quad_basic_mid_convex(), HigherOrderTest::test_quad_basic_mid_spin(), HigherOrderTest::test_quad_basic_right_up(), and HigherOrderTest::test_quad_basic_top_down().

{
    const Vector3D p0( 0.0, 0.0, 0.0 );
    const Vector3D p1( QEL, 0.0, 0.0 );
    const Vector3D e0 = 0.5 * ( p0 + p1 );
    const Vector3D e1 = 0.5 * ( p1 + p2 );
    const Vector3D e2 = 0.5 * ( p2 + p3 );
    const Vector3D e3 = 0.5 * ( p3 + p0 );

    int result = 0;
    if( ( p4 - e0 ).length() > epsilon ) result |= 1;
    if( ( p5 - e1 ).length() > epsilon ) result |= 2;
    if( ( p6 - e2 ).length() > epsilon ) result |= 4;
    if( ( p7 - e3 ).length() > epsilon ) result |= 8;

    return result;
}
int tet_mid_edge_nodes_edge_center ( const Vector3D p3,
const Vector3D p4,
const Vector3D p5,
const Vector3D p6,
const Vector3D p7,
const Vector3D p8,
const Vector3D p9,
double  epsilon 
)

Definition at line 589 of file HigherOrderTest.cpp.

References epsilon, IDEAL_TET_BASE, and IDEAL_TET_SIDE.

Referenced by HigherOrderTest::test_tet_basic_apex_down(), HigherOrderTest::test_tet_basic_apex_over(), HigherOrderTest::test_tet_basic_apex_up(), HigherOrderTest::test_tet_basic_ideal(), HigherOrderTest::test_tet_basic_mid_convex(), and HigherOrderTest::test_tet_basic_mid_spin().

{
    const Vector3D p0( 0.0, 0.0, 0.0 );
    const Vector3D p1( IDEAL_TET_SIDE, 0.0, 0.0 );
    const Vector3D p2( 0.5 * IDEAL_TET_SIDE, IDEAL_TET_BASE, 0.0 );
    const Vector3D e0 = 0.5 * ( p0 + p1 );
    const Vector3D e1 = 0.5 * ( p1 + p2 );
    const Vector3D e2 = 0.5 * ( p2 + p0 );
    const Vector3D e3 = 0.5 * ( p0 + p3 );
    const Vector3D e4 = 0.5 * ( p1 + p3 );
    const Vector3D e5 = 0.5 * ( p2 + p3 );

    int result = 0;
    if( ( p4 - e0 ).length() > epsilon ) result |= 1;
    if( ( p5 - e1 ).length() > epsilon ) result |= 2;
    if( ( p6 - e2 ).length() > epsilon ) result |= 4;
    if( ( p7 - e3 ).length() > epsilon ) result |= 8;
    if( ( p8 - e4 ).length() > epsilon ) result |= 16;
    if( ( p9 - e5 ).length() > epsilon ) result |= 32;

    return result;
}
int tri_mid_edge_nodes_edge_center ( double  x2,
double  y2,
double  x3,
double  y3,
double  x4,
double  y4,
double  x5,
double  y5,
double  epsilon 
)

Definition at line 198 of file HigherOrderTest.cpp.

References dist(), epsilon, and IDEAL_TRI_SIDE.

Referenced by HigherOrderTest::test_tri_basic_ideal(), HigherOrderTest::test_tri_basic_mid_convex(), HigherOrderTest::test_tri_basic_mid_spin(), HigherOrderTest::test_tri_basic_peak_down(), HigherOrderTest::test_tri_basic_peak_over(), and HigherOrderTest::test_tri_basic_peak_up().

{
    double x0 = 0.0, y0 = 0.0;
    double x1 = IDEAL_TRI_SIDE, y1 = 0.0;
    double x01 = 0.5 * ( x0 + x1 );
    double x12 = 0.5 * ( x1 + x2 );
    double x20 = 0.5 * ( x2 + x0 );
    double y01 = 0.5 * ( y0 + y1 );
    double y12 = 0.5 * ( y1 + y2 );
    double y20 = 0.5 * ( y2 + y0 );

    int result = 0;
    if( dist( x3, y3, x01, y01 ) > epsilon ) result |= 1;
    if( dist( x4, y4, x12, y12 ) > epsilon ) result |= 2;
    if( dist( x5, y5, x20, y20 ) > epsilon ) result |= 4;

    return result;
}

Variable Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines