https://mooseframework.inl.gov
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 
17 namespace mfem
18 {
19 class QuadratureFunction;
20 class ElementTransformation;
21 class IntegrationPoint;
22 }
23 
31 {
32 public:
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 
47  virtual ~MFEMQuadratureFunctionCoefficientBase() = default;
48 
52  {
54  _dirty = true;
55  }
56 
57 protected:
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
std::string name(const ElemQuality q)
CreateMooseEnumClass(UpdatePolicy, NONE, TIME, NONLINEAR)
Policy controlling when the stored values are re-projected from the source coefficient.
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...
bool _dirty
Whether the stored values are stale and must be re-projected before use.
const UpdatePolicy _update_policy
When the stored values are re-projected from the source coefficient.
MFEMQuadratureFunctionCoefficientBase(UpdatePolicy update_policy, const std::string &name)
virtual ~MFEMQuadratureFunctionCoefficientBase()=default
void MarkSolutionChanged()
Mark the stored values as stale following a change of solution variables, forcing the source to be re...
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.
Shared lazy-update state for quadrature function coefficients.