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 "MFEMScalarDirichletBC.h" 13 : 14 : registerMooseObject("MooseApp", MFEMScalarDirichletBC); 15 : 16 : InputParameters 17 9118 : MFEMScalarDirichletBC::validParams() 18 : { 19 9118 : InputParameters params = MFEMEssentialBC::validParams(); 20 9118 : params.addClassDescription("Applies a Dirichlet condition to a scalar variable."); 21 9118 : params.addParam<MFEMScalarCoefficientName>( 22 : "coefficient", "0.", "The coefficient setting the values on the essential boundary"); 23 9118 : return params; 24 0 : } 25 : 26 244 : MFEMScalarDirichletBC::MFEMScalarDirichletBC(const InputParameters & parameters) 27 244 : : MFEMEssentialBC(parameters), _coef(getScalarCoefficient("coefficient")) 28 : { 29 244 : } 30 : 31 : void 32 500 : MFEMScalarDirichletBC::ApplyBC(mfem::GridFunction & gridfunc) 33 : { 34 500 : gridfunc.ProjectBdrCoefficient(_coef, getBoundaryMarkers()); 35 500 : } 36 : 37 : #endif