10 #ifdef MOOSE_MFEM_ENABLED 59 const std::string &
name,
63 const std::string &
name,
67 const std::string &
name,
93 const std::string &
name,
99 virtual void addVariable(
const std::string & var_type,
100 const std::string & var_name,
107 const std::string & var_name,
116 const std::string & var_name,
132 void addKernel(
const std::string & kernel_name,
133 const std::string &
name,
140 const std::string &
name,
147 const std::string &
name,
154 const std::string &
name,
161 const std::string &
name,
168 const std::string &
name,
176 const std::string &
name,
183 const std::string &
name,
192 const std::string &
name,
199 const std::string &
name,
206 const std::string &
name,
213 const std::string &
name,
221 const std::string &
name,
227 virtual void addMFEMSolver(
const std::string & user_object_name,
228 const std::string &
name,
236 mfem::real_t nl_abs_tol,
237 mfem::real_t nl_rel_tol,
238 unsigned int print_level);
286 " not found in MFEMProblem real or complex gridfunctions.");
302 std::optional<std::reference_wrapper<mfem::ParGridFunction const>>
362 template <
typename T>
364 const std::string &
name,
384 template <
typename T>
387 const std::string & name,
390 std::vector<T *> objs;
394 .condition<AttribThread>(tid)
398 mooseError(
"Unable to find MFEM object with system '" + system +
"' and name '" +
name +
"'");
399 mooseAssert(objs.size() == 1,
"Shouldn't find more than one object with given system and name");
std::shared_ptr< mfem::ParGridFunction > getGridFunction(const std::string &name)
void addGridFunction(const std::string &var_type, const std::string &var_name, InputParameters ¶meters)
Adds one MFEM GridFunction to be used in the MFEM solve.
void addMarker(const std::string &type, const std::string &name, InputParameters ¶meters) override
Override of FEProblemBase::addMarker.
void addMFEMPreconditioner(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
Method called in AddMFEMPreconditionerAction which will create the solver.
virtual void syncSolutions(Direction) override
Method to transfer data to/from the external application to the associated transfer mesh...
Base problem data struct.
void addRealComponentToBC(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
Adds a real component BC to the parent MFEMComplexIntegratedBC.
Moose::MFEM::ComplexGridFunctions cmplx_gridfunctions
const MFEMProblemData & getProblemData() const
Return the current MFEM problem data in a const context.
MFEMProblemData & getProblemData()
Method to get the current MFEMProblemData object storing the current data specifying the FE problem...
bool Has(const std::string &field_name) const
Predicate to check if a field is registered with name field_name.
void addImagComponentToBC(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
Adds an imaginary component BC to the parent MFEMComplexIntegratedBC.
void addPostprocessor(const std::string &type, const std::string &name, InputParameters ¶meters) override
Override of ExternalProblem::addPostprocessor.
NumericType _num_type
The numeric representation currently active for this problem.
void addFunction(const std::string &type, const std::string &name, InputParameters ¶meters) override
Override of ExternalProblem::addFunction.
T & getMFEMObject(const std::string &system, const std::string &name, const THREAD_ID tid=0) const
Retrieve an MFEM object from the warehouse by system and name.
InputParameters addMFEMFESpaceFromMOOSEVariable(InputParameters &moosevar_params)
Method used to get an mfem FEC depending on the variable family specified in the input file...
static InputParameters validParams()
Return the input parameters used to construct an MFEM problem.
virtual MFEMMesh & mesh() override
Overwritten mesh() method from base MooseMesh to retrieve the correct mesh type, in this case MFEMMes...
const InputParameters & parameters() const
Get the parameters of the object.
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶meters) override
Override of ExternalProblem::addVariable.
void executeMFEMObjects(const ExecFlagType &exec_type)
Execute MFEM executed objects scheduled on the supplied execute flag.
std::string solverTypeString(unsigned int solver_sys_num) override
Return solver type as a human readable string.
Front-end class for creating and storing MFEM coefficients.
void displaceMesh()
Displace the mesh, if mesh displacement is enabled.
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Canonical method for adding an auxiliary variable.
MFEMProblemData _problem_data
Aggregated MFEM-side state for meshes, spaces, variables, coefficients, and solvers.
bool hRefine()
If AMR is enabled, request (and perform if needed) h-refinement.
bool hasMFEMObject(const std::string &system, const std::string &name) const
Determine whether an MFEM object with the supplied system and name exists.
Moose::MFEM::CoefficientManager coefficients
void rebalanceMesh(mfem::ParMesh &pmesh)
Rebalance the (necessarily nonconforming) mesh.
const std::string & name() const
Get the name of the class.
TheWarehouse & theWarehouse() const
std::complex< Real > COMPLEX
T * Get(const std::string &field_name) const
Returns a non-owning pointer to the field. This is guaranteed to return a non-null pointer...
Moose::MFEM::CoefficientManager & getCoefficients()
Method to get the PropertyManager object for storing material properties and converting them to MFEM ...
void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters) override
std::shared_ptr< T > GetShared(const std::string &field_name) const
Returns a shared pointer to the field. This is guaranteed to return a non-null shared pointer...
virtual void initialSetup() override
const std::string & type() const
Get the type of this class.
void setMesh()
Set the mesh used by MFEM.
virtual void addMFEMSolver(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
Method called in AddMFEMSolverAction which will create the solver.
Moose::FEBackend feBackend() const override
void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters) override
Override of ExternalProblem::addAuxKernel.
NumericType
Enumerates the supported numeric representations for MFEM variables and operators.
void addElementalFieldVariable(const std::string &, const std::string &, InputParameters &) override
Override of FEProblemBase::addElementalFieldVariable to be a no-op because we do not use the Marker/I...
std::shared_ptr< MFEMRefinementMarker > refiner
std::shared_ptr< mfem::ParComplexGridFunction > getComplexGridFunction(const std::string &name)
MPI_Comm getComm()
Return the MPI communicator associated with this FE problem's mesh.
virtual ~MFEMProblem()
Destroy the MFEM problem.
MFEMProblem(const InputParameters ¶ms)
Construct an MFEM problem from the supplied parameters.
void addFunctorMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters) override
Class for containing MooseEnum item information.
void addFESpace(const std::string &type, const std::string &name, InputParameters ¶meters)
Add an MFEM FESpace to the problem.
void updateGridFunctions()
Calls Update() on all gridfunctions.
void addIndicator(const std::string &type, const std::string &name, InputParameters ¶meters) override
Override of FEProblemBase::addIndicator.
MFEMMesh inherits a MOOSE mesh class which allows us to work with other MOOSE objects.
virtual std::vector< VariableName > getAuxVariableNames()
Returns all the variable names from the auxiliary system base.
void setDevice()
Set the device to use to solve the FE problem.
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters ¶meters) override
virtual MooseMesh & mesh() override
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...
void updateFESpaces()
Calls Update() on all FE spaces.
void addImagComponentToKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
Adds an imaginary component kernel to the parent MFEMComplexKernel.
virtual void externalSolve() override
New interface for solving an External problem.
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
void addVectorPostprocessor(const std::string &type, const std::string &name, InputParameters ¶meters) override
Add a vector postprocessor and register its vectors with the MFEM execution system.
void addKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters) override
Override of ExternalProblem::addKernel.
NumericType getNumericType() const
Retrieve the numeric type of the problem.
std::optional< std::reference_wrapper< mfem::ParGridFunction const > > getMeshDisplacementGridFunction()
Returns optional reference to the displacement GridFunction to apply to nodes.
const mfem::ParMesh & getMFEMVariableMesh(std::string var_name)
Return the ParMesh associated with a particular variable.
Moose::MFEM::GridFunctions gridfunctions
void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶meters) override
Override of ExternalProblem::addAuxVariable.
bool pRefine()
If AMR is enabled, request (and perform if needed) p-refinement.
void addRealComponentToKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
Adds a real component kernel to the parent MFEMComplexKernel.
void addSubMesh(const std::string &type, const std::string &name, InputParameters ¶meters)
Add an MFEM SubMesh to the problem.
virtual void execute(const ExecFlagType &exec_type) override
Convenience function for performing execution of MOOSE systems.
void addMFEMNonlinearSolver(unsigned int nl_max_its, mfem::real_t nl_abs_tol, mfem::real_t nl_rel_tol, unsigned int print_level)
Add the nonlinear solver to the system.
void addTransfer(const std::string &transfer_name, const std::string &name, InputParameters ¶meters) override
Add transfers between MultiApps and/or MFEM SubMeshes.
void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters ¶meters) override
Add an MFEM initial condition to the problem.