#include <ShapeStorage_fwd.hpp>
Shape storage base class.
It supports storing computed shapes for Lap, D1 and D2 operators. Derived classes should inherit the interface via CRTP and implement missing methods.
Definition at line 41 of file ShapeStorage_fwd.hpp.
Public Member Functions | |
void | resize (const std::vector< int > &support_sizes) |
Resizes the storage to accommodate shapes of given sizes. More... | |
int | size () const |
Returns number of nodes. More... | |
SINL int | support (int node, int j) const |
Returns index of j -th neighbour of node -th node, i.e. support[node][j] , but possibly faster. More... | |
SINL Eigen::Map< const Eigen::Matrix< int, Eigen::Dynamic, 1 > > | support (int node) const |
Returns a collection of support indices for given node . More... | |
void | setSupport (int node_idx, const std::vector< int > &support) |
Sets support of node -th node to support . More... | |
int | supportSize (int node) const |
Returns support size of node -th node. More... | |
Range< int > | supportSizes () const |
Returns a vector of support sizes for all nodes, useful for matrix space preallocation. More... | |
Range< int > | supportSizesVec () const |
Returns a dim*N vector of dim*support_size , useful for matrix space preallocation for vector equations. More... | |
const std::array< Range< scalar_t >, num_operators > & | shapes () const |
Read access to complete shape storage. More... | |
template<int op_family> | |
SINL scalar_t | get (int op, int node, int j) const |
Get the weight of j -th stencil node of node for operator op in op_family (by index). More... | |
template<typename op_family > | |
SINL scalar_t | get (int op, int node, int j) const |
Get the weight of j -th stencil node of node for operator op in op_family (by type). More... | |
template<int op_family> | |
SINL scalar_t | get (int node, int j) const |
Get the j -th weight of shape for node for the only operator in op_family (by index). More... | |
template<typename op_family > | |
SINL scalar_t | get (int node, int j) const |
Get the j -th weight of shape for node for the only operator in op_family (by type). More... | |
template<int op_family> | |
Eigen::Map< const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > > | getShape (int op, int node) const |
Get the shape for node for operator op in op_family (by index). More... | |
template<typename op_family > | |
Eigen::Map< const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > > | getShape (int op, int node) const |
Get the shape for node for operator op in op_family (by type). More... | |
template<int op_family> | |
SINL Eigen::Map< const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > > | getShape (int node) const |
Get the shape for node for the only operator in op_family (by index). More... | |
template<typename op_family > | |
SINL Eigen::Map< const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > > | getShape (int node) const |
Get the shape for node for the only operator in op_family (by type). More... | |
template<int op_family> | |
SINL void | setShape (int op, int node, const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > &shape) |
Set the shape for node for operator op in op_family (by index). More... | |
template<typename op_family > | |
SINL void | setShape (int op, int node, const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > &shape) |
Set the shape for node for operator op in op_family (by type). More... | |
template<int op_family> | |
SINL void | setShape (int node, const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > &shape) |
Set the shape for node for the only operator in op_family (by index). More... | |
template<typename op_family > | |
SINL void | setShape (int node, const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > &shape) |
Set the shape for node for the only operator in op_family (by type). More... | |
SINL scalar_t | laplace (int node, int j) const |
Return j-th laplace shape coefficient for node -th node. More... | |
Eigen::Map< const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > > | laplace (int node) const |
Returns the laplace shape for node . More... | |
SINL void | setLaplace (int node, const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > &shape) |
Sets the laplace shape for node to shape . More... | |
SINL scalar_t | d1 (int var, int node, int j) const |
Return j -th shape coefficient for derivative wrt. variable var in node . More... | |
Eigen::Map< const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > > | d1 (int var, int node) const |
Return shape for derivative wrt. variable var in node . More... | |
SINL void | setD1 (int var, int node, const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > &shape) |
Sets shape for derivative wrt. variable var for node to shape . More... | |
SINL scalar_t | d2 (int varmin, int varmax, int node, int j) const |
Return j -th shape coefficient for mixed derivative wrt. More... | |
Eigen::Map< const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > > | d2 (int varmin, int varmax, int node) const |
Return shape for mixed derivative wrt. variables varmin and varmax in node . More... | |
SINL void | setD2 (int varmin, int varmax, int node, const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > &shape) |
Sets shape for mixed derivative wrt. variables varmin and varmax for node to shape . More... | |
size_t | memoryUsed () const |
Returns the approximate memory used (in bytes). More... | |
ExplicitOperators< Derived > | explicitOperators () const |
Construct explicit operators over this storage. More... | |
ExplicitVectorOperators< Derived > | explicitVectorOperators () const |
Construct explicit vector operators over this storage. More... | |
template<typename M , typename R > | |
ImplicitOperators< Derived, M, R > | implicitOperators (M &matrix, R &rhs) const |
Construct implicit operators over this storage. More... | |
template<typename M , typename R > | |
ImplicitVectorOperators< Derived, M, R > | implicitVectorOperators (M &matrix, R &rhs) const |
Construct implicit vector operators over this storage. More... | |
Public Attributes | |
friend | Derived |
Be friends with derived class. More... | |
Static Public Attributes | |
constexpr static int | num_operators = std::tuple_size<op_families_tuple>::value |
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... | |
typedef OpFamilies | op_families_tuple |
Tuple of operator families. More... | |
Friends | |
template<typename D , typename V , typename O > | |
std::ostream & | operator<< (std::ostream &os, const ShapeStorage< D, V, O > &shapes) |
Output basic info about this shape storage. More... | |
Private Member Functions | |
template<typename T > | |
SINL 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 > | |
SINL 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 SINL 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 SINL T * | access (const std::vector< T > &v, int node) const |
Returns const pointer to the start of values for node -th node. More... | |
ShapeStorage () | |
Constructs empty storage with size 0. Can be resized with resize. More... | |
Private Attributes | |
int | domain_size_ |
Total number of nodes. More... | |
Range< int > | support_ |
Local copy of support domains. More... | |
std::array< Range< scalar_t >, num_operators > | shapes_ |
Tuple of shape containers for given operators. More... | |
anonymous enum |
Bitmask telling us which shapes to create.
Store dimension of the domain.
Enumerator | |
---|---|
dim | Dimensionality of the domain. |
Definition at line 47 of file ShapeStorage_fwd.hpp.
|
inlineprivate |
Constructs empty storage with size 0. Can be resized with resize.
Definition at line 77 of file ShapeStorage_fwd.hpp.
|
inlineprivate |
Returns const pointer to the start of values for node
-th node.
Definition at line 73 of file ShapeStorage_fwd.hpp.
|
inlineprivate |
Returns const pointer to the start of values for node
-th node for op
-th operator.
Definition at line 70 of file ShapeStorage_fwd.hpp.
|
inlineprivate |
Returns pointer to the start of values for node
-th node.
Definition at line 67 of file ShapeStorage_fwd.hpp.
|
inlineprivate |
Returns pointer to the start of values for node
-th node for op
-th operator.
Definition at line 64 of file ShapeStorage_fwd.hpp.
Eigen::Map< const Eigen::Matrix< typename ShapeStorage< Derived, vec_t, OpFamilies >::scalar_t, Eigen::Dynamic, 1 > > mm::ShapeStorage< Derived, vec_t, OpFamilies >::d1 | ( | int | var, |
int | node | ||
) | const |
Return shape for derivative wrt. variable var
in node
.
Definition at line 103 of file ShapeStorage.hpp.
ShapeStorage< Derived, vec_t, OpFamilies >::scalar_t mm::ShapeStorage< Derived, vec_t, OpFamilies >::d1 | ( | int | var, |
int | node, | ||
int | j | ||
) | const |
Return j
-th shape coefficient for derivative wrt. variable var
in node
.
Definition at line 65 of file ShapeStorage.hpp.
Eigen::Map< const Eigen::Matrix< typename ShapeStorage< Derived, vec_t, OpFamilies >::scalar_t, Eigen::Dynamic, 1 > > mm::ShapeStorage< Derived, vec_t, OpFamilies >::d2 | ( | int | varmin, |
int | varmax, | ||
int | node | ||
) | const |
Return shape for mixed derivative wrt. variables varmin
and varmax
in node
.
Definition at line 113 of file ShapeStorage.hpp.
ShapeStorage< Derived, vec_t, OpFamilies >::scalar_t mm::ShapeStorage< Derived, vec_t, OpFamilies >::d2 | ( | int | varmin, |
int | varmax, | ||
int | node, | ||
int | j | ||
) | const |
Return j
-th shape coefficient for mixed derivative wrt.
variables varmin
and varmax
in node
.
Definition at line 76 of file ShapeStorage.hpp.
ExplicitOperators< Derived > mm::ShapeStorage< Derived, vec_t, OpFamilies >::explicitOperators |
Construct explicit operators over this storage.
Definition at line 89 of file ExplicitOperators.hpp.
ExplicitVectorOperators< Derived > mm::ShapeStorage< Derived, vec_t, OpFamilies >::explicitVectorOperators |
Construct explicit vector operators over this storage.
Definition at line 160 of file ExplicitVectorOperators.hpp.
|
inline |
Get the j
-th weight of shape for node
for the only operator in op_family
(by index).
Definition at line 134 of file ShapeStorage_fwd.hpp.
|
inline |
Get the j
-th weight of shape for node
for the only operator in op_family
(by type).
Definition at line 139 of file ShapeStorage_fwd.hpp.
|
inline |
Get the weight of j
-th stencil node of node
for operator op
in op_family
(by index).
Definition at line 124 of file ShapeStorage_fwd.hpp.
|
inline |
Get the weight of j
-th stencil node of node
for operator op
in op_family
(by type).
Definition at line 129 of file ShapeStorage_fwd.hpp.
|
inline |
Get the shape for node
for the only operator in op_family
(by index).
Definition at line 157 of file ShapeStorage_fwd.hpp.
|
inline |
Get the shape for node
for the only operator in op_family
(by type).
Definition at line 163 of file ShapeStorage_fwd.hpp.
|
inline |
Get the shape for node
for operator op
in op_family
(by index).
Definition at line 145 of file ShapeStorage_fwd.hpp.
|
inline |
Get the shape for node
for operator op
in op_family
(by type).
Definition at line 151 of file ShapeStorage_fwd.hpp.
ImplicitOperators<Derived, M, R> mm::ShapeStorage< Derived, vec_t, OpFamilies >::implicitOperators | ( | M & | matrix, |
R & | rhs | ||
) | const |
Construct implicit operators over this storage.
ImplicitVectorOperators<Derived, M, R> mm::ShapeStorage< Derived, vec_t, OpFamilies >::implicitVectorOperators | ( | M & | matrix, |
R & | rhs | ||
) | const |
Construct implicit vector operators over this storage.
Eigen::Map< const Eigen::Matrix< typename ShapeStorage< Derived, vec_t, OpFamilies >::scalar_t, Eigen::Dynamic, 1 > > mm::ShapeStorage< Derived, vec_t, OpFamilies >::laplace | ( | int | node | ) | const |
Returns the laplace shape for node
.
Definition at line 94 of file ShapeStorage.hpp.
ShapeStorage< Derived, vec_t, OpFamilies >::scalar_t mm::ShapeStorage< Derived, vec_t, OpFamilies >::laplace | ( | int | node, |
int | j | ||
) | const |
Return j-th
laplace shape coefficient for node
-th node.
Definition at line 55 of file ShapeStorage.hpp.
size_t mm::ShapeStorage< Derived, vec_t, OpFamilies >::memoryUsed |
Returns the approximate memory used (in bytes).
Definition at line 182 of file ShapeStorage.hpp.
|
inline |
Resizes the storage to accommodate shapes of given sizes.
Definition at line 81 of file ShapeStorage_fwd.hpp.
void mm::ShapeStorage< Derived, vec_t, OpFamilies >::setD1 | ( | int | var, |
int | node, | ||
const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > & | shape | ||
) |
Sets shape for derivative wrt. variable var
for node
to shape
.
Definition at line 147 of file ShapeStorage.hpp.
void mm::ShapeStorage< Derived, vec_t, OpFamilies >::setD2 | ( | int | varmin, |
int | varmax, | ||
int | node, | ||
const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > & | shape | ||
) |
Sets shape for mixed derivative wrt. variables varmin
and varmax
for node
to shape
.
Definition at line 158 of file ShapeStorage.hpp.
void mm::ShapeStorage< Derived, vec_t, OpFamilies >::setLaplace | ( | int | node, |
const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > & | shape | ||
) |
Sets the laplace shape for node
to shape
.
Definition at line 137 of file ShapeStorage.hpp.
|
inline |
Set the shape for node
for the only operator in op_family
(by index).
Definition at line 183 of file ShapeStorage_fwd.hpp.
|
inline |
Set the shape for node
for the only operator in op_family
(by type).
Definition at line 189 of file ShapeStorage_fwd.hpp.
|
inline |
Set the shape for node
for operator op
in op_family
(by index).
Definition at line 170 of file ShapeStorage_fwd.hpp.
|
inline |
Set the shape for node
for operator op
in op_family
(by type).
Definition at line 177 of file ShapeStorage_fwd.hpp.
void mm::ShapeStorage< Derived, vec_t, OpFamilies >::setSupport | ( | int | node_idx, |
const std::vector< int > & | support | ||
) |
Sets support of node
-th node to support
.
Definition at line 126 of file ShapeStorage.hpp.
|
inline |
Read access to complete shape storage.
Definition at line 121 of file ShapeStorage_fwd.hpp.
|
inline |
Returns number of nodes.
Definition at line 87 of file ShapeStorage_fwd.hpp.
Eigen::Map< const Eigen::Matrix< int, Eigen::Dynamic, 1 > > mm::ShapeStorage< Derived, vec_t, OpFamilies >::support | ( | int | node | ) | const |
Returns a collection of support indices for given node
.
Definition at line 27 of file ShapeStorage.hpp.
int mm::ShapeStorage< Derived, vec_t, OpFamilies >::support | ( | int | node, |
int | j | ||
) | const |
Returns index of j
-th neighbour of node
-th node, i.e. support[node][j]
, but possibly faster.
Definition at line 15 of file ShapeStorage.hpp.
|
inline |
Returns support size of node
-th node.
Definition at line 102 of file ShapeStorage_fwd.hpp.
Range< int > mm::ShapeStorage< Derived, vec_t, OpFamilies >::supportSizes |
Returns a vector of support sizes for all nodes, useful for matrix space preallocation.
Definition at line 36 of file ShapeStorage.hpp.
Range< int > mm::ShapeStorage< Derived, vec_t, OpFamilies >::supportSizesVec |
Returns a dim*N
vector of dim*support_size
, useful for matrix space preallocation for vector equations.
Same warning as for supportSizes applies.
Definition at line 45 of file ShapeStorage.hpp.
|
friend |
Output basic info about this shape storage.
Definition at line 176 of file ShapeStorage.hpp.
friend mm::ShapeStorage< Derived, vec_t, OpFamilies >::Derived |
Be friends with derived class.
Definition at line 52 of file ShapeStorage_fwd.hpp.
|
private |
Total number of nodes.
Definition at line 56 of file ShapeStorage_fwd.hpp.
|
staticconstexpr |
Number of operator families in this storage.
Definition at line 50 of file ShapeStorage_fwd.hpp.
|
private |
Tuple of shape containers for given operators.
Definition at line 61 of file ShapeStorage_fwd.hpp.
|
private |
Local copy of support domains.
Definition at line 58 of file ShapeStorage_fwd.hpp.