https://mooseframework.inl.gov
MFEMVectorMagnitudeCoefficient.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 
13 
15  : mfem::Coefficient(), _vec_coef(&vec_coef)
16 {
17 }
18 
19 void
21 {
22  _vec_coef->SetTime(t);
23  this->mfem::Coefficient::SetTime(t);
24 }
25 
26 mfem::real_t
27 MFEMVectorMagnitudeCoefficient::Eval(mfem::ElementTransformation & T,
28  const mfem::IntegrationPoint & ip)
29 {
30  _vec_coef->Eval(_vec, T, ip);
31  return _vec.Norml2();
32 }
33 
34 #endif
mfem::real_t Eval(mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) override
Evaluate the vector coefficient magnitude at ip.
void SetTime(mfem::real_t t) override
Set the time for internally stored coefficients.
MFEMVectorMagnitudeCoefficient(mfem::VectorCoefficient &vec_coef)