18 #include "libmesh/libmesh_config.h" 19 #if defined(LIBMESH_ENABLE_VSMOOTHER) 22 #include "libmesh/mesh_smoother_vsmoother.h" 23 #include "libmesh/mesh_tools.h" 24 #include "libmesh/elem.h" 25 #include "libmesh/unstructured_mesh.h" 26 #include "libmesh/utility.h" 27 #include "libmesh/boundary_info.h" 28 #include "libmesh/equation_systems.h" 29 #include "libmesh/distributed_mesh.h" 30 #include "libmesh/steady_solver.h" 31 #include "libmesh/diff_solver.h" 32 #include "libmesh/parallel_ghost_sync.h" 46 #ifdef __INTEL_COMPILER 47 # pragma optimize ( "", off ) 53 const bool preserve_subdomain_boundaries)
55 _dilation_weight(dilation_weight),
56 _preserve_subdomain_boundaries(preserve_subdomain_boundaries),
64 libmesh_not_implemented_msg(
"Meshes containing elements of differing dimension are not yet supported.");
139 for (
auto * node_copy :
_mesh_copy->local_node_ptr_range())
143 node(d) = (*node_copy)(d);
159 libmesh_error_msg_if(!
_setup_called,
"Need to first call the setup() method of " 160 <<
"this VariationalMeshSmoother object, then call get_mesh_info() prior " 161 <<
"to calling smooth().");
167 #endif // defined(LIBMESH_ENABLE_VSMOOTHER)
virtual void solve() override
Solves the system to smooth the mesh.
const Real _dilation_weight
Smoother control variables.
std::unique_ptr< EquationSystems > _equation_systems
EquationsSystems object associated with the smoother.
static constexpr Real TOLERANCE
std::unique_ptr< TimeSolver > time_solver
A pointer to the solver object we're going to use.
const MeshQualityInfo & get_mesh_info() const
Getter for the _system's _mesh_info attribute.
const Parallel::Communicator & comm() const
VariationalSmootherSystem * _system
VariationalSmootherSystem * system() const
Getter for _system to protect against dangling pointers.
The libMesh namespace provides an interface to certain functionality in the library.
std::unique_ptr< VariationalSmootherConstraint > _constraint
Constraints imposed on the smoothing process.
void attach_constraint_object(Constraint &constrain)
Register a user object for imposing constraints.
std::unique_ptr< DistributedMesh > _mesh_copy
Mesh copy to avoid multiple EquationSystems.
Struct to hold smoother-relevant information about the mesh quality.
bool _setup_called
Attribute the keep track of whether the setup method has been called.
The UnstructuredMesh class is derived from the MeshBase class.
const MeshQualityInfo & get_mesh_info()
Getter for the _mesh_info attribute.
Real & get_dilation_weight()
const std::set< unsigned char > & elem_dimensions() const
void sync_dofobject_data_by_id(const Communicator &comm, const Iterator &range_begin, const Iterator &range_end, SyncFunctor &sync)
Request data about a range of ghost dofobjects uniquely identified by their id.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
VariationalMeshSmoother(UnstructuredMesh &mesh, Real dilation_weight=0.5, const bool preserve_subdomain_boundaries=true)
Simple constructor to use for smoothing purposes.
virtual const Node & node_ref(const dof_id_type i) const
This class provides the necessary interface for mesh smoothing.
virtual void setup()
Setup method that creates equation systems, system, and constraints, to be called just prior to smoot...
const bool _preserve_subdomain_boundaries
Whether subdomain boundaries are subject to change via smoothing.
virtual void smooth() override
Redefinition of the smooth function from the base class.