Metafunction for generating a discretization stencil with a memory pool (MP). More...
#include <stencil.hpp>


Public Types | |
typedef DiscreteStencilWeightPool< weight_t > | weight_pool_type |
![]() | |
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) |
![]() | |
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 |
![]() | |
virtual void | appendWeight (weight_t &&weight) |
Protected Attributes | |
weight_pool_type * | m_weightPool |
![]() | |
weight_t | m_constant |
std::vector< long > | m_pattern |
std::vector< weight_t > | m_weights |
weight_t | m_zero |
Additional Inherited Members | |
![]() | |
static const weight_manager_type & | getWeightManager () |
![]() | |
long | NULL_ID = - std::numeric_limits<long>::max() |
![]() | |
static const weight_manager_type | m_weightManager |
Detailed Description
class bitpit::MPDiscreteStencil< weight_t, value_t >
Metafunction for generating a discretization stencil with a memory pool (MP).
- Template Parameters
-
weight_t is the type of the weights stored in the stencil
Definition at line 182 of file stencil.hpp.
Member Typedef Documentation
◆ weight_pool_type
typedef DiscreteStencilWeightPool<weight_t> bitpit::MPDiscreteStencil< weight_t, value_t >::weight_pool_type |
Definition at line 186 of file stencil.hpp.
Constructor & Destructor Documentation
◆ MPDiscreteStencil() [1/4]
bitpit::MPDiscreteStencil< weight_t, value_t >::MPDiscreteStencil | ( | const weight_t & | zero = weight_t() | ) |
Constructor
- Parameters
-
zero is the value to be used as zero
Definition at line 962 of file stencil.tpp.
◆ MPDiscreteStencil() [2/4]
bitpit::MPDiscreteStencil< weight_t, value_t >::MPDiscreteStencil | ( | std::size_t | size, |
const weight_t & | zero = weight_t() ) |
Constructor
- Parameters
-
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.
◆ MPDiscreteStencil() [3/4]
bitpit::MPDiscreteStencil< weight_t, value_t >::MPDiscreteStencil | ( | std::size_t | size, |
const long * | pattern, | ||
const weight_t & | zero = weight_t() ) |
Constructor
- Parameters
-
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.
◆ MPDiscreteStencil() [4/4]
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
- Parameters
-
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.
Member Function Documentation
◆ appendWeight()
|
overrideprotectedvirtual |
Append a weight to the stencil.
- Parameters
-
weight is the weight that will be appended
Reimplemented from bitpit::DiscreteStencil< weight_t, value_t >.
Definition at line 1028 of file stencil.tpp.
◆ clearWeights()
|
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.
- Parameters
-
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.
◆ setWeightPool()
void bitpit::MPDiscreteStencil< weight_t, value_t >::setWeightPool | ( | weight_pool_type * | pool | ) |
Set the weight pool.
- Parameters
-
pool is the weight pool that will be used
Definition at line 1017 of file stencil.tpp.
Member Data Documentation
◆ m_weightPool
|
protected |
Definition at line 196 of file stencil.hpp.
The documentation for this class was generated from the following files:
- src/discretization/stencil.hpp
- src/discretization/stencil.tpp
