#include <RaggedShapeStorage_fwd.hpp>
Efficiently stores shape functions of different lengths.
This class is used to store shape functions (stencil weights) generated for discretizations where supports of nodes have different sizes e.g. using FindBalancedSupport. 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 all nodes have the same size, use UniformShapeStorage 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. |
If you try to call a function that need other shapes than the computed ones, you will get a compile time error like:
Usage example:
Definition at line 22 of file DomainDiscretization_fwd.hpp.
Public Member Functions | |
RaggedShapeStorage () | |
< Number of nodes that shapes can be stored for. More... | |
int | supportSize (int node) 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 } |
Store dimension of the domain. 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< RaggedShapeStorage< 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 i, int j) 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 i) const |
Returns pointer to the start of values for node -th node for. More... | |
template<typename T > | |
const T * | access (const std::vector< T > &v, int i, int j) 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 i) const |
Returns const pointer to the start of values for node -th node. More... | |
Private Attributes | |
Range< int > | support_sizes_ |
Support sizes. More... | |
Range< int > | support_starts_ |
Indexes of starts of supports. Cumulative sums of support_sizes_ . More... | |
int | total_size_ |
Sum of all support sizes. More... | |
friend | base_t |
Be friends with derived class. More... | |
anonymous enum |
Store dimension of the domain.
Enumerator | |
---|---|
dim | Dimensionality of the domain. |
Definition at line 58 of file RaggedShapeStorage_fwd.hpp.
|
inline |
< Number of nodes that shapes can be stored for.
Constructs an empty shape storage with size 0.
Definition at line 80 of file RaggedShapeStorage_fwd.hpp.
|
inlineprivate |
Returns const pointer to the start of values for node
-th node.
Definition at line 103 of file RaggedShapeStorage_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 RaggedShapeStorage_fwd.hpp.
|
inlineprivate |
Returns pointer to the start of values for node
-th node for.
Definition at line 97 of file RaggedShapeStorage_fwd.hpp.
|
inlineprivate |
Returns pointer to the start of values for node
-th node for op
-th operator.
Definition at line 94 of file RaggedShapeStorage_fwd.hpp.
|
private |
Resizes the storage to accommodate shapes of given sizes.
If support sizes are {9, 12, 7}
the class will allocate space for shapes for 3 nodes with sizes 9, 12 and 7. The containers are zero initialized.
Definition at line 19 of file RaggedShapeStorage.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 83 of file RaggedShapeStorage_fwd.hpp.
|
private |
Be friends with derived class.
Definition at line 70 of file RaggedShapeStorage_fwd.hpp.
|
staticconstexpr |
Number of operator families in this storage.
Definition at line 50 of file ShapeStorage_fwd.hpp.
|
private |
Support sizes.
Definition at line 62 of file RaggedShapeStorage_fwd.hpp.
|
private |
Indexes of starts of supports. Cumulative sums of support_sizes_
.
Definition at line 64 of file RaggedShapeStorage_fwd.hpp.
|
private |
Sum of all support sizes.
Definition at line 66 of file RaggedShapeStorage_fwd.hpp.