38 #ifndef Mesquite_LaplacianSmoother_hpp
39 #define Mesquite_LaplacianSmoother_hpp
42 #include "VertexMover.hpp"
43 #include "MsqFreeVertexIndexIterator.hpp"
45 #ifdef MSQ_USE_OLD_STD_HEADERS
57 class LaplacianSmoother :
public VertexMover
63 virtual void initialize(PatchData &pd, MsqError &err);
77 msq_std::vector<size_t> adj_vtx_ind,
79 size_t dimension, MsqError &err)
81 MsqVertex* verts=pd.get_vertex_array(err);
82 msq_std::vector<size_t>::iterator iter;
91 scale_val=1.0/((double) num_adj_vtx);
94 for(j=0;j<dimension;++
j) {
96 iter=adj_vtx_ind.begin();
98 while(iter != adj_vtx_ind.end()){
99 avg[
j]+=verts[*iter][
j];
103 verts[free_ind][
j] = avg[
j]*scale_val;
virtual void initialize(PatchData &pd, MsqError &err)
invalid function argument passed
LaplacianSmoother(MsqError &err)
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
virtual void initialize_mesh_iteration(PatchData &pd, MsqError &err)
virtual void optimize_vertex_positions(PatchData &pd, MsqError &err)
virtual void terminate_mesh_iteration(PatchData &pd, MsqError &err)
void centroid_smooth_mesh(PatchData &pd, size_t num_adj_vtx, msq_std::vector< size_t > adj_vtx_ind, size_t free_ind, size_t dimension, MsqError &err)