#include <mesh_smoother_laplace.h>
Public Member Functions | |
LaplaceMeshSmoother (UnstructuredMesh &mesh) | |
virtual | ~LaplaceMeshSmoother () |
virtual void | smooth () override |
void | smooth (unsigned int n_iterations) |
void | init () |
void | print_graph (std::ostream &out=libMesh::out) const |
Protected Attributes | |
UnstructuredMesh & | _mesh |
Private Member Functions | |
void | allgather_graph () |
Private Attributes | |
bool | _initialized |
std::vector< std::vector< dof_id_type > > | _graph |
This class defines the data structures necessary for Laplace smoothing.
Definition at line 44 of file mesh_smoother_laplace.h.
|
explicit |
Constructor. Sets the constant mesh reference in the protected data section of the class.
Definition at line 36 of file mesh_smoother_laplace.C.
|
inlinevirtual |
|
private |
This function allgather's the (local) graph after it is computed on each processor by the init() function.
Definition at line 261 of file mesh_smoother_laplace.C.
References _graph, libMesh::MeshSmoother::_mesh, libMesh::Parallel::Communicator::allgather(), libMesh::ParallelObject::comm(), libMesh::MeshBase::max_node_id(), and libMesh::ParallelObject::n_processors().
Referenced by init().
void libMesh::LaplaceMeshSmoother::init | ( | ) |
Initialization for the Laplace smoothing routine is basically identical to building an "L-graph" which is expensive. It's provided separately from the constructor since you may or may not want to build the L-graph on construction.
Definition at line 153 of file mesh_smoother_laplace.C.
References _graph, _initialized, libMesh::MeshSmoother::_mesh, libMesh::MeshBase::active_local_element_ptr_range(), allgather_graph(), end, libMesh::MeshBase::max_node_id(), libMesh::MeshBase::mesh_dimension(), and side.
Referenced by smooth().
void libMesh::LaplaceMeshSmoother::print_graph | ( | std::ostream & | out = libMesh::out | ) | const |
Mainly for debugging, this function will print out the connectivity graph which has been created.
Definition at line 247 of file mesh_smoother_laplace.C.
|
inlineoverridevirtual |
Redefinition of the smooth function from the base class. All this does is call the smooth function in this class which takes an int, using a default value of 1.
Implements libMesh::MeshSmoother.
Definition at line 65 of file mesh_smoother_laplace.h.
References smooth().
Referenced by smooth(), and libMesh::TriangleInterface::triangulate().
void libMesh::LaplaceMeshSmoother::smooth | ( | unsigned int | n_iterations | ) |
The actual smoothing function, gets called whenever the user specifies an actual number of smoothing iterations.
Definition at line 45 of file mesh_smoother_laplace.C.
References _graph, _initialized, libMesh::MeshSmoother::_mesh, libMesh::MeshBase::active_element_ptr_range(), libMesh::TypeVector< T >::add(), libMesh::ParallelObject::comm(), libMesh::MeshTools::find_block_boundary_nodes(), libMesh::MeshTools::find_boundary_nodes(), init(), libMesh::MeshBase::local_node_ptr_range(), libMesh::MeshBase::max_node_id(), libMesh::MeshBase::node_ref(), libMesh::MeshBase::nodes_begin(), libMesh::MeshBase::nodes_end(), libMesh::MeshBase::point(), libMesh::ParallelObject::processor_id(), libMesh::Real, and libMesh::Parallel::sync_dofobject_data_by_id().
|
private |
Data structure for holding the L-graph
Definition at line 104 of file mesh_smoother_laplace.h.
Referenced by allgather_graph(), init(), print_graph(), and smooth().
|
private |
True if the L-graph has been created, false otherwise.
Definition at line 99 of file mesh_smoother_laplace.h.
|
protectedinherited |
Definition at line 61 of file mesh_smoother.h.
Referenced by libMesh::VariationalMeshSmoother::adjust_adapt_data(), allgather_graph(), init(), libMesh::VariationalMeshSmoother::metr_data_gen(), libMesh::VariationalMeshSmoother::readgr(), smooth(), libMesh::VariationalMeshSmoother::smooth(), and libMesh::VariationalMeshSmoother::writegr().