MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <LaplacianSmoother.hpp>
Public Member Functions | |
MESQUITE_EXPORT | LaplacianSmoother (ObjectiveFunction *OF=NULL) |
virtual MESQUITE_EXPORT | ~LaplacianSmoother () |
virtual MESQUITE_EXPORT std::string | get_name () const |
Get string name for use in diagnostic and status output. | |
Protected Member Functions | |
virtual MESQUITE_EXPORT void | optimize_vertex_positions (PatchData &pd, MsqError &err) |
Private Attributes | |
std::vector< size_t > | adjVtxList |
Moves free center vertex to the average of the neighboring vertices.
Definition at line 50 of file LaplacianSmoother.hpp.
MESQUITE_EXPORT MBMesquite::LaplacianSmoother::LaplacianSmoother | ( | ObjectiveFunction * | OF = NULL | ) | [inline] |
OF | ObjectiveFunction used by some termination criteria |
Definition at line 56 of file LaplacianSmoother.hpp.
: RelaxationSmoother( OF ) {}
MBMesquite::LaplacianSmoother::~LaplacianSmoother | ( | ) | [virtual] |
Definition at line 50 of file src/mesquite/QualityImprover/Relaxation/LaplacianSmoother.cpp.
{}
std::string MBMesquite::LaplacianSmoother::get_name | ( | ) | const [virtual] |
Get string name for use in diagnostic and status output.
Implements MBMesquite::Instruction.
Definition at line 45 of file src/mesquite/QualityImprover/Relaxation/LaplacianSmoother.cpp.
{ return "LaplacianSmoother"; }
void MBMesquite::LaplacianSmoother::optimize_vertex_positions | ( | PatchData & | pd, |
MsqError & | err | ||
) | [protected, virtual] |
Implements MBMesquite::RelaxationSmoother.
Definition at line 52 of file src/mesquite/QualityImprover/Relaxation/LaplacianSmoother.cpp.
References adjVtxList, MBMesquite::PatchData::get_adjacent_vertex_indices(), MBMesquite::PatchData::get_vertex_array(), MSQ_ERRRTN, n, MBMesquite::PatchData::num_free_vertices(), MBMesquite::PatchData::set_vertex_coordinates(), and MBMesquite::PatchData::snap_vertex_to_domain().
{ assert( pd.num_free_vertices() == 1 ); const size_t center_vtx_index = 0; adjVtxList.clear(); pd.get_adjacent_vertex_indices( center_vtx_index, adjVtxList, err );MSQ_ERRRTN( err ); if( adjVtxList.empty() ) return; const MsqVertex* verts = pd.get_vertex_array( err ); const size_t n = adjVtxList.size(); Vector3D new_pos = verts[adjVtxList[0]]; for( size_t i = 1; i < n; ++i ) new_pos += verts[adjVtxList[i]]; new_pos *= 1.0 / n; pd.set_vertex_coordinates( new_pos, center_vtx_index, err ); pd.snap_vertex_to_domain( center_vtx_index, err );MSQ_ERRRTN( err ); }
std::vector< size_t > MBMesquite::LaplacianSmoother::adjVtxList [private] |
Definition at line 65 of file LaplacianSmoother.hpp.
Referenced by optimize_vertex_positions().