MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <SizeAdaptShapeWrapper.hpp>
Public Member Functions | |
SizeAdaptShapeWrapper (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 |
Definition at line 41 of file SizeAdaptShapeWrapper.hpp.
MBMesquite::SizeAdaptShapeWrapper::SizeAdaptShapeWrapper | ( | double | max_vertex_movement, |
int | max_iterations = 50 , |
||
int | parallel_iterations = 10 |
||
) | [inline] |
max_vertex_movement | Termination optimization if no vertex is moved by more than this distance in the previous solver step. |
max_iterations | Termination optimizaiton after this many solver steps. |
Definition at line 62 of file SizeAdaptShapeWrapper.hpp.
: iterationLimit( max_iterations ), parallelIterations( parallel_iterations ), maxVtxMovement( max_vertex_movement ) { }
void MBMesquite::SizeAdaptShapeWrapper::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 56 of file SizeAdaptShapeWrapper.cpp.
References MBMesquite::TerminationCriterion::add_absolute_vertex_movement(), MBMesquite::TerminationCriterion::add_iteration_limit(), MBMesquite::QualityAssessor::add_quality_assessment(), MBMesquite::InstructionQueue::add_quality_assessor(), MBMesquite::InstructionQueue::add_tag_vertex_mesh(), MBMesquite::MeshDomainAssoc::get_mesh(), iterationLimit, 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 TagVertexMesh init_mesh( err, mesh );MSQ_ERRRTN( err ); ReferenceMesh ref_mesh( &init_mesh ); RefMeshTargetCalculator W_0( &ref_mesh ); q.add_tag_vertex_mesh( &init_mesh, err );MSQ_ERRRTN( err ); // create objective function IdealShapeTarget W_i; LambdaTarget W( &W_0, &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 ); }
int MBMesquite::SizeAdaptShapeWrapper::iterationLimit [private] |
Definition at line 44 of file SizeAdaptShapeWrapper.hpp.
Referenced by run_wrapper().
double MBMesquite::SizeAdaptShapeWrapper::maxVtxMovement [private] |
Definition at line 46 of file SizeAdaptShapeWrapper.hpp.
Referenced by run_wrapper().
int MBMesquite::SizeAdaptShapeWrapper::parallelIterations [private] |
Definition at line 45 of file SizeAdaptShapeWrapper.hpp.
Referenced by run_wrapper().