ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
packing.hpp File Reference
#include <cstddef>
#include <cstring>
+ Include dependency graph for packing.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename FloatType >
void fft_pack_block (FloatType const *const in, FloatType *const out, int const *start, int const *size, int const *dim, int element)
 Pack a 3D-block of size size starting at start of an input 3D-grid in with dimension dim into an output 3D-block out.
 
template<typename FloatType >
void fft_unpack_block (FloatType const *const in, FloatType *const out, int const *start, int const *size, int const *dim, int element)
 Unpack a 3D-block in of size size into an output 3D-grid out of size dim starting at position start.
 

Function Documentation

◆ fft_pack_block()

template<typename FloatType >
void fft_pack_block ( FloatType const *const  in,
FloatType *const  out,
int const *  start,
int const *  size,
int const *  dim,
int  element 
)

Pack a 3D-block of size size starting at start of an input 3D-grid in with dimension dim into an output 3D-block out.

The block is stored in 'row-major-order' or 'C-order', that means the first index is changing slowest when running through the linear array. The element (i0 (slow), i1 (mid), i2 (fast)) has the linear index li = i2 + size[2] * (i1 + (size[1] * i0)).

Parameters
[in]inpointer to input 3D-grid.
[out]outpointer to output 3D-block.
[in]startstart index of the block in the input 3D-grid.
[in]sizesize of the output 3D-block.
[in]dimsize of the input 3D-grid.
[in]elementsize of a grid element (e.g. 1 for Real, 2 for Complex).

Definition at line 44 of file packing.hpp.

Referenced by p3m_send_mesh< FloatType >::gather_grid(), fft::fft_data_struct< FloatType >::initialize_fft(), and p3m_send_mesh< FloatType >::spread_grid().

◆ fft_unpack_block()

template<typename FloatType >
void fft_unpack_block ( FloatType const *const  in,
FloatType *const  out,
int const *  start,
int const *  size,
int const *  dim,
int  element 
)

Unpack a 3D-block in of size size into an output 3D-grid out of size dim starting at position start.

See also fft_pack_block.

Parameters
[in]inpointer to input 3D-block.
[out]outpointer to output 3D-grid.
[in]startstart index of the block in the input 3D-grid.
[in]sizesize of the input 3D-block.
[in]dimsize of the output 3D-grid.
[in]elementsize of a grid element (e.g. 1 for Real, 2 for Complex).

Definition at line 83 of file packing.hpp.

Referenced by p3m_send_mesh< FloatType >::spread_grid().