MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <LaplaceWrapper.hpp>
Public Member Functions | |
MESQUITE_EXPORT | LaplaceWrapper () |
void | set_cpu_time_limit (double seconds) |
Specify timeout after which untangler will exit. | |
double | get_cpu_time_limit () const |
void | set_vertex_movement_limit_factor (double f) |
Specify factor by which to minimum distance a vertex must move in an iteration to avoid termination of the untangler. | |
double | get_vertex_movement_limit_factor () const |
void | set_iteration_limit (int limit) |
Specify maximum number of iterations. | |
int | get_iteration_limit () const |
void | enable_culling (bool yesno) |
Cull vertices based on movement limit. | |
bool | is_culling_enabled () const |
MESQUITE_EXPORT | ~LaplaceWrapper () |
Protected Member Functions | |
MESQUITE_EXPORT void | run_wrapper (MeshDomainAssoc *mesh_and_domain, ParallelMesh *pmesh, Settings *settings, QualityAssessor *qa, MsqError &err) |
Private Attributes | |
double | maxTime |
double | movementFactor |
int | iterationLimit |
bool | doCulling |
Definition at line 40 of file LaplaceWrapper.hpp.
Definition at line 47 of file LaplaceWrapper.cpp.
: maxTime( -1.0 ), movementFactor( DEFAULT_MOVEMENT_FACTOR ), iterationLimit( DEFAULT_ITERATION_LIMIT ), doCulling( CULLING_DEFAULT ) { }
Definition at line 53 of file LaplaceWrapper.cpp.
{}
void MBMesquite::LaplaceWrapper::enable_culling | ( | bool | yesno | ) | [inline] |
Cull vertices based on movement limit.
Definition at line 88 of file LaplaceWrapper.hpp.
References doCulling.
Referenced by main().
{ doCulling = yesno; }
double MBMesquite::LaplaceWrapper::get_cpu_time_limit | ( | ) | const [inline] |
int MBMesquite::LaplaceWrapper::get_iteration_limit | ( | ) | const [inline] |
Definition at line 82 of file LaplaceWrapper.hpp.
References iterationLimit.
{ return iterationLimit; }
double MBMesquite::LaplaceWrapper::get_vertex_movement_limit_factor | ( | ) | const [inline] |
Definition at line 69 of file LaplaceWrapper.hpp.
References movementFactor.
{ return movementFactor; }
bool MBMesquite::LaplaceWrapper::is_culling_enabled | ( | ) | const [inline] |
void MBMesquite::LaplaceWrapper::run_wrapper | ( | MeshDomainAssoc * | mesh_and_domain, |
ParallelMesh * | pmesh, | ||
Settings * | settings, | ||
QualityAssessor * | quality_assessor, | ||
MsqError & | err | ||
) | [protected, virtual] |
Function that each wrapper must implement
Implements MBMesquite::Wrapper.
Definition at line 55 of file LaplaceWrapper.cpp.
References MBMesquite::QualityAssessor::add_quality_assessment(), MBMesquite::InstructionQueue::add_quality_assessor(), MBMesquite::TerminationCriterion::cull_on_absolute_vertex_movement_edge_length(), doCulling, MBMesquite::inner(), MBMesquite::MsqError::INVALID_STATE, iterationLimit, maxTime, movementFactor, MSQ_ERRRTN, MSQ_SETERR, MBMesquite::outer(), MBMesquite::InstructionQueue::run_common(), MBMesquite::QualityImprover::set_inner_termination_criterion(), MBMesquite::InstructionQueue::set_master_quality_improver(), and MBMesquite::QualityImprover::set_outer_termination_criterion().
{ if( maxTime <= 0.0 && movementFactor <= 0.0 && iterationLimit <= 0 ) { MSQ_SETERR( err ) ( "No termination criterion set. " "LaplaceWrapper will run forever.", MsqError::INVALID_STATE ); return; } IdealWeightInverseMeanRatio qa_metric; qa->add_quality_assessment( &qa_metric ); LaplacianSmoother smoother; TerminationCriterion outer( "<type:laplace_outer>" ), inner( "<type:laplace_inner>" ); if( maxTime > 0.0 ) outer.add_cpu_time( maxTime ); if( iterationLimit > 0 ) outer.add_iteration_limit( iterationLimit ); if( doCulling && movementFactor > 0.0 ) { inner.cull_on_absolute_vertex_movement_edge_length( movementFactor ); smoother.set_inner_termination_criterion( &inner ); } else if( movementFactor > 0.0 ) { outer.add_absolute_vertex_movement_edge_length( movementFactor ); } smoother.set_outer_termination_criterion( &outer ); InstructionQueue q; q.add_quality_assessor( qa, err );MSQ_ERRRTN( err ); q.set_master_quality_improver( &smoother, err );MSQ_ERRRTN( err ); q.add_quality_assessor( qa, err );MSQ_ERRRTN( err ); q.run_common( mesh_and_domain, pmesh, settings, err );MSQ_ERRRTN( err ); }
void MBMesquite::LaplaceWrapper::set_cpu_time_limit | ( | double | seconds | ) | [inline] |
Specify timeout after which untangler will exit.
Specify a value less than or equal to zero for no limit
Definition at line 50 of file LaplaceWrapper.hpp.
References maxTime.
{ maxTime = seconds; }
void MBMesquite::LaplaceWrapper::set_iteration_limit | ( | int | limit | ) | [inline] |
Specify maximum number of iterations.
Specify a value less than or equal to zero for no limit
Definition at line 78 of file LaplaceWrapper.hpp.
References iterationLimit.
Referenced by main().
{ iterationLimit = limit; }
void MBMesquite::LaplaceWrapper::set_vertex_movement_limit_factor | ( | double | f | ) | [inline] |
Specify factor by which to minimum distance a vertex must move in an iteration to avoid termination of the untangler.
Specify a value less than or equal to zero for no limit. Culling cannot be done w/out a limit on vertex movement
Definition at line 65 of file LaplaceWrapper.hpp.
References movementFactor.
Referenced by main().
{ movementFactor = f; }
bool MBMesquite::LaplaceWrapper::doCulling [private] |
Definition at line 111 of file LaplaceWrapper.hpp.
Referenced by enable_culling(), is_culling_enabled(), and run_wrapper().
int MBMesquite::LaplaceWrapper::iterationLimit [private] |
Definition at line 110 of file LaplaceWrapper.hpp.
Referenced by get_iteration_limit(), run_wrapper(), and set_iteration_limit().
double MBMesquite::LaplaceWrapper::maxTime [private] |
Definition at line 109 of file LaplaceWrapper.hpp.
Referenced by get_cpu_time_limit(), run_wrapper(), and set_cpu_time_limit().
double MBMesquite::LaplaceWrapper::movementFactor [private] |
Definition at line 109 of file LaplaceWrapper.hpp.
Referenced by get_vertex_movement_limit_factor(), run_wrapper(), and set_vertex_movement_limit_factor().