10#ifdef MOOSE_MFEM_ENABLED
69 std::vector<std::shared_ptr<T>>
76 const std::string &
name,
80 const std::string &
name,
84 const std::string &
name,
96 const std::string &
name,
112 void addTransfer(
const std::string & transfer_name,
113 const std::string &
name,
119 virtual void addVariable(
const std::string & var_type,
120 const std::string & var_name,
127 const std::string & var_name,
136 const std::string & var_name,
152 void addKernel(
const std::string & kernel_name,
153 const std::string &
name,
160 const std::string &
name,
167 const std::string &
name,
174 const std::string &
name,
181 const std::string &
name,
187 void addWeakForm(
const std::string & weak_form_name,
188 const std::string &
name,
206 std::shared_ptr<Moose::MFEM::EquationSystem>
213 const std::string &
name,
235 const std::string &
name,
243 const std::string &
name,
250 const std::string &
name,
259 const std::string &
name,
266 const std::string &
name,
274 const std::string &
name,
282 const std::string &
name,
289 virtual void addMFEMSolver(
const std::string & user_object_name,
290 const std::string &
name,
344 " not found in MFEMProblem real or complex gridfunctions.");
419 template <
typename T>
421 const std::string &
name,
446 const std::string & var_name)
const;
496 const std::string & name,
499 std::vector<T *> objs;
503 .condition<AttribThread>(tid)
507 mooseError(
"Unable to find MFEM object with system '" + system +
"' and name '" +
name +
"'");
508 mooseAssert(objs.size() == 1,
"Shouldn't find more than one object with given system and name");
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
virtual MooseMesh & mesh() override
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Canonical method for adding an auxiliary variable.
TheWarehouse & theWarehouse() const
Abstract MooseMesh base for all MFEM-backed mesh types (MFEMFileMesh, MFEMMeshGeneratorMesh).
virtual std::vector< VariableName > getAuxVariableNames()
Returns all the variable names from the auxiliary system base.
std::shared_ptr< MFEMProblemComposer > _problem_composer
The problem operator builders for this mfem problem.
void addPostprocessor(const std::string &type, const std::string &name, InputParameters ¶meters) override
Override of ExternalProblem::addPostprocessor.
virtual MFEMMesh & mesh() override
Overwritten mesh() method from base MooseMesh to retrieve the correct mesh type, in this case MFEMMes...
void addWeakForm(const std::string &weak_form_name, const std::string &name, InputParameters ¶meters)
Add an MFEM WeakForm to the problem.
bool hRefine()
If AMR is enabled, request (and perform if needed) h-refinement.
NumericType
Enumerates the supported numeric representations for MFEM variables and operators.
const MFEMProblemData & getProblemData() const
Return the current MFEM problem data in a const context.
void addFESpace(const std::string &type, const std::string &name, InputParameters ¶meters)
Add an MFEM FESpace to the problem.
void addMarker(const std::string &type, const std::string &name, InputParameters ¶meters) override
Override of FEProblemBase::addMarker.
virtual void syncSolutions(Direction) override
Method to transfer data to/from the external application to the associated transfer mesh.
void addFESpaceHierarchy(const std::string &type, const std::string &name, InputParameters ¶meters)
Add an MFEMFESpaceHierarchy to the problem.
std::shared_ptr< mfem::ParComplexGridFunction > getComplexGridFunction(const std::string &name)
void setProblemOperators()
Set all MFEM ProblemOperators to solve in this problem.
virtual void addMFEMSolver(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
Method called in AddMFEMSolverAction which records a solver for later dependency-ordered construction...
Moose::MFEM::CoefficientManager & getCoefficients()
Method to get the PropertyManager object for storing material properties and converting them to MFEM ...
std::vector< std::shared_ptr< T > > addObject(const std::string &type, const std::string &name, InputParameters ¶meters)
std::string solverTypeString(unsigned int solver_sys_num) override
Return solver type as a human readable string.
std::vector< std::shared_ptr< Moose::MFEM::ProblemOperatorBase > > _problem_operators
Vector of MFEM problem operators executed in this problem.
bool hasMFEMObject(const std::string &system, const std::string &name) const
Determine whether an MFEM object with the supplied system and name exists.
std::shared_ptr< mfem::ParGridFunction > getGridFunction(const std::string &name)
std::vector< std::shared_ptr< Moose::MFEM::ProblemOperatorBase > > & getProblemOperators()
Get vector of all ProblemOperators added to this problem.
MFEMProblemData & getProblemData()
Method to get the current MFEMProblemData object storing the current data specifying the FE problem.
virtual void externalSolve() override
New interface for solving an External problem.
mfem::AssemblyLevel assemblyLevel() const
Return the default assembly level to use for EquationSystem assembly.
mfem::AssemblyLevel _assembly_level
Default assembly level to use for EquationSystem assembly.
void updateFESpaces()
Calls Update() on all FE spaces.
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...
void addIndicator(const std::string &type, const std::string &name, InputParameters ¶meters) override
Override of FEProblemBase::addIndicator.
void setEquationSystems()
Set all MFEM EquationSystems for this problem.
bool pRefine()
If AMR is enabled, request (and perform if needed) p-refinement.
Moose::MFEM::SolutionState & _solution_state_data
Restartable MFEM solution state associated with this problem.
const mfem::ParMesh & getMFEMVariableMesh(std::string var_name)
Return the ParMesh associated with a particular variable.
void rebalanceMesh(mfem::ParMesh &pmesh)
Rebalance the (necessarily nonconforming) mesh.
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 addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters) override
Override of ExternalProblem::addAuxKernel.
void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters) override
void addProblemComposer(const std::string &composer_type, const std::string &name, InputParameters ¶meters)
Method called in AddMFEMProblemComposerAction which will create the problem composer.
void addSubMesh(const std::string &type, const std::string &name, InputParameters ¶meters)
Add an MFEM SubMesh to the problem.
void validateVariableNumericType(const std::string &var_type, const std::string &var_name) const
Verify that a primary variable's numeric type matches the problem's equation system.
void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters ¶meters) override
Add an MFEM initial condition to the problem.
static InputParameters validParams()
Return the input parameters used to construct an MFEM problem.
void setMesh()
Set the mesh used by MFEM.
void setAssemblyLevel(mfem::AssemblyLevel assembly_level)
Set the default assembly level to use for EquationSystem assembly.
void addKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters) override
Override of ExternalProblem::addKernel.
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.
virtual std::shared_ptr< MFEMWeakFormBase > addDefaultWeakForm()
Add default weak form if none has been added by the user.
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶meters) override
Override of ExternalProblem::addVariable.
NumericType getNumericType() const
Retrieve the numeric type of the problem.
void updateGridFunctions()
Calls Update() on all gridfunctions.
void addRealComponentToKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
Adds a real component kernel to the parent MFEMComplexKernel.
MFEMProblemData _problem_data
Aggregated MFEM-side state for meshes, spaces, variables, coefficients, and solvers.
void addRealComponentToBC(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
Adds a real component BC to the parent MFEMComplexIntegratedBC.
virtual ~MFEMProblem()
Destroy the MFEM problem.
void addFunction(const std::string &type, const std::string &name, InputParameters ¶meters) override
Override of ExternalProblem::addFunction.
std::shared_ptr< Moose::MFEM::EquationSystem > getEquationSystem(const std::string &weak_form_name="") const
Return the EquationSystem built by the weak form named weak_form_name.
InputParameters addMFEMFESpaceFromMOOSEVariable(InputParameters &moosevar_params)
Method used to get an mfem FEC depending on the variable family specified in the input file.
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 addTransfer(const std::string &transfer_name, const std::string &name, InputParameters ¶meters) override
Add transfers between MultiApps and/or MFEM SubMeshes.
void displaceMesh()
Displace the mesh, if mesh displacement is enabled.
void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters ¶meters) override
virtual void execute(const ExecFlagType &exec_type) override
Convenience function for performing execution of MOOSE systems.
NumericType _num_type
The numeric representation currently active for this problem.
Moose::FEBackend feBackend() const override
const mfem::ParGridFunction & getMeshDisplacementGridFunction()
Returns reference to the displacement GridFunction to apply to nodes.
void addImagComponentToBC(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
Adds an imaginary component BC to the parent MFEMComplexIntegratedBC.
virtual std::shared_ptr< MFEMProblemComposer > addDefaultProblemComposer()
Add default problem composer if none has been added by the user.
void executeMFEMObjects(const ExecFlagType &exec_type)
Execute MFEM executed objects scheduled on the supplied execute flag.
std::map< std::string, MFEMSolverDefinition > _mfem_solver_definitions
Solver definitions recorded by AddMFEMSolverAction before the dependency resolver constructs them.
void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶meters) override
Override of ExternalProblem::addAuxVariable.
virtual void resolveMFEMSolvers()
Construct recorded MFEM solvers in dependency order and select the problem driver solver(s).
void addFunctorMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters) override
void addImagComponentToKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
Adds an imaginary component kernel to the parent MFEMComplexKernel.
MPI_Comm getComm()
Return the MPI communicator associated with this FE problem's mesh.
virtual void initialSetup() override
const InputParameters & parameters() const
Get the parameters of the object.
const std::string & type() const
Get the type of this class.
const std::string & name() const
Get the name of the class.
Class for containing MooseEnum item information.
Front-end class for creating and storing MFEM coefficients.
bool Has(const std::string &field_name) const
Predicate to check if a field is registered with name field_name.
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.
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.
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
Base problem data struct.
Moose::MFEM::CoefficientManager coefficients
Moose::MFEM::ComplexGridFunctions cmplx_gridfunctions
std::shared_ptr< MFEMRefinementMarker > refiner
Moose::MFEM::GridFunctions gridfunctions
InputParameters * parameters