https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMVectorMagnitudeCoefficient.h
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
12#pragma once
13
14#include "libmesh/ignore_warnings.h"
15#include "mfem.hpp"
16#include "libmesh/restore_warnings.h"
17
21class MFEMVectorMagnitudeCoefficient : public mfem::Coefficient
22{
23public:
24 MFEMVectorMagnitudeCoefficient(mfem::VectorCoefficient & vec_coef);
25
27 void SetTime(mfem::real_t t) override;
28
30 mfem::real_t Eval(mfem::ElementTransformation & T, const mfem::IntegrationPoint & ip) override;
31
32private:
33 mfem::VectorCoefficient * _vec_coef;
34 mutable mfem::Vector _vec;
35};
36
37#endif
Scalar coefficient that evaluates the magnitude of a vector coefficient.
void SetTime(mfem::real_t t) override
Set the time for internally stored coefficients.
mfem::real_t Eval(mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) override
Evaluate the vector coefficient magnitude at ip.