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
16#include "libmesh/ignore_warnings.h"
17#include "mfem.hpp"
18#include "libmesh/restore_warnings.h"
19
27{
28public:
36 CreateMooseEnumClass(UpdatePolicy, NONE, TIME, NONLINEAR);
37
38 MFEMQuadratureFunctionCoefficientBase(UpdatePolicy update_policy, const std::string & name)
39 : _update_policy(update_policy), _name(name), _dirty(true)
40 {
41 }
42
44
47 void MarkSolutionChanged() { _dirty |= _update_policy == UpdatePolicy::NONLINEAR; }
48
49protected:
51 void MarkTimeChanged() { _dirty |= _update_policy != UpdatePolicy::NONE; }
52
57 void CheckIntegrationRule(const mfem::QuadratureFunction & qf,
58 mfem::ElementTransformation & T,
59 const mfem::IntegrationPoint & ip) const;
60
62 const UpdatePolicy _update_policy;
64 const std::string _name;
66 bool _dirty;
67};
68
69#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...