10 #ifdef MOOSE_MFEM_ENABLED 13 #include "libmesh/mesh_generation.h" 24 "Number of serial refinements to perform on the mesh. Equivalent to uniform_refine.");
28 "Number of serial refinements to perform on the mesh. Equivalent to serial_refine");
30 "parallel_refine", 0,
"Number of parallel refinements to perform on the mesh.");
31 params.
addParam<std::string>(
"displacement",
"Optional variable to use for mesh displacement.");
45 TIME_SECTION(
"buildMesh", 2,
"Reading Mesh");
55 "Cannot define serial_refine and uniform_refine to be nonzero at the same time (they " 56 "are the same variable). Please choose one.\n");
60 : getParam<unsigned int>(
"uniform_refine"));
81 *nodes += displacement;
87 MeshTools::Generation::build_point(static_cast<UnstructuredMesh &>(
getMesh()));
93 for (
unsigned int i = 0; i < nref; ++i)
94 mesh.UniformRefinement();
97 std::unique_ptr<MooseMesh>
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
void uniformRefinement(mfem::Mesh &mesh, const unsigned int nref) const
Performs a uniform refinement on the chosen mesh nref times.
std::optional< std::string > _mesh_displacement_variable
Holds name of variable used for mesh displacement, if set.
const Parallel::Communicator & comm() const
std::unique_ptr< T > copyConstruct(const T &object)
Copy constructs the object object.
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
static InputParameters validParams()
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
void buildDummyMooseMesh()
Builds a placeholder mesh when no MOOSE mesh is required.
void buildMesh() override
Build MFEM ParMesh and a placeholder MOOSE mesh.
std::unique_ptr< MooseMesh > safeClone() const override
Clones the mesh.
MooseApp & _app
The MOOSE application this is associated with.
registerMooseObject("MooseApp", MFEMMesh)
MFEMMesh(const InputParameters ¶meters)
std::shared_ptr< mfem::ParMesh > _mfem_par_mesh
Smart pointers to mfem::ParMesh object.
void displace(mfem::GridFunction const &displacement)
Displace the nodes of the mesh by the given displacement.
MFEMMesh inherits a MOOSE mesh class which allows us to work with other MOOSE objects.
static InputParameters validParams()
virtual std::string getFileName() const override
Returns the name of the mesh file read to produce this mesh if any or an empty string otherwise...
bool isParamSetByUser(const std::string &name) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.