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 "MFEMVectorMagnitudeCoefficient.h" 13 : 14 3817 : MFEMVectorMagnitudeCoefficient::MFEMVectorMagnitudeCoefficient(mfem::VectorCoefficient & vec_coef) 15 3817 : : mfem::Coefficient(), _vec_coef(&vec_coef) 16 : { 17 3817 : } 18 : 19 : void 20 2462 : MFEMVectorMagnitudeCoefficient::SetTime(mfem::real_t t) 21 : { 22 2462 : _vec_coef->SetTime(t); 23 2462 : this->mfem::Coefficient::SetTime(t); 24 2462 : } 25 : 26 : mfem::real_t 27 84672 : MFEMVectorMagnitudeCoefficient::Eval(mfem::ElementTransformation & T, 28 : const mfem::IntegrationPoint & ip) 29 : { 30 84672 : _vec_coef->Eval(_vec, T, ip); 31 84672 : return _vec.Norml2(); 32 : } 33 : 34 : #endif