14 #include "libmesh/fe.h" 27 "steps", 0,
"The number of adaptive steps to use when doing a Steady simulation.");
29 "interval", 1,
"interval>0",
"The number of time steps betweeen each adaptivity phase");
33 "Maximum number of times a single element can be refined. If 0 then infinite.");
36 "The time that adaptivity will be active after.");
39 "The time after which adaptivity will no longer be active.");
43 "The number of adaptive steps to use when on each timestep during a Transient simulation.");
45 "recompute_markers_during_cycles",
false,
"Recompute markers during adaptivity cycles");
46 params.
addParam<
bool>(
"switch_h_to_p_refinement",
false,
"True to perform p-refinement");
56 params.
addParam<MarkerName>(
"marker",
57 "The name of the Marker to use to actually adapt the mesh.");
59 "initial_steps", 0,
"The number of adaptive steps to do based on the initial condition.");
62 "The name of the Marker to use to adapt the mesh during initial refinement.");
90 rm_params.
set<std::string>(
"for_whom") =
"Adaptivity";
95 if (rm_params.areAllRequiredParamsValid())
98 "ElementSideNeighborLayers",
"adaptivity_algebraic_ghosting", rm_params);
106 mooseError(
"Invalid initialization of ElementSideNeighborLayers");
113 rm_params.
set<std::string>(
"for_whom") =
"Adaptivity";
118 if (rm_params.areAllRequiredParamsValid())
121 "ElementPointNeighborLayers",
"adaptivity_geometric_ghosting", rm_params);
129 mooseError(
"Invalid initialization of ElementPointNeighborLayers");
143 adapt.
setMaxHLevel(getParam<unsigned int>(
"max_h_level"));
145 adapt.
init(getParam<unsigned int>(
"steps"),
146 getParam<unsigned int>(
"initial_steps"),
147 getParam<bool>(
"switch_h_to_p_refinement"));
150 adapt.
setTimeActive(getParam<Real>(
"start_time"), getParam<Real>(
"stop_time"));
151 adapt.
setInterval(getParam<unsigned int>(
"interval"));
static InputParameters validParams()
void setInterval(unsigned int interval)
Set the interval (number of timesteps) between refinement steps.
RelationshipManagerType
Main types of Relationship Managers.
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.
void setRecomputeMarkersFlag(const bool flag)
Set the flag to recompute markers during adaptivity cycles.
Factory & _factory
The Factory associated with the MooseApp.
void setCyclesPerStep(const unsigned int &num)
Set the number of cycles_per_step.
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters ¶meters, THREAD_ID tid=0, bool print_deprecated=true)
void setTimeActive(Real start_time, Real stop_time)
Sets the time when the adaptivity is active.
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
void init(const unsigned int steps, const unsigned int initial_steps, const bool p_refinement)
Initialize and turn on adaptivity for the simulation.
void setMaxHLevel(unsigned int level)
Set the maximum refinement level (for the new Adaptivity system).
void setUseNewSystem()
Tells this object we're using the "new" adaptivity system.
auto max(const L &left, const R &right)
bool addRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
Transfers ownership of a RelationshipManager to the application for lifetime management.
static InputParameters validParams()
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
const std::string & _current_task
The current action (even though we have separate instances for each action)
MooseApp & _app
The MOOSE application this is associated with.
void releaseSharedObjects(const MooseObject &moose_object, THREAD_ID tid=0)
Releases any shared resources created as a side effect of creating an object through the Factory::cre...
std::shared_ptr< MooseMesh > & _mesh
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Takes care of everything related to mesh adaptivity.
RelationshipManagers are used for describing what kinds of non-local resources are needed for an obje...
registerMooseAction("MooseApp", SetAdaptivityOptionsAction, "set_adaptivity_options")
InputParameters commonAdaptivityParams()
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
SetAdaptivityOptionsAction(const InputParameters ¶ms)
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
void setMarkerVariableName(std::string marker_field)
Sets the name of the field variable to actually use to flag elements for refinement / coarsening...
void setInitialMarkerVariableName(std::string marker_field)
Sets the name of the field variable to actually use to flag elements for initial refinement / coarsen...