15 #include "libmesh/fe.h" 28 "steps", 0,
"The number of adaptive steps to use when doing a Steady simulation.");
30 "interval", 1,
"interval>0",
"The number of time steps betweeen each adaptivity phase");
34 "Maximum number of times a single element can be refined. If 0 then infinite.");
37 "The time that adaptivity will be active after.");
40 "The time after which adaptivity will no longer be active.");
44 "The number of adaptive steps to use when on each timestep during a Transient simulation.");
46 "recompute_markers_during_cycles",
false,
"Recompute markers during adaptivity cycles");
47 params.
addParam<
bool>(
"switch_h_to_p_refinement",
false,
"True to perform p-refinement");
49 MultiMooseEnum disable_p_refinement_for_families(families_enum.getRawNames());
51 disable_p_refinement_for_families,
52 "What families we should disable p-refinement for.");
62 params.
addParam<MarkerName>(
"marker",
63 "The name of the Marker to use to actually adapt the mesh.");
65 "initial_steps", 0,
"The number of adaptive steps to do based on the initial condition.");
68 "The name of the Marker to use to adapt the mesh during initial refinement.");
96 rm_params.
set<std::string>(
"for_whom") =
"Adaptivity";
101 if (rm_params.areAllRequiredParamsValid())
104 "ElementSideNeighborLayers",
"adaptivity_algebraic_ghosting", rm_params);
112 mooseError(
"Invalid initialization of ElementSideNeighborLayers");
119 rm_params.
set<std::string>(
"for_whom") =
"Adaptivity";
124 if (rm_params.areAllRequiredParamsValid())
127 "ElementPointNeighborLayers",
"adaptivity_geometric_ghosting", rm_params);
135 mooseError(
"Invalid initialization of ElementPointNeighborLayers");
149 adapt.
setMaxHLevel(getParam<unsigned int>(
"max_h_level"));
151 adapt.
init(getParam<unsigned int>(
"steps"), getParam<unsigned int>(
"initial_steps"));
154 adapt.
setTimeActive(getParam<Real>(
"start_time"), getParam<Real>(
"stop_time"));
155 adapt.
setInterval(getParam<unsigned int>(
"interval"));
158 if (getParam<bool>(
"switch_h_to_p_refinement"))
160 auto disable_p_refinement_for_families =
161 getParam<MultiMooseEnum>(
"disable_p_refinement_for_families");
164 disable_p_refinement_for_families =
165 "LAGRANGE NEDELEC_ONE RAVIART_THOMAS LAGRANGE_VEC CLOUGH BERNSTEIN RATIONAL_BERNSTEIN";
static InputParameters validParams()
void doingPRefinement(bool doing_p_refinement, const MultiMooseEnum &disable_p_refinement_for_families)
Indicate whether the kind of adaptivity we're doing is p-refinement.
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.
void setCyclesPerStep(const unsigned int &num)
Set the number of cycles_per_step.
void init(unsigned int steps, unsigned int initial_steps)
Initialize and turn on adaptivity for the simulation.
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 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.
static MooseEnum getNonlinearVariableFamilies()
Get the possible variable families.
auto max(const L &left, const R &right)
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Factory & _factory
The Factory associated with the MooseApp.
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...
bool isParamSetByUser(const std::string &nm) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.
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.
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
SetAdaptivityOptionsAction(const InputParameters ¶ms)
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
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...