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 "MFEMVectorQuadratureFunction.h" 13 : #include "MFEMVectorQuadratureFunctionCoefficient.h" 14 : #include "MFEMProblem.h" 15 : 16 : registerMooseObject("MooseApp", MFEMVectorQuadratureFunction); 17 : 18 : InputParameters 19 2152 : MFEMVectorQuadratureFunction::validParams() 20 : { 21 2152 : InputParameters params = MFEMQuadratureFunctionBase::validParams(); 22 4304 : params.addClassDescription( 23 : "Declares a vector MFEM coefficient holding precomputed values of a source vector " 24 : "coefficient at quadrature points. Values are (re)projected lazily when the coefficient " 25 : "is used."); 26 6456 : params.addRequiredParam<MFEMVectorCoefficientName>( 27 : "vector_coefficient", "Vector coefficient to project onto the quadrature points."); 28 2152 : return params; 29 0 : } 30 : 31 13 : MFEMVectorQuadratureFunction::MFEMVectorQuadratureFunction(const InputParameters & parameters) 32 13 : : MFEMQuadratureFunctionBase(parameters), _qf(&_qspace) 33 : { 34 26 : mfem::VectorCoefficient & source = getVectorCoefficient("vector_coefficient"); 35 13 : _qf.SetVDim(source.GetVDim()); 36 13 : _qf = 0.0; 37 26 : getMFEMProblem().getCoefficients().declareVector<MFEMVectorQuadratureFunctionCoefficient>( 38 13 : name(), source, _qf, updatePolicy(), name()); 39 13 : } 40 : 41 : #endif