https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMVectorQuadratureFunctionCoefficient.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
15
16// The class derives from mfem::VectorQuadratureFunctionCoefficient, so the complete type is
17// required.
18#include "libmesh/ignore_warnings.h"
19#include "mfem.hpp"
20#include "libmesh/restore_warnings.h"
21
28class MFEMVectorQuadratureFunctionCoefficient : public mfem::VectorQuadratureFunctionCoefficient,
30{
31public:
32 MFEMVectorQuadratureFunctionCoefficient(mfem::VectorCoefficient & source,
33 mfem::QuadratureFunction & qf,
34 UpdatePolicy update_policy,
35 const std::string & name);
36
39 void SetTime(mfem::real_t t) override;
40
41 using mfem::VectorQuadratureFunctionCoefficient::Eval;
43 void Eval(mfem::Vector & V,
44 mfem::ElementTransformation & T,
45 const mfem::IntegrationPoint & ip) override;
46
48 void Project(mfem::QuadratureFunction & qf) override;
49
50private:
52 void Refresh();
53
55 mfem::VectorCoefficient & _source;
57 mfem::QuadratureFunction & _qf;
58};
59
60#endif
Shared lazy-update state for quadrature function coefficients.
Vector coefficient holding precomputed values of a source vector coefficient at the quadrature points...
void Eval(mfem::Vector &V, mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) override
Return the stored values at ip, re-projecting the source first if invalidated.
void Refresh()
Project the source coefficient into the quadrature function if invalidated.
mfem::VectorCoefficient & _source
Source coefficient the stored values are projected from.
mfem::QuadratureFunction & _qf
Storage for the projected values, shared with the owning MOOSE object.
void SetTime(mfem::real_t t) override
Set the time for the coefficient, invalidating the stored values unless the update policy is NONE.
void Project(mfem::QuadratureFunction &qf) override
Copy the stored values into qf, re-projecting the source first if invalidated.