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

Public Member Functions

void setUp ()
void tearDown ()
 VertexCullingRegressionTest ()
void test_laplacian_smoothing_with_cull ()

Private Member Functions

 CPPUNIT_TEST_SUITE (VertexCullingRegressionTest)
 CPPUNIT_TEST (test_laplacian_smoothing_with_cull)
 CPPUNIT_TEST_SUITE_END ()

Private Attributes

int pF

Detailed Description

Definition at line 77 of file VertexCullingRegressionTest.cpp.


Constructor & Destructor Documentation


Member Function Documentation

Definition at line 87 of file VertexCullingRegressionTest.cpp.

    {
        // pF=1;//PRINT_FLAG IS ON
        pF = 0;  // PRINT_FLAG IS OFF
    }

Definition at line 93 of file VertexCullingRegressionTest.cpp.

{}

Definition at line 98 of file VertexCullingRegressionTest.cpp.

References MBMesquite::TerminationCriterion::add_absolute_successive_improvement(), MBMesquite::TerminationCriterion::add_iteration_limit(), MBMesquite::InstructionQueue::add_preconditioner(), MBMesquite::QualityAssessor::add_quality_assessment(), MBMesquite::InstructionQueue::add_quality_assessor(), CPPUNIT_ASSERT, MBMesquite::TerminationCriterion::cull_on_absolute_vertex_movement(), mesh, MBMesquite::MeshImpl::read_vtk(), MBMesquite::QualityMetric::RMS, MBMesquite::IQInterface::run_instructions(), MBMesquite::AveragingQM::set_averaging_method(), MBMesquite::QualityImprover::set_inner_termination_criterion(), MBMesquite::InstructionQueue::set_master_quality_improver(), and MBMesquite::QualityImprover::set_outer_termination_criterion().

    {
        /* Read a VTK Mesh file */
        MsqPrintError err( cout );
        MBMesquite::MeshImpl mesh;
        mesh.read_vtk( MESH_FILES_DIR "2D/vtk/quads/untangled/square_quad_10_rand.vtk", err );
        CPPUNIT_ASSERT( !err );

        Vector3D pnt( 0, 0, 5 );
        Vector3D s_norm( 0, 0, 1 );
        MBMesquite::PlanarDomain msq_geom( s_norm, pnt );

        // create an objective function for use in termination criteria
        IdealWeightInverseMeanRatio metric;
        LPtoPTemplate of( 2, &metric );

        // creates an intruction queue
        InstructionQueue queue1;

        // creates a mean ratio quality metric ...
        ConditionNumberQualityMetric shape_metric;
        EdgeLengthQualityMetric lapl_met;
        lapl_met.set_averaging_method( QualityMetric::RMS );

        // creates the laplacian smoother  procedures
        LaplacianSmoother lapl1( &of );
        LaplacianSmoother lapl2( &of );
        QualityAssessor stop_qa = QualityAssessor( &shape_metric );
        stop_qa.add_quality_assessment( &lapl_met );

        //**************Set termination criterion****************
        TerminationCriterion sc2;
        sc2.add_iteration_limit( 1000 );
        sc2.add_absolute_successive_improvement( 0.0 );
        // set a criterion with a culling method for the inner criterion
        TerminationCriterion sc_cull;
        sc_cull.cull_on_absolute_vertex_movement( 0.1 );
        CPPUNIT_ASSERT( !err );
        TerminationCriterion sc_cull_2;
        sc_cull_2.cull_on_absolute_vertex_movement( 0.000001 );
        CPPUNIT_ASSERT( !err );
        // Make sure no errors
        CPPUNIT_ASSERT( !err );
        lapl1.set_outer_termination_criterion( &sc2 );
        lapl2.set_outer_termination_criterion( &sc2 );
        lapl1.set_inner_termination_criterion( &sc_cull );
        lapl2.set_inner_termination_criterion( &sc_cull_2 );
        // adds 1 pass of pass1 to mesh_set1
        queue1.add_quality_assessor( &stop_qa, err );
        // Make sure no errors
        CPPUNIT_ASSERT( !err );
        queue1.add_preconditioner( &lapl1, err );
        // Make sure no errors
        CPPUNIT_ASSERT( !err );
        queue1.set_master_quality_improver( &lapl2, err );
        // Make sure no errors
        CPPUNIT_ASSERT( !err );
        queue1.add_quality_assessor( &stop_qa, err );
        // Make sure no errors
        CPPUNIT_ASSERT( !err );
        MeshDomainAssoc mesh_and_domain = MeshDomainAssoc( &mesh, &msq_geom );
        queue1.run_instructions( &mesh_and_domain, err );
        CPPUNIT_ASSERT( !err );
    }

Member Data Documentation

Definition at line 85 of file VertexCullingRegressionTest.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