|
SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
|
Track coefficient values using an owned snapshot and the identity of their binding. More...
#include <coefficient_tracking.hpp>
Public Member Functions | |
| template<typename ViewT> | |
| bool | matches (const ::mfem::Vector &captured, const ViewT &view) const |
| Check whether the current coefficients equal a captured snapshot. | |
| template<typename ViewT> | |
| ::mfem::Vector | capture (const ViewT &view) |
Static Public Member Functions | |
| template<typename ViewT> | |
| static ::mfem::Vector | capture (const ViewT &view) |
| Copy the current coefficient values into an independent snapshot. | |
| template<typename ViewT> | |
| static const void * | identity (const ViewT &view) |
| Identify the persistent binding associated with the coefficients. | |
Track coefficient values using an owned snapshot and the identity of their binding.
A coefficient vector describes numerical values, while its binding determines how those values correspond to discretization degrees of freedom. Both pieces of information matter when deciding whether cached work can be reused.
This policy provides three operations to the dependency system:
The vector's allocation is not part of its identity. A different vector containing equal coefficients can represent the same input when it uses the same binding. Conversely, equal coefficients associated with a different binding must not automatically reuse the previous calculation.
This policy supplies comparisons; the dependency system decides which computations must run.
|
staticnodiscard |
Copy the current coefficient values into an independent snapshot.
Subsequent changes to the source vector do not modify the returned snapshot. The entire supplied vector is copied; if the view contains only selected nodal coefficients, only those selected values are captured.
| ViewT | View type exposing its coefficients through a values member. |
| [in] | view | View of the current coefficients. |
| ::mfem::Vector serif::discretization::backend::mfem::CoefficientTracking::capture | ( | const ViewT & | view | ) |
|
staticnodiscard |
Identify the persistent binding associated with the coefficients.
The returned address identifies the binding object, rather than the temporary view or the coefficient vector's storage. Creating another view of the same binding therefore preserves this identity.
| ViewT | View type exposing its persistent binding through a binding member. |
| [in] | view | View referring to the coefficient binding. |
|
nodiscard |
Check whether the current coefficients equal a captured snapshot.
The vectors must have the same size and equal corresponding entries. Two empty vectors match. Their storage addresses do not affect the comparison.
This method compares values only. Binding identity is supplied separately by identity and checked by the dependency system.
| ViewT | View type exposing its coefficients through a values member. |
| [in] | captured | Previously captured coefficient values. |
| [in] | view | View of the current coefficients. |