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 double relative_residual_tolerance,
55 const double absolute_residual_tolerance,
56 const bool solver_quiet,
57 const bool solver_verbose)
59 _dilation_weight(dilation_weight),
60 _preserve_subdomain_boundaries(preserve_subdomain_boundaries),
62 _relative_residual_tolerance(relative_residual_tolerance),
63 _absolute_residual_tolerance(absolute_residual_tolerance),
64 _solver_quiet(solver_quiet),
65 _solver_verbose(solver_verbose)
72 libmesh_not_implemented_msg(
"Meshes containing elements of differing dimension are not yet supported.");
148 for (
auto * node_copy :
_mesh_copy->local_node_ptr_range())
152 node(d) = (*node_copy)(d);
168 libmesh_error_msg_if(!
_setup_called,
"Need to first call the setup() method of " 169 <<
"this VariationalMeshSmoother object, then call get_mesh_info() prior " 170 <<
"to calling smooth().");
176 #endif // defined(LIBMESH_ENABLE_VSMOOTHER)
virtual void solve() override
Solves the system to smooth the mesh.
const Real _dilation_weight
Smoother control variables.
bool _solver_verbose
Solver verbose setting.
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.
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.
double _absolute_residual_tolerance
Solver absolute residual tolerance.
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.
VariationalMeshSmoother(UnstructuredMesh &mesh, Real dilation_weight=0.5, const bool preserve_subdomain_boundaries=true, const double relative_residual_tolerance=TOLERANCE *TOLERANCE, const double absolute_residual_tolerance=TOLERANCE *TOLERANCE, const bool solver_quiet=true, const bool solver_verbose=false)
Constructor.
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 _solver_quiet
Solver quiet setting.
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
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
double _relative_residual_tolerance
Solver relative residual tolerance.
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.