https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMWeakFormProblemComposerBase.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#ifdef MOOSE_MFEM_ENABLED
11
13#include "MFEMProblem.h"
14
17{
19 params.addParam<MFEMWeakFormName>(
20 "weak_form",
21 "",
22 "Name of the weak form in the WeakForms block whose equation system this operator solves. "
23 "May be omitted only if the problem has a single weak form, whose equation system is then "
24 "used.");
25 return params;
26}
27
29 : MFEMProblemComposer(parameters), _weak_form_name(getParam<MFEMWeakFormName>("weak_form"))
30{
31 if (!_weak_form_name.empty() &&
32 !getMFEMProblem().getProblemData().eqn_systems.Has(_weak_form_name))
33 paramError("weak_form",
34 "No weak form named '",
36 "' has been added to the problem. Weak forms are added in the 'WeakForms' block.");
37}
38
39#endif
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
Definition MFEMObject.h:45
Interface required for all MFEMProblemComposers.
static InputParameters validParams()
const MFEMWeakFormName _weak_form_name
Name of the weak form whose EquationSystem the created operator solves.
MFEMWeakFormProblemComposerBase(const InputParameters &parameters)
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition MooseBase.h:457