21 "delete_remote_elements_after_late_geometric_ghosting");
33 params.
addClassDescription(
"Perform operations on the mesh in preparation for a simulation.");
35 params.
addParam<std::vector<std::string>>(
37 "The variables corresponding to the x y z displacements of the mesh. If "
38 "this is provided then the displacements will be taken into account during "
39 "the computation. Creation of the displaced mesh can be suppressed even if "
40 "this is set by setting 'use_displaced_mesh = false'.");
44 "Create the displaced mesh if the 'displacements' "
45 "parameter is set. If this is 'false', a displaced mesh will not be created, "
46 "regardless of whether 'displacements' is set.");
57 mooseError(
"No mesh file was supplied and no generation block was provided");
69 if (
_mesh->isSplit() &&
_mesh->skipRefineWhenUseSplit())
86 TIME_SECTION(
"uniformRefine", 2,
"Uniformly Refining");
88 if (
_mesh->uniformRefineLevel())
90 if (!
_mesh->interiorLowerDBlocks().empty() || !
_mesh->boundaryLowerDBlocks().empty())
91 mooseError(
"HFEM does not support mesh uniform refinement currently.");
101 else if (
_current_task ==
"delete_remote_elements_after_late_geometric_ghosting")
103 TIME_SECTION(
"deleteRemoteElems", 2,
"Deleting Remote Elements");
107 mooseError(
"Our reference and displaced meshes are not in sync with respect to whether we "
108 "should delete remote elements.");
112 if (
_mesh->needsRemoteElemDeletion())
117 _mesh->deleteRemoteElements();
138 else if (
isParamValid(
"displacements") && getParam<bool>(
"use_displaced_mesh"))
140 TIME_SECTION(
"constructDisplacedMesh", 2,
"Constructing Displaced Mesh");
142 mooseAssert(
_mesh->prepared(),
"The reference mesh should already be fully prepared here");
146 const auto & displacements = getParam<std::vector<std::string>>(
"displacements");
147 if (displacements.size() <
_mesh->dimension())
148 mooseError(
"Number of displacements must be greater than or equal to the dimension of "
154 TIME_SECTION(
"completeSetupUndisplaced", 2,
"Setting Up Undisplaced Mesh");
registerMooseAction("MooseApp", SetupMeshCompleteAction, "prepare_mesh")
std::shared_ptr< MooseMesh > & _mesh
static InputParameters validParams()
MooseApp & _app
The MOOSE application this is associated with.
std::shared_ptr< MooseMesh > & _displaced_mesh
std::shared_ptr< FEProblemBase > & _problem
Convenience reference to a problem this action works on.
const std::string & _current_task
The current action (even though we have separate instances for each action)
static void uniformRefine(MooseMesh *mesh, unsigned int level=libMesh::invalid_uint)
Performs uniform refinement of the passed Mesh object.
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
bool getExodusFileRestart() const
Whether or not we need to use a separate Exodus reader to read the mesh BEFORE we create the mesh.
bool isRecovering() const
Whether or not this is a "recover" calculation.
const MooseMesh * masterDisplacedMesh() const
Returns a pointer to the master displaced mesh.
bool useMasterMesh() const
Returns whether to use the parent app mesh as the mesh for this app.
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...
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
virtual std::unique_ptr< MooseMesh > safeClone() const =0
A safer version of the clone() method that hands back an allocated object wrapped in a smart pointer.
static InputParameters validParams()
SetupMeshCompleteAction(const InputParameters ¶ms)
virtual void act() override
Method to add objects to the simulation or perform other setup tasks.