https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMScalarQuadratureFunction.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
14
16
19{
22 "Declares a scalar MFEM coefficient holding precomputed values of a source coefficient at "
23 "quadrature points. Values are (re)projected lazily when the coefficient is used.");
24 params.addRequiredParam<MFEMScalarCoefficientName>(
25 "coefficient", "Scalar coefficient to project onto the quadrature points.");
26 return params;
27}
28
35
36void
38{
39 auto & coeff = cast_ref<MFEMScalarQuadratureFunctionCoefficient &>(
41 coeff.SetSourceCoefficient(&_mfem_problem.getCoefficients().getScalarCoefficient(
42 getParam<MFEMScalarCoefficientName>("coefficient")));
43}
44
45#endif
registerMooseObject("MooseApp", MFEMScalarQuadratureFunction)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Moose::MFEM::CoefficientManager & getCoefficients()
Method to get the PropertyManager object for storing material properties and converting them to MFEM ...
Base class for MOOSE objects declaring an MFEM coefficient backed by precomputed values of a source c...
MFEMProblem & _mfem_problem
reference to the MFEMProblem instance
static InputParameters validParams()
MFEMQuadratureFunctionCoefficientBase::UpdatePolicy updatePolicy() const
Return the update policy selected by the 'updates' input parameter, to hand to the coefficient (which...
Scalar coefficient holding precomputed values of a source coefficient at the quadrature points of a Q...
Declares a scalar MFEM coefficient represented as a precomputed vector of values of a source coeffici...
void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
MFEMScalarQuadratureFunction(const InputParameters &parameters)
mfem::QuadratureFunction _qf
Storage for the projected values of the source coefficient.
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
mfem::Coefficient & declareScalar(const std::string &name, const std::string &existing_or_literal)
Declare an alias to an existing scalar coefficient or, if it does not exist, try interpreting the nam...
mfem::Coefficient & getScalarCoefficient(const std::string &name)
Return a scalar coefficient with the given name or, if that doesn't exist, try interpreting the name ...