ReferenceTabulation
Owned scalar basis values and reference derivatives.
Defined in Rodin/Variational/ReferenceTabulation.h
template < class Scalar> class ReferenceTabulation;
| Template parameters | |
|---|---|
| Scalar | Stored scalar type. |
Scalar basis values and first derivatives at reference samples.
Values are indexed by sample and basis; derivatives additionally carry a reference-coordinate index. This data object owns its storage and has no cache identity, lookup, eviction or finite-element dependency.
Public types
Constructors, destructors, conversion operators
- ReferenceTabulation()
- Constructs an empty reference table.
- ReferenceTabulation(const ReferenceTabulation& other) defaulted
- Copies reference dimensions and numerical storage.
- ReferenceTabulation(ReferenceTabulation&& other) noexcept
- Transfers storage and leaves an empty source table.
Public functions
- auto operator=(const ReferenceTabulation& other) -> ReferenceTabulation&
- Copies all extents and storage without publishing a partial table.
- auto operator=(ReferenceTabulation&& other) -> ReferenceTabulation& noexcept
- Transfers all storage and leaves an empty source table.
- void resize(size_t samples, size_t count, size_t dimension)
- Sizes values and first derivatives together.
- auto getSize() const -> size_t noexcept
- Gets the number of reference samples.
- auto getCount() const -> size_t noexcept
- Gets the number of scalar basis functions.
- auto getDimension() const -> size_t noexcept
- Gets the reference dimension.
- auto getValues() const -> const std::vector<Scalar>& noexcept
- Gets the owned values in sample-major order.
- auto getDerivatives() const -> const std::vector<Scalar>& noexcept
- Gets the owned derivatives in sample/basis/coordinate order.
- auto getValues(size_t sample) -> Values noexcept
- Borrows writable basis values at one sample.
- auto getGradients(size_t sample) -> Gradients noexcept
- Borrows writable first derivatives at one sample.
- auto getBasis(size_t qp, size_t a) const -> const Scalar& noexcept
- Gets a reference basis value.
-
template<size_t Order>auto getDerivative(size_t qp, size_t a, size_t i) const -> const Scalar& noexcept
- Gets a tabulated reference derivative.
- auto getGradient(size_t qp, size_t a) const -> std::span<const Scalar> noexcept
- Borrows the reference gradient of one basis function.
Function documentation
ReferenceTabulation(const ReferenceTabulation& other) defaulted
Copies reference dimensions and numerical storage.
| Parameters | |
|---|---|
| other | Source table. |
ReferenceTabulation(ReferenceTabulation&& other) noexcept
Transfers storage and leaves an empty source table.
| Parameters | |
|---|---|
| other | Source table. |
ReferenceTabulation& operator=(const ReferenceTabulation& other)
Copies all extents and storage without publishing a partial table.
| Parameters | |
|---|---|
| other | Source table. |
| Returns | This table. |
ReferenceTabulation& operator=(ReferenceTabulation&& other) noexcept
Transfers all storage and leaves an empty source table.
| Parameters | |
|---|---|
| other | Source table. |
| Returns | This table. |
void resize(size_t samples, size_t count, size_t dimension)
Sizes values and first derivatives together.
| Parameters | |
|---|---|
| samples | Number of reference samples. |
| count | Number of scalar basis functions. |
| dimension | Number of reference coordinates, including zero. |
Resizing can invalidate previously borrowed views, including when a later allocation fails. Storage sizes and published extents remain coherent.
size_t getCount() const noexcept
Gets the number of scalar basis functions.
| Returns | The basis count. |
|---|
size_t getDimension() const noexcept
Gets the reference dimension.
| Returns | The reference dimension, including zero. |
|---|
const std::vector<Scalar>& getValues() const noexcept
Gets the owned values in sample-major order.
| Returns | Read-only basis storage. |
|---|
const std::vector<Scalar>& getDerivatives() const noexcept
Gets the owned derivatives in sample/basis/coordinate order.
| Returns | Read-only first-derivative storage. |
|---|
Gradients getGradients(size_t sample) noexcept
Borrows writable first derivatives at one sample.
| Parameters | |
|---|---|
| sample | Reference sample index. |
| Returns | Basis-major output with the established reference dimension. |
const Scalar& getBasis(size_t qp, size_t a) const noexcept
Gets a reference basis value.
| Parameters | |
|---|---|
| qp | Quadrature-point index. |
| a | Local basis-function index. |
| Returns | The tabulated basis value. |
template<class Scalar>
template<size_t Order>
const Scalar& getDerivative(size_t qp,
size_t a,
size_t i) const noexcept
Gets a tabulated reference derivative.
| Template parameters | |
|---|---|
| Order | Zero selects values; one selects first derivatives. |
| Parameters | |
| qp | Quadrature-point index. |
| a | Local basis-function index. |
| i | Reference coordinate, zero when selecting a value. |
| Returns | The selected value or first derivative. |
std::span<const Scalar> getGradient(size_t qp, size_t a) const noexcept
Borrows the reference gradient of one basis function.
| Parameters | |
|---|---|
| qp | Quadrature-point index. |
| a | Local basis-function index. |
| Returns | A span of reference dimension, empty on a point. |