Metafunction for generating a discretization stencil with a memory pool (MP). More...
#include <stencil.hpp>
Public Types | |
typedef DiscreteStencilWeightPool< weight_t > | weight_pool_type |
Public Types inherited from bitpit::DiscreteStencil< weight_t, value_t > | |
using | value_type = value_t |
using | weight_manager_type = DiscreteStencilWeightManager<weight_t, value_t> |
using | weight_type = weight_t |
Public Member Functions | |
MPDiscreteStencil (const weight_t &zero=weight_t()) | |
MPDiscreteStencil (std::size_t nItems, const weight_t &zero=weight_t()) | |
MPDiscreteStencil (std::size_t size, const long *pattern, const weight_t &zero=weight_t()) | |
MPDiscreteStencil (std::size_t size, const long *pattern, const weight_t *weights, const weight_t &zero=weight_t()) | |
void | setWeightPool (weight_pool_type *pool) |
Public Member Functions inherited from bitpit::DiscreteStencil< weight_t, value_t > | |
DiscreteStencil (const weight_t &zero=weight_t()) | |
DiscreteStencil (std::size_t nItems, const weight_t &zero=weight_t()) | |
DiscreteStencil (std::size_t size, const long *pattern, const weight_t &zero=weight_t()) | |
DiscreteStencil (std::size_t size, const long *pattern, const weight_t *weights, const weight_t &zero=weight_t()) | |
void | addComplementToZero (long id) |
void | appendItem (long id, const weight_t &weight) |
void | appendItem (long id, weight_t &&weight) |
weight_t & | at (long id) |
const weight_t & | at (long id) const |
void | clear (bool release=false) |
void | display (std::ostream &out, double factor=1.) const |
size_t | getBinarySize () const |
weight_t & | getConstant () |
const weight_t & | getConstant () const |
long & | getPattern (std::size_t pos) |
const long & | getPattern (std::size_t pos) const |
weight_t & | getWeight (std::size_t pos) |
const weight_t & | getWeight (std::size_t pos) const |
void | initialize (const DiscreteStencil< weight_t, value_t > &other) |
void | initialize (std::size_t nItems, const weight_t &zero=weight_t()) |
void | initialize (std::size_t size, const long *pattern, const weight_t &zero=weight_t()) |
void | initialize (std::size_t size, const long *pattern, const weight_t *weights, const weight_t &zero=weight_t()) |
DiscreteStencil< weight_t, value_t > & | operator*= (double factor) |
DiscreteStencil< weight_t, value_t > & | operator+= (const DiscreteStencil< weight_t, value_t > &other) |
DiscreteStencil< weight_t, value_t > & | operator-= (const DiscreteStencil< weight_t, value_t > &other) |
DiscreteStencil< weight_t, value_t > & | operator/= (double factor) |
weight_t & | operator[] (long id) |
void | optimize (double tolerance=1.e-12) |
long * | patternData () |
const long * | patternData () const |
template<typename Mapper > | |
void | renumber (const Mapper &mapper) |
void | renumber (const std::unordered_map< long, long > &map) |
void | reserve (std::size_t nItems) |
void | resize (std::size_t nItems) |
void | setConstant (const weight_t &constant) |
void | setConstant (weight_t &&constant) |
void | setItem (std::size_t pos, long id, const weight_t &weight) |
void | setItem (std::size_t pos, long id, weight_t &&weight) |
void | setPattern (std::size_t pos, long id) |
void | setWeight (std::size_t pos, const weight_t &weight) |
void | setWeight (std::size_t pos, weight_t &&weight) |
std::size_t | size () const |
void | sum (const DiscreteStencil< weight_t, value_t > &other, double factor) |
void | sumConstant (const weight_t &constant, double factor=1.) |
void | sumItem (long id, const weight_t &weight, double factor=1.) |
void | sumWeight (std::size_t pos, const weight_t &weight, double factor=1.) |
weight_t * | weightData () |
const weight_t * | weightData () const |
void | zero () |
void | zeroConstant () |
void | zeroWeight (std::size_t pos) |
Protected Member Functions | |
void | appendWeight (const weight_t &weight) override |
void | clearWeights (bool release) override |
Protected Member Functions inherited from bitpit::DiscreteStencil< weight_t, value_t > | |
virtual void | appendWeight (weight_t &&weight) |
Protected Attributes | |
weight_pool_type * | m_weightPool |
Protected Attributes inherited from bitpit::DiscreteStencil< weight_t, value_t > | |
weight_t | m_constant |
std::vector< long > | m_pattern |
std::vector< weight_t > | m_weights |
weight_t | m_zero |
Additional Inherited Members | |
Static Public Member Functions inherited from bitpit::DiscreteStencil< weight_t, value_t > | |
static const weight_manager_type & | getWeightManager () |
Public Attributes inherited from bitpit::DiscreteStencil< weight_t, value_t > | |
long | NULL_ID = - std::numeric_limits<long>::max() |
Static Protected Attributes inherited from bitpit::DiscreteStencil< weight_t, value_t > | |
static const weight_manager_type | m_weightManager = typename DiscreteStencil<weight_t>::weight_manager_type() |
Metafunction for generating a discretization stencil with a memory pool (MP).
weight_t | is the type of the weights stored in the stencil |
Definition at line 182 of file stencil.hpp.
typedef DiscreteStencilWeightPool<weight_t> bitpit::MPDiscreteStencil< weight_t, value_t >::weight_pool_type |
Definition at line 186 of file stencil.hpp.
bitpit::MPDiscreteStencil< weight_t, value_t >::MPDiscreteStencil | ( | const weight_t & | zero = weight_t() | ) |
Constructor
zero | is the value to be used as zero |
Definition at line 962 of file stencil.tpp.
bitpit::MPDiscreteStencil< weight_t, value_t >::MPDiscreteStencil | ( | std::size_t | size, |
const weight_t & | zero = weight_t() ) |
Constructor
size | is the stencil size, expressed in number of elements |
zero | is the value to be used as zero |
Definition at line 975 of file stencil.tpp.
bitpit::MPDiscreteStencil< weight_t, value_t >::MPDiscreteStencil | ( | std::size_t | size, |
const long * | pattern, | ||
const weight_t & | zero = weight_t() ) |
Constructor
size | is the stencil size, expressed in number of elements |
pattern | is the patterns of the stencil |
zero | is the value to be used as zero |
Definition at line 989 of file stencil.tpp.
bitpit::MPDiscreteStencil< weight_t, value_t >::MPDiscreteStencil | ( | std::size_t | size, |
const long * | pattern, | ||
const weight_t * | weights, | ||
const weight_t & | zero = weight_t() ) |
Constructor
size | is the stencil size, expressed in number of elements |
pattern | is the patterns of the stencil |
weights | are the weights of the stencil |
zero | is the value to be used as zero |
Definition at line 1004 of file stencil.tpp.
|
overrideprotectedvirtual |
Append a weight to the stencil.
weight | is the weight that will be appended |
Reimplemented from bitpit::DiscreteStencil< weight_t, value_t >.
Definition at line 1028 of file stencil.tpp.
|
overrideprotectedvirtual |
Clears the weights of the stencil.
Removes all weights from the stencil (which are destroyed), leaving the weight container with a size of 0.
release | if it's true the memory hold by the weight container will be released, otherwise the weight container will be cleared but its memory will not be relased |
Reimplemented from bitpit::DiscreteStencil< weight_t, value_t >.
Definition at line 1049 of file stencil.tpp.
void bitpit::MPDiscreteStencil< weight_t, value_t >::setWeightPool | ( | weight_pool_type * | pool | ) |
Set the weight pool.
pool | is the weight pool that will be used |
Definition at line 1017 of file stencil.tpp.
|
protected |
Definition at line 196 of file stencil.hpp.