https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMQuadratureFunctionCoefficientBase.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 "MooseEnum.h"
15#include <string>
16
17namespace mfem
18{
19class QuadratureFunction;
20class ElementTransformation;
21class IntegrationPoint;
22}
23
31{
32public:
40 CreateMooseEnumClass(UpdatePolicy, NONE, TIME, NONLINEAR);
41
42 MFEMQuadratureFunctionCoefficientBase(UpdatePolicy update_policy, const std::string & name)
43 : _update_policy(update_policy), _name(name), _dirty(true)
44 {
45 }
46
48
52 {
53 if (_update_policy == UpdatePolicy::NONLINEAR)
54 _dirty = true;
55 }
56
57protected:
60 {
61 if (_update_policy != UpdatePolicy::NONE)
62 _dirty = true;
63 }
64
69 void CheckIntegrationRule(const mfem::QuadratureFunction & qf,
70 mfem::ElementTransformation & T,
71 const mfem::IntegrationPoint & ip) const;
72
74 const UpdatePolicy _update_policy;
76 const std::string _name;
78 bool _dirty;
79};
80
81#endif
Shared lazy-update state for quadrature function coefficients.
void MarkSolutionChanged()
Mark the stored values as stale following a change of solution variables, forcing the source to be re...
const UpdatePolicy _update_policy
When the stored values are re-projected from the source coefficient.
MFEMQuadratureFunctionCoefficientBase(UpdatePolicy update_policy, const std::string &name)
CreateMooseEnumClass(UpdatePolicy, NONE, TIME, NONLINEAR)
Policy controlling when the stored values are re-projected from the source coefficient.
virtual ~MFEMQuadratureFunctionCoefficientBase()=default
const std::string _name
Name of the owning MOOSE object, used in error messages.
void MarkTimeChanged()
Mark the stored values as stale following a change of time.
bool _dirty
Whether the stored values are stale and must be re-projected before use.
void CheckIntegrationRule(const mfem::QuadratureFunction &qf, mfem::ElementTransformation &T, const mfem::IntegrationPoint &ip) const
Verify that the integration point ip supplied by a consuming integrator belongs to the same quadratur...