Share immutable tensor plans within one operator; copied rules are keyed by their contents.
More...
#include <tensor_basis.hpp>
|
| struct | Entry |
| | A struct that represents an entry in the TensorBasisCache. Each entry contains a non-owning pointer to a finite element, the reference operation, the number of copies, the points used to construct the TensorBasis, and a shared pointer to the TensorBasis itself. More...
|
| |
|
| std::vector< Entry > | m_entries |
| | The entries in the TensorBasisCache, each containing a non-owning pointer to a finite element, the reference operation, the number of copies, the points used to construct the TensorBasis, and a shared pointer to the TensorBasis itself.
|
| |
Share immutable tensor plans within one operator; copied rules are keyed by their contents.
A cache for TensorBasis objects to avoid repeated construction of the same tensor basis. This class stores a vector of "Entry" structs which each contain a non-owning pointer to some element, options, a shared pointer to a TensorBasis, and the points used to construct the TensorBasis.
◆ clear()
| void serif::discretization::backend::mfem::TensorBasisCache::clear |
( |
| ) |
|
|
inline |
◆ get()
| std::shared_ptr< const TensorBasis > serif::discretization::backend::mfem::TensorBasisCache::get |
( |
const ::mfem::FiniteElement & | element, |
|
|
const ::mfem::IntegrationRule & | rule, |
|
|
ReferenceOperation | operation, |
|
|
const int | copies, |
|
|
const ElementReconstruction * | reconstruction = nullptr ) |
|
inlinenodiscard |
Retrieve a verified plan, caching unsupported combinations as well.
Retrieve a verified tensor basis, caching unsupported combinations as well.
- Parameters
-
| element | The finite element for which to retrieve the tensor basis. |
| rule | The integration rule to use for evaluating the basis functions. |
| operation | The reference operation to apply (e.g., value, gradient). |
| copies | The number of copies of the basis functions. |
- Returns
- A shared pointer to a TensorBasis object if the tensor basis can be constructed, or an empty shared pointer if it cannot.
- Todo
- I think it would make sense, at some point, to switch this to an std::optional return
◆ size()
| std::size_t serif::discretization::backend::mfem::TensorBasisCache::size |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Get the number of entries in the TensorBasisCache.
- Returns
- The number of entries in the cache.
◆ m_entries
| std::vector<Entry> serif::discretization::backend::mfem::TensorBasisCache::m_entries |
|
private |
The entries in the TensorBasisCache, each containing a non-owning pointer to a finite element, the reference operation, the number of copies, the points used to construct the TensorBasis, and a shared pointer to the TensorBasis itself.
The documentation for this class was generated from the following file: