Nektar++
|
Representation of a variable coefficient. More...
#include <StdRegions.hpp>
Public Member Functions | |
VarCoeffEntry ()=default | |
Default constructor. More... | |
VarCoeffEntry (const Array< OneD, const NekDouble > &input) | |
Copy an array of values into this entry. More... | |
const NekDouble & | operator[] (std::size_t idx) const |
Access an entry idx within m_coeffs. More... | |
void | operator= (const Array< OneD, const NekDouble > &rhs) |
Assignment operator given an array rhs . More... | |
const Array< OneD, const NekDouble > & | GetValue () const |
Returns a const reference to the coefficients. More... | |
std::size_t | GetHash () const |
Returns the hash of this entry. More... | |
VarCoeffEntry | restrict (size_t offset, size_t size) const |
Protected Member Functions | |
void | ComputeHash () |
Computes the hash of this entry using hash_range. More... | |
Protected Attributes | |
std::size_t | m_hash = 0 |
Hash of the entries inside m_coeffs. More... | |
Array< OneD, NekDouble > | m_coeffs |
Storage for the variable coefficient entries. More... | |
Representation of a variable coefficient.
Variable coefficients are entries stored inside a VarCoeffMap which are defined at each quadrature/solution point within an element. This class wraps that concept, storing the values in m_coeffs, but also stores alongside this a hash of the data in m_hash. This is then used within MultiRegions::GlobalMatrixKey to efficiently distinguish between matrix keys that have variable coefficients defined, but whose entries are different.
For that reason the entries here are deliberately protected by const references; i.e. the entries inside of m_coeffs should not be modified in-place, but a new array copied in so that the hash can be recalculated.
Definition at line 264 of file StdRegions.hpp.
|
default |
Default constructor.
|
inline |
Copy an array of values into this entry.
Upon copy into m_coeffs, compute the hash of this entry using ComputeHash.
input | Variable coefficients to be defined at each solution point. |
Definition at line 278 of file StdRegions.hpp.
References ComputeHash().
|
inlineprotected |
Computes the hash of this entry using hash_range.
Definition at line 357 of file StdRegions.hpp.
References Nektar::hash_range(), m_coeffs, and m_hash.
Referenced by operator=(), and VarCoeffEntry().
|
inline |
Returns a const reference to the coefficients.
Definition at line 311 of file StdRegions.hpp.
References m_coeffs.
Referenced by VarCoeffEntryToPython::convert().
|
inline |
Assignment operator given an array rhs
.
Upon copy into m_coeffs, compute the hash of this entry using ComputeHash.
rhs | Variable coefficients to be defined at each solution point. |
Definition at line 302 of file StdRegions.hpp.
References ComputeHash(), and m_coeffs.
|
inline |
Access an entry idx
within m_coeffs.
idx | Index of the entry to access. |
Definition at line 288 of file StdRegions.hpp.
References m_coeffs.
|
inline |
Definition at line 334 of file StdRegions.hpp.
Storage for the variable coefficient entries.
Definition at line 372 of file StdRegions.hpp.
Referenced by ComputeHash(), GetValue(), operator=(), operator[](), and restrict().
|
protected |
Hash of the entries inside m_coeffs.
Definition at line 369 of file StdRegions.hpp.
Referenced by ComputeHash(), GetHash(), and restrict().