#include <UniformShapeStorage_fwd.hpp>
Efficiently stores shape functions of uniform length.
This class is used to store shape functions (stencil weights) generated for discretizations where supports of all nodes have equal size e.g. the support consists of 9 closest nodes. This class is more efficient than storing the shapes in a nested type, such as std::vector<std::vector<T>>
, see technical report.
If supports of node vary in size, use RaggedShapeStorage instead.
vec_t | Vector type used in computations, specifies the dimensionality of the domain and scalar type for numerical computations. |
OpFamilies | A list of operator families for which the shapes will be stored. The basic operator families are Lap, Der1s and Der2s representing the Laplacian, 1st and 2nd derivatives, respectively. All these operators are computed if the template parameters are not explicitly specified. |
Usage example:
Definition at line 55 of file UniformShapeStorage_fwd.hpp.
Public Member Functions | |
UniformShapeStorage () | |
< Number of nodes that shapes can be stored for. More... | |
int | supportSize (int) const |
Returns support size of node -th node. More... | |
int | size () const |
< Number of operators stored in this storage. More... | |
Static Public Attributes | |
constexpr static int | num_operators |
Number of operator families in this storage. More... | |
Public Types | |
enum | { dim = vec_t::dim } |
Bitmask telling us which shapes to create. More... | |
typedef vec_t | vector_t |
Vector type used. More... | |
typedef vec_t::scalar_t | scalar_t |
Scalar type used. More... | |
Private Types | |
typedef ShapeStorage< UniformShapeStorage< vec_t, OpFamilies >, vec_t, OpFamilies > | base_t |
Parent class. More... | |
Private Member Functions | |
void | resize_ (const std::vector< int > &support_sizes) |
Resizes the storage to accommodate shapes of given sizes. More... | |
template<typename T > | |
T * | access (std::vector< T > &v, int op, int node) const |
Returns pointer to the start of values for node -th node for op -th operator. More... | |
template<typename T > | |
T * | access (std::vector< T > &v, int node) const |
Returns pointer to the start of values for node -th node. More... | |
template<typename T > | |
const T * | access (const std::vector< T > &v, int op, int node) const |
Returns const pointer to the start of values for node -th node for op -th operator. More... | |
template<typename T > | |
const T * | access (const std::vector< T > &v, int node) const |
Returns const pointer to the start of values for node -th node. More... | |
Private Attributes | |
friend | base_t |
Be friends with derived class. More... | |
int | support_size_ |
Support size. More... | |
anonymous enum |
Bitmask telling us which shapes to create.
Enumerator | |
---|---|
dim | Dimensionality of the domain. |
Definition at line 61 of file UniformShapeStorage_fwd.hpp.
|
inline |
< Number of nodes that shapes can be stored for.
Constructs an empty shape storage with size 0.
Definition at line 79 of file UniformShapeStorage_fwd.hpp.
|
inlineprivate |
Returns const pointer to the start of values for node
-th node.
Definition at line 103 of file UniformShapeStorage_fwd.hpp.
|
inlineprivate |
Returns const pointer to the start of values for node
-th node for op
-th operator.
Definition at line 100 of file UniformShapeStorage_fwd.hpp.
|
inlineprivate |
Returns pointer to the start of values for node
-th node.
Definition at line 97 of file UniformShapeStorage_fwd.hpp.
|
inlineprivate |
Returns pointer to the start of values for node
-th node for op
-th operator.
Definition at line 94 of file UniformShapeStorage_fwd.hpp.
|
private |
Resizes the storage to accommodate shapes of given sizes.
If support sizes are {9, 9, 9}
the class will allocate space for shapes for 3 nodes with 9 support nodes each. The containers are zero initialized.
Assertion | fails if the elements of support_sizes are not all the same. |
Definition at line 19 of file UniformShapeStorage.hpp.
|
inline |
< Number of operators stored in this storage.
Definition at line 87 of file ShapeStorage_fwd.hpp.
|
inline |
Returns support size of node
-th node.
Definition at line 82 of file UniformShapeStorage_fwd.hpp.
|
private |
Be friends with derived class.
Definition at line 66 of file UniformShapeStorage_fwd.hpp.
|
staticconstexpr |
Number of operator families in this storage.
Definition at line 50 of file ShapeStorage_fwd.hpp.
|
private |
Support size.
Definition at line 72 of file UniformShapeStorage_fwd.hpp.