Go to the documentation of this file.
12 #include "libmesh/libmesh_config.h"
14 #ifdef LIBMESH_ENABLE_AMR
22 #include "libmesh/parallel_object.h"
25 #include "libmesh/mesh_refinement.h"
50 public libMesh::ParallelObject
62 void init(
unsigned int steps,
unsigned int initial_steps);
71 void setParam(
const std::string & param_name,
const T & param_value);
136 bool adaptMesh(std::string marker_name = std::string());
235 ErrorVector &
getErrorVector(
const std::string & indicator_field);
313 template <
typename T>
317 if (param_name ==
"refine fraction")
323 else if (param_name ==
"coarsen fraction")
329 else if (param_name ==
"max h-level")
335 else if (param_name ==
"cycles_per_step")
337 else if (param_name ==
"recompute_markers_during_cycles")
340 mooseError(
"Invalid Param in adaptivity object");
342 #endif // LIBMESH_ENABLE_AMR
unsigned int _initial_steps
the number of adaptivity steps to do at the beginning of simulation
static void uniformRefine(MooseMesh *mesh, unsigned int level=libMesh::invalid_uint)
Performs uniform refinement of the passed Mesh object.
An inteface for the _console for outputting to the Console object.
bool initialAdaptMesh()
Used during initial adaptivity.
std::string _marker_variable_name
Name of the marker variable if using the new adaptivity system.
void updateErrorVectors()
Update the ErrorVectors that have been requested through calls to getErrorVector().
bool _recompute_markers_during_cycles
Whether or not to recompute markers during adaptivity cycles.
unsigned int _cycles_per_step
The number of adaptivity cycles per step.
void setInterval(unsigned int interval)
Set the interval (number of timesteps) between refinement steps.
std::unique_ptr< MeshRefinement > _displaced_mesh_refinement
A mesh refinement object for displaced mesh.
void setMaxHLevel(unsigned int level)
Set the maximum refinement level (for the new Adaptivity system).
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
void init(unsigned int steps, unsigned int initial_steps)
Initialize and turn on adaptivity for the simulation.
Takes care of everything related to mesh adaptivity.
void uniformRefineWithProjection()
Performs uniform refinement on the meshes in the current object.
void setRecomputeMarkersFlag(const bool flag)
Set the flag to recompute markers during adaptivity cycles.
void setAdaptivityOn(bool state)
Allow adaptivity to be toggled programatically.
std::unique_ptr< ErrorVector > _error
Error vector for use with the error estimator.
void setCyclesPerStep(const unsigned int &num)
Set the number of cycles_per_step.
PerfID _adapt_mesh_timer
Timers.
bool isInitialized()
Returns whether or not Adaptivity::init() has ran.
bool adaptMesh(std::string marker_name=std::string())
Adapts the mesh based on the error estimator used.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
void setPrintMeshChanged(bool state=true)
PerfID _uniform_refine_timer
bool isOn()
Is adaptivity on?
bool _initialized
on/off flag reporting if the adaptivity system has been initialized
std::map< std::string, std::unique_ptr< ErrorVector > > _indicator_field_to_error_vector
Stores pointers to ErrorVectors associated with indicator field names.
std::unique_ptr< MeshRefinement > _mesh_refinement
A mesh refinement object to be used either with initial refinement or with Adaptivity.
void setTimeActive(Real start_time, Real stop_time)
Sets the time when the adaptivity is active.
FEProblemBase & _subproblem
PerfID _update_error_vectors
unsigned int _max_h_level
The maximum number of refinement levels.
void setUseNewSystem()
Tells this object we're using the "new" adaptivity system.
bool _print_mesh_changed
True if we want to print out info when mesh has changed.
std::string _initial_marker_variable_name
Name of the initial marker variable if using the new adaptivity system.
MooseVariableFE< VectorValue< Real > > VectorMooseVariable
void setInitialMarkerVariableName(std::string marker_field)
Sets the name of the field variable to actually use to flag elements for initial refinement / coarsen...
unsigned int getInitialSteps() const
Pull out the number of initial steps previously set by calling init()
void setErrorEstimator(const MooseEnum &error_estimator_name)
Set the error estimator.
unsigned int _steps
steps of adaptivity to perform
unsigned int getSteps() const
Pull out the number of steps previously set by calling init()
std::unique_ptr< ErrorEstimator > _error_estimator
Error estimator to be used by the apps.
MooseVariableFE< Real > MooseVariable
unsigned int getMaxHLevel()
Return the maximum h-level.
bool _mesh_refinement_on
on/off flag reporting if the adaptivity is being used
Interface for objects that needs transient capabilities.
Real _stop_time
When adaptivity stops.
PerfID _uniform_refine_with_projection
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
bool _use_new_system
Whether or not to use the "new" adaptivity system.
bool isAdaptivityDue()
Query if an adaptivity step should be performed at the current time / time step.
bool getRecomputeMarkersFlag() const
Pull out the _recompute_markers_during_cycles flag previously set through the AdaptivityAction.
ErrorVector & getErrorVector(const std::string &indicator_field)
Get an ErrorVector that will be filled up with values corresponding to the indicator field name passe...
void setMarkerVariableName(std::string marker_field)
Sets the name of the field variable to actually use to flag elements for refinement / coarsening.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
std::shared_ptr< DisplacedProblem > _displaced_problem
Real _start_time
When adaptivity start.
void setErrorNorm(SystemNorm &sys_norm)
Set the error norm (FIXME: improve description)
unsigned int getCyclesPerStep() const
Pull out the number of cycles_per_step previously set through the AdaptivityAction.
Adaptivity(FEProblemBase &subproblem)
void setParam(const std::string ¶m_name, const T ¶m_value)
Set adaptivity parameter.
Class for stuff related to variables.
unsigned int _interval
intreval between adaptivity runs