MOAB: Mesh Oriented datABase  (version 5.3.1)
MBMesquite::PaverMinEdgeLengthWrapper Class Reference

#include <PaverMinEdgeLengthWrapper.hpp>

+ Inheritance diagram for MBMesquite::PaverMinEdgeLengthWrapper:
+ Collaboration diagram for MBMesquite::PaverMinEdgeLengthWrapper:

Public Member Functions

 PaverMinEdgeLengthWrapper (double max_vertex_movement, int max_iterations=50, int parallel_iterations=10)

Private Member Functions

void run_wrapper (MeshDomainAssoc *mesh_and_domain, ParallelMesh *pmesh, Settings *settings, QualityAssessor *qa, MsqError &err)

Private Attributes

int iterationLimit
int parallelIterations
double maxVtxMovement

Detailed Description

Definition at line 41 of file PaverMinEdgeLengthWrapper.hpp.


Constructor & Destructor Documentation

MBMesquite::PaverMinEdgeLengthWrapper::PaverMinEdgeLengthWrapper ( double  max_vertex_movement,
int  max_iterations = 50,
int  parallel_iterations = 10 
) [inline]
Parameters:
max_vertex_movementTermination optimization if no vertex is moved by more than this distance in the previous solver step.
max_iterationsTermination optimizaiton after this many solver steps.

Definition at line 59 of file PaverMinEdgeLengthWrapper.hpp.

        : iterationLimit( max_iterations ), parallelIterations( parallel_iterations ),
          maxVtxMovement( max_vertex_movement )
    {
    }

Member Function Documentation

void MBMesquite::PaverMinEdgeLengthWrapper::run_wrapper ( MeshDomainAssoc mesh_and_domain,
ParallelMesh pmesh,
Settings settings,
QualityAssessor quality_assessor,
MsqError err 
) [private, virtual]

Function that each wrapper must implement

Implements MBMesquite::Wrapper.

Definition at line 60 of file PaverMinEdgeLengthWrapper.cpp.

References MBMesquite::TerminationCriterion::add_absolute_vertex_movement(), MBMesquite::TerminationCriterion::add_iteration_limit(), MBMesquite::QualityAssessor::add_quality_assessment(), MBMesquite::InstructionQueue::add_quality_assessor(), MBMesquite::SimpleStats::average(), MBMesquite::MeshDomainAssoc::get_mesh(), iterationLimit, MBMesquite::MeshUtil::lambda_distribution(), maxVtxMovement, mesh, MSQ_CHKERR, MSQ_ERRRTN, parallelIterations, MBMesquite::InstructionQueue::run_common(), MBMesquite::QualityImprover::set_inner_termination_criterion(), MBMesquite::InstructionQueue::set_master_quality_improver(), and MBMesquite::QualityImprover::set_outer_termination_criterion().

{
    InstructionQueue q;
    Mesh* mesh = mesh_and_domain->get_mesh();

    // calculate average lambda for mesh
    ReferenceMesh ref_mesh( mesh );
    RefMeshTargetCalculator W_0( &ref_mesh );
    SimpleStats lambda_stats;
    MeshUtil tool( mesh, settings );
    tool.lambda_distribution( lambda_stats, err );MSQ_ERRRTN( err );
    double lambda = lambda_stats.average();

    // create objective function
    IdealShapeTarget W_i;
    LambdaConstant W( lambda, &W_i );
    TShapeSizeB1 tm;
    TQualityMetric mu_0( &W, &tm );
    ElementPMeanP mu( 1.0, &mu_0 );
    PMeanPTemplate of( 1.0, &mu );

    // create quality assessor
    EdgeLengthMetric len( 0.0 );
    qa->add_quality_assessment( &mu );
    qa->add_quality_assessment( &len );
    q.add_quality_assessor( qa, err );

    // create solver
    TrustRegion solver( &of );
    TerminationCriterion tc, ptc;
    tc.add_absolute_vertex_movement( maxVtxMovement );
    tc.add_iteration_limit( iterationLimit );
    ptc.add_iteration_limit( pmesh ? parallelIterations : 1 );
    solver.set_inner_termination_criterion( &tc );
    solver.set_outer_termination_criterion( &ptc );
    q.set_master_quality_improver( &solver, err );MSQ_ERRRTN( err );
    q.add_quality_assessor( qa, err );

    // Optimize mesh
    q.run_common( mesh_and_domain, pmesh, settings, err );MSQ_CHKERR( err );
}

Member Data Documentation

Definition at line 46 of file PaverMinEdgeLengthWrapper.hpp.

Referenced by run_wrapper().

List of all members.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines