Line data Source code
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 : 12 : #include "MFEMScalarQuadratureFunction.h" 13 : #include "MFEMScalarQuadratureFunctionCoefficient.h" 14 : #include "MFEMProblem.h" 15 : 16 : registerMooseObject("MooseApp", MFEMScalarQuadratureFunction); 17 : 18 : InputParameters 19 2168 : MFEMScalarQuadratureFunction::validParams() 20 : { 21 2168 : InputParameters params = MFEMQuadratureFunctionBase::validParams(); 22 4336 : params.addClassDescription( 23 : "Declares a scalar MFEM coefficient holding precomputed values of a source coefficient at " 24 : "quadrature points. Values are (re)projected lazily when the coefficient is used."); 25 6504 : params.addRequiredParam<MFEMScalarCoefficientName>( 26 : "coefficient", "Scalar coefficient to project onto the quadrature points."); 27 2168 : return params; 28 0 : } 29 : 30 21 : MFEMScalarQuadratureFunction::MFEMScalarQuadratureFunction(const InputParameters & parameters) 31 21 : : MFEMQuadratureFunctionBase(parameters), _qf(&_qspace) 32 : { 33 : // Zero-initialize the storage; real values are projected lazily on first use. 34 21 : _qf = 0.0; 35 42 : getMFEMProblem().getCoefficients().declareScalar<MFEMScalarQuadratureFunctionCoefficient>( 36 21 : name(), getScalarCoefficient("coefficient"), _qf, updatePolicy(), name()); 37 21 : } 38 : 39 : #endif