10 #ifdef MOOSE_MFEM_ENABLED 22 #include "libmesh/mesh_generation.h" 33 "Number of serial refinements to perform on the mesh. Equivalent to uniform_refine.");
37 "Number of serial refinements to perform on the mesh. Equivalent to serial_refine");
39 "parallel_refine", 0,
"Number of parallel refinements to perform on the mesh.");
40 params.
addParam<std::string>(
"displacement",
"Optional variable to use for mesh displacement.");
54 TIME_SECTION(
"buildMesh", 2,
"Reading Mesh");
64 "Cannot define serial_refine and uniform_refine to be nonzero at the same time (they " 65 "are the same variable). Please choose one.\n");
69 : getParam<unsigned int>(
"uniform_refine"));
90 *nodes += displacement;
96 MeshTools::Generation::build_point(static_cast<UnstructuredMesh &>(
getMesh()));
102 for (
unsigned int i = 0; i < nref; ++i)
103 mesh.UniformRefinement();
106 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.