Public Member Functions | |
DiscreteStencilWeightPool (std::size_t capacity=128) | |
std::size_t | capacity () const |
void | clear (bool release) |
weight_t | retrieve () |
std::size_t | size () const |
void | store (std::vector< weight_t > *weights) |
void | store (weight_t &&weight) |
Detailed Description
class bitpit::DiscreteStencilWeightPool< weight_t >
Definition at line 37 of file stencil_weight.hpp.
Constructor & Destructor Documentation
◆ DiscreteStencilWeightPool()
bitpit::DiscreteStencilWeightPool< weight_t >::DiscreteStencilWeightPool | ( | std::size_t | capacity = 128 | ) |
Constructor.
- Parameters
-
capacity is the maximum number of weights that can be stored in the pool
Definition at line 37 of file stencil_weight.tpp.
Member Function Documentation
◆ capacity()
std::size_t bitpit::DiscreteStencilWeightPool< weight_t >::capacity | ( | ) | const |
Get the capacity of the pool.
The capacity represents the maximum number of weights that can be stored in the pool.
- Parameters
-
size The capacity of the pool.
Definition at line 64 of file stencil_weight.tpp.
◆ clear()
void bitpit::DiscreteStencilWeightPool< weight_t >::clear | ( | bool | release | ) |
Clear the pool.
Removes all weights from the pool (which are destroyed), leaving it with a size of 0.
- Parameters
-
release if it's true the memory hold by the pool will be released, otherwise the pool will be cleared but its memory will not be relased
Definition at line 80 of file stencil_weight.tpp.
◆ retrieve()
weight_t bitpit::DiscreteStencilWeightPool< weight_t >::retrieve | ( | ) |
Retrieve a weight from the pool.
If the pool is empty, an exception is thrown.
- Returns
- The weight retrieved from the pool.
Definition at line 96 of file stencil_weight.tpp.
◆ size()
std::size_t bitpit::DiscreteStencilWeightPool< weight_t >::size | ( | ) | const |
Get the size of the pool.
The size represents the number of weights currently stored in the pool.
- Parameters
-
size The size of the pool.
Definition at line 50 of file stencil_weight.tpp.
◆ store() [1/2]
void bitpit::DiscreteStencilWeightPool< weight_t >::store | ( | std::vector< weight_t > * | weights | ) |
Store the given weights in the pool.
- Parameters
-
weights are the weight that will be stored in the pool
Definition at line 129 of file stencil_weight.tpp.
◆ store() [2/2]
void bitpit::DiscreteStencilWeightPool< weight_t >::store | ( | weight_t && | weight | ) |
Store the given weight in the pool.
- Parameters
-
weight is the weight that will be stored in the pool
Definition at line 114 of file stencil_weight.tpp.
The documentation for this class was generated from the following files:
- src/discretization/stencil_weight.hpp
- src/discretization/stencil_weight.tpp
