#include <stencil_weight.hpp>
Public Types | |
using | value_type = value_t |
using | weight_type = weight_t |
Public Member Functions | |
template<typename W = weight_t, typename V , std::size_t D = std::tuple_size<W>::value, typename std::enable_if< std::is_same< std::array< V, D >, W >::value >::type * = nullptr> | |
value_t & | at (const std::array< V, D > &weight, std::size_t index) |
template<typename W = weight_t, typename V , std::size_t D = std::tuple_size<W>::value, typename std::enable_if< std::is_same< std::array< V, D >, W >::value >::type * = nullptr> | |
const value_t & | at (const std::array< V, D > &weight, std::size_t index) const |
template<typename W = weight_t, typename V , typename std::enable_if< std::is_same< std::vector< V >, W >::value >::type * = nullptr> | |
const value_t & | at (const std::vector< V > &weight, int index) const |
template<typename W = weight_t, typename V , typename std::enable_if< std::is_same< std::vector< V >, W >::value >::type * = nullptr> | |
value_t & | at (const std::vector< V > &weight, std::size_t index) |
template<typename W > | |
value_t & | at (const W &weight, std::size_t index) |
template<typename W > | |
const value_t & | at (const W &weight, std::size_t index) const |
template<typename W = weight_t, typename V = value_t, std::size_t D = std::tuple_size<W>::value, typename std::enable_if< std::is_same< std::array< V, D >, W >::value >::type * = nullptr> | |
void | copy (const std::array< V, D > &weight, std::array< V, D > *target) const |
template<typename W = weight_t, typename V = value_t, typename std::enable_if< std::is_same< std::vector< V >, W >::value >::type * = nullptr> | |
void | copy (const std::vector< V > &weight, std::vector< V > *target) const |
template<typename W > | |
void | copy (const W &weight, W *target) const |
template<typename W = weight_t, typename V = value_t, std::size_t D = std::tuple_size<W>::value, typename std::enable_if< std::is_same< std::array< V, D >, W >::value >::type * = nullptr> | |
bool | isNegligible (const std::array< V, D > &weight, const weight_t &zero, double tolerance=1e-12) const |
template<typename W = weight_t, typename V = value_t, typename std::enable_if< std::is_same< std::vector< V >, W >::value >::type * = nullptr> | |
bool | isNegligible (const std::vector< V > &weight, const weight_t &zero, double tolerance=1e-12) const |
template<typename W > | |
bool | isNegligible (const W &weight, const weight_t &zero, double tolerance=1e-12) const |
template<typename W > | |
void | move (W &&weight, W *target) const |
template<typename W = weight_t, typename V = value_t, std::size_t D = std::tuple_size<W>::value, typename std::enable_if< std::is_same< std::array< V, D >, W >::value >::type * = nullptr> | |
void | sum (const std::array< V, D > &weight, double factor, std::array< V, D > *target) const |
template<typename W = weight_t, typename V = value_t, typename std::enable_if< std::is_same< std::vector< V >, W >::value >::type * = nullptr> | |
void | sum (const std::vector< V > &weight, double factor, std::vector< V > *target) const |
template<typename W > | |
void | sum (const W &weight, double factor, W *target) const |
Helper class to handle weights.
Definition at line 82 of file stencil_weight.hpp.
using bitpit::DiscreteStencilWeightManager< weight_t, value_t >::value_type = value_t |
Definition at line 86 of file stencil_weight.hpp.
using bitpit::DiscreteStencilWeightManager< weight_t, value_t >::weight_type = weight_t |
Definition at line 85 of file stencil_weight.hpp.
value_t & bitpit::DiscreteStencilWeightManager< weight_t, value_t >::at | ( | const std::array< V, D > & | weight, |
std::size_t | index ) |
Get the specified value.
index | is the position of the requested value |
Definition at line 369 of file stencil_weight.tpp.
const value_t & bitpit::DiscreteStencilWeightManager< weight_t, value_t >::at | ( | const std::array< V, D > & | weight, |
std::size_t | index ) const |
Get the specified value.
index | is the position of the requested value |
Definition at line 382 of file stencil_weight.tpp.
const value_t & bitpit::DiscreteStencilWeightManager< weight_t, value_t >::at | ( | const std::vector< V > & | weight, |
int | index ) const |
Get the specified value.
index | is the position of the requested value |
Definition at line 408 of file stencil_weight.tpp.
value_t & bitpit::DiscreteStencilWeightManager< weight_t, value_t >::at | ( | const std::vector< V > & | weight, |
std::size_t | index ) |
Get the specified value.
index | is the position of the requested value |
Definition at line 395 of file stencil_weight.tpp.
value_t & bitpit::DiscreteStencilWeightManager< weight_t, value_t >::at | ( | const W & | weight, |
std::size_t | index ) |
Get the specified value.
index | is the position of the requested value |
Definition at line 341 of file stencil_weight.tpp.
const value_t & bitpit::DiscreteStencilWeightManager< weight_t, value_t >::at | ( | const W & | weight, |
std::size_t | index ) const |
Get the specified value.
index | is the position of the requested value |
Definition at line 354 of file stencil_weight.tpp.
void bitpit::DiscreteStencilWeightManager< weight_t, value_t >::copy | ( | const std::array< V, D > & | weight, |
std::array< V, D > * | target ) const |
Copy the specified weight into the target.
weight | is the weight that will be copied | |
[out] | target | on output will contain a copy of the weight |
Definition at line 290 of file stencil_weight.tpp.
void bitpit::DiscreteStencilWeightManager< weight_t, value_t >::copy | ( | const std::vector< V > & | weight, |
std::vector< V > * | target ) const |
Copy the specified weight into the target.
The target will be resized to match the size of the specified weight.
weight | is the weight that will be copied | |
[out] | target | on output will contain a copy of the weight |
Definition at line 305 of file stencil_weight.tpp.
void bitpit::DiscreteStencilWeightManager< weight_t, value_t >::copy | ( | const W & | weight, |
W * | target ) const |
Copy the specified weight into the target.
weight | is the weight that will be copied | |
[out] | target | on output will contain a copy of the weight |
Definition at line 277 of file stencil_weight.tpp.
bool bitpit::DiscreteStencilWeightManager< weight_t, value_t >::isNegligible | ( | const std::array< V, D > & | weight, |
const weight_t & | zero, | ||
double | tolerance = 1e-12 ) const |
Check if the specified weight is negligible.
weight | is the weight to be checked |
zero | is the weight to be used as zero |
tolerance | is the tolerance that will be used for the check |
Definition at line 166 of file stencil_weight.tpp.
bool bitpit::DiscreteStencilWeightManager< weight_t, value_t >::isNegligible | ( | const std::vector< V > & | weight, |
const weight_t & | zero, | ||
double | tolerance = 1e-12 ) const |
Check if the specified weight is negligible.
weight | is the weight to be checked |
zero | is the weight to be used as zero |
tolerance | is the tolerance that will be used for the check |
Definition at line 187 of file stencil_weight.tpp.
bool bitpit::DiscreteStencilWeightManager< weight_t, value_t >::isNegligible | ( | const W & | weight, |
const weight_t & | zero, | ||
double | tolerance = 1e-12 ) const |
Check if the specified weight is negligible.
weight | is the weight to be checked |
zero | is the weight to be used as zero |
tolerance | is the tolerance that will be used for the check |
Definition at line 151 of file stencil_weight.tpp.
void bitpit::DiscreteStencilWeightManager< weight_t, value_t >::move | ( | W && | weight, |
W * | target ) const |
Move the specified weight into the target.
weight | is the weight that will be moved | |
[out] | target | on output will contain the moved weight |
Definition at line 328 of file stencil_weight.tpp.
void bitpit::DiscreteStencilWeightManager< weight_t, value_t >::sum | ( | const std::array< V, D > & | weight, |
double | factor, | ||
std::array< V, D > * | target ) const |
Sum the specified weight to the target.
weight | is the weight that will be summed |
factor | is the factor the weight will be multiplied with |
target | on output will contain the original target plus the weight multiplied by the specified factor |
Definition at line 225 of file stencil_weight.tpp.
void bitpit::DiscreteStencilWeightManager< weight_t, value_t >::sum | ( | const std::vector< V > & | weight, |
double | factor, | ||
std::vector< V > * | target ) const |
Sum the specified weight to the target.
The target will be resized to match the size of the weight to be summed. If the weight size is greater that the target size, missing target elements will be initialized to zero before summing the specified weight.
weight | is the weight that will be summed |
factor | is the factor the weight will be multiplied with |
target | on output will contain the original target plus the weight multiplied by the specified factor |
Definition at line 246 of file stencil_weight.tpp.
void bitpit::DiscreteStencilWeightManager< weight_t, value_t >::sum | ( | const W & | weight, |
double | factor, | ||
W * | target ) const |
Sum the specified weight to the target.
weight | is the weight that will be summed |
factor | is the factor the weight will be multiplied with |
target | on output will contain the original target plus the weight multiplied by the specified factor |
Definition at line 210 of file stencil_weight.tpp.