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,
54 const Real relative_residual_tolerance,
55 const Real absolute_residual_tolerance,
const unsigned int verbosity)
57 _dilation_weight(dilation_weight),
58 _preserve_subdomain_boundaries(preserve_subdomain_boundaries),
60 _relative_residual_tolerance(relative_residual_tolerance),
61 _absolute_residual_tolerance(absolute_residual_tolerance) {}
67 libmesh_not_implemented_msg(
"Meshes containing elements of differing dimension are not yet supported.");
116 _constraint = std::make_unique<VariationalSmootherConstraint>(
137 solver.
quiet =
false;
160 #ifdef LIBMESH_ENABLE_EXCEPTIONS 166 for (
auto * node_copy :
_mesh_copy->local_node_ptr_range())
170 node(d) = (*node_copy)(d);
186 libmesh_error_msg_if(!
_setup_called,
"Need to first call the setup() method of " 187 <<
"this VariationalMeshSmoother object, then call get_mesh_info() prior " 188 <<
"to calling smooth().");
194 #endif // defined(LIBMESH_ENABLE_VSMOOTHER) const unsigned int _verbosity
verbosity setting
virtual void solve() override
Solves the system to smooth the mesh.
const Real _dilation_weight
Smoother control variables.
VariationalMeshSmoother(UnstructuredMesh &mesh, Real dilation_weight=0.5, const bool preserve_subdomain_boundaries=true, const Real relative_residual_tolerance=TOLERANCE *TOLERANCE, const Real absolute_residual_tolerance=TOLERANCE *TOLERANCE, const unsigned int verbosity=0)
Constructor.
bool quiet
The DiffSolver should not print anything to libMesh::out unless quiet is set to false; default is tru...
std::unique_ptr< EquationSystems > _equation_systems
EquationsSystems object associated with the smoother.
virtual void smooth() override
Redefinition of the smooth function from the base class.
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.
This is a generic class that defines a solver to handle ImplicitSystem classes, including NonlinearIm...
std::unique_ptr< DistributedMesh > _mesh_copy
Mesh copy to avoid multiple EquationSystems.
Struct to hold smoother-relevant information about the mesh quality.
void set_verbosity(const unsigned int verbosity)
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.
bool verbose
The DiffSolver may print a lot more to libMesh::out if verbose is set to true; default is false...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
A class representing a solver's failure to converge, to be thrown by "libmesh_convergence_failure();"...
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...
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.
Real _relative_residual_tolerance
Solver relative residual tolerance.
Real _absolute_residual_tolerance
Solver absolute residual tolerance.