OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
grid_key_sparse_dx_iterator_sub< dim, n_ele > Class Template Reference

Grid key sparse iterator on a sub-part of the domain. More...

Detailed Description

template<unsigned dim, unsigned int n_ele>
class grid_key_sparse_dx_iterator_sub< dim, n_ele >

Grid key sparse iterator on a sub-part of the domain.

Definition at line 148 of file SparseGrid_iterator.hpp.

#include <SparseGrid_iterator.hpp>

Public Member Functions

 grid_key_sparse_dx_iterator_sub ()
 Default constructor.
 
 grid_key_sparse_dx_iterator_sub (const openfpm::vector< mheader< n_ele > > &header_mask, const openfpm::vector< cheader< dim > > &header_inf, const grid_key_dx< dim >(&lin_id_pos)[n_ele], const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop, const size_t(&sz_cnk)[dim])
 
void reinitialize (const grid_key_sparse_dx_iterator_sub< dim, n_ele > &g_s_it)
 Reinitialize the iterator.
 
grid_key_sparse_dx_iterator_sub< dim, n_ele > & operator++ ()
 
grid_key_dx< dim > get () const
 Return the position of the actual point in coordinates.
 
grid_key_sparse_lin_dx getKeyF ()
 Return the actual point linearized.
 
bool isNext ()
 Return true if there is a next grid point.
 
const grid_key_dx< dim > & getStart () const
 Return the starting point for the iteration.
 
const grid_key_dx< dim > & getStop () const
 Return the stop point for the iteration.
 
const openfpm::vector< cheader< dim > > * private_get_header_inf () const
 Return the private member header.
 
const openfpm::vector< mheader< n_ele > > * private_get_header_mask () const
 Return the private member header.
 
const grid_key_dx< dim >(* private_get_lin_id_pos () const)[n_ele]
 Return the private member lin_id_pos.
 
size_t private_get_chunk_id () const
 Return the private member chunk_id.
 
size_t private_get_mask_nele () const
 Return the private member mask_nele.
 
size_t private_get_mask_it_pnt () const
 Return the private member mask_it_pnt.
 
const short unsigned int(& private_get_mask_it () const)[n_ele]
 Return the private member mask_it.
 

Private Member Functions

void SelectValidAndFill_mask_it ()
 Everytime we move to a new chunk we calculate on which indexes we have to iterate.
 

Private Attributes

const openfpm::vector< mheader< n_ele > > * header_mask
 It store the information of each chunk mask.
 
const openfpm::vector< cheader< dim > > * header_inf
 it store the information of each chunk
 
const grid_key_dx< dim >(* lin_id_pos )[n_ele]
 linearized id to position in coordinates conversion
 
size_t chunk_id
 point to the actual chunk
 
size_t mask_nele
 Number of points in mask_it.
 
size_t mask_it_pnt
 Actual point in mask it.
 
grid_key_dx< dim > start
 Starting point.
 
grid_key_dx< dim > stop
 Stop point.
 
Box< dim, size_t > bx
 Sub-grid box.
 
size_t sz_cnk [dim]
 Chunk size.
 
short unsigned int mask_it [n_ele]
 set of index in the chunk on which we have to iterate
 

Static Private Attributes

static const int cnk_pos = 0
 
static const int cnk_nele = 1
 
static const int cnk_mask = 2
 

Constructor & Destructor Documentation

◆ grid_key_sparse_dx_iterator_sub() [1/2]

template<unsigned dim, unsigned int n_ele>
grid_key_sparse_dx_iterator_sub< dim, n_ele >::grid_key_sparse_dx_iterator_sub ( )
inline

Default constructor.

Warning
extremely unsafe If you use this constructor before use the iterator you should call reinitialize first

Definition at line 231 of file SparseGrid_iterator.hpp.

◆ grid_key_sparse_dx_iterator_sub() [2/2]

template<unsigned dim, unsigned int n_ele>
grid_key_sparse_dx_iterator_sub< dim, n_ele >::grid_key_sparse_dx_iterator_sub ( const openfpm::vector< mheader< n_ele > > &  header_mask,
const openfpm::vector< cheader< dim > > &  header_inf,
const grid_key_dx< dim >(&)  lin_id_pos[n_ele],
const grid_key_dx< dim > &  start,
const grid_key_dx< dim > &  stop,
const size_t(&)  sz_cnk[dim] 
)
inline

Definition at line 233 of file SparseGrid_iterator.hpp.

Member Function Documentation

◆ get()

template<unsigned dim, unsigned int n_ele>
grid_key_dx< dim > grid_key_sparse_dx_iterator_sub< dim, n_ele >::get ( ) const
inline

Return the position of the actual point in coordinates.

Returns
the position

Definition at line 304 of file SparseGrid_iterator.hpp.

◆ getKeyF()

template<unsigned dim, unsigned int n_ele>
grid_key_sparse_lin_dx grid_key_sparse_dx_iterator_sub< dim, n_ele >::getKeyF ( )
inline

Return the actual point linearized.

The disadvantage is that in general you cannot use move in this type of key

Returns
the actual point

Definition at line 325 of file SparseGrid_iterator.hpp.

◆ getStart()

template<unsigned dim, unsigned int n_ele>
const grid_key_dx< dim > & grid_key_sparse_dx_iterator_sub< dim, n_ele >::getStart ( ) const
inline

Return the starting point for the iteration.

Returns
the starting point

Definition at line 345 of file SparseGrid_iterator.hpp.

◆ getStop()

template<unsigned dim, unsigned int n_ele>
const grid_key_dx< dim > & grid_key_sparse_dx_iterator_sub< dim, n_ele >::getStop ( ) const
inline

Return the stop point for the iteration.

Returns
the stop point

Definition at line 355 of file SparseGrid_iterator.hpp.

◆ isNext()

template<unsigned dim, unsigned int n_ele>
bool grid_key_sparse_dx_iterator_sub< dim, n_ele >::isNext ( )
inline

Return true if there is a next grid point.

Returns
true if there is the next grid point

Definition at line 335 of file SparseGrid_iterator.hpp.

◆ operator++()

template<unsigned dim, unsigned int n_ele>
grid_key_sparse_dx_iterator_sub< dim, n_ele > & grid_key_sparse_dx_iterator_sub< dim, n_ele >::operator++ ( )
inline

Definition at line 278 of file SparseGrid_iterator.hpp.

◆ private_get_chunk_id()

template<unsigned dim, unsigned int n_ele>
size_t grid_key_sparse_dx_iterator_sub< dim, n_ele >::private_get_chunk_id ( ) const
inline

Return the private member chunk_id.

Returns
chunk_id

Definition at line 389 of file SparseGrid_iterator.hpp.

◆ private_get_header_inf()

template<unsigned dim, unsigned int n_ele>
const openfpm::vector< cheader< dim > > * grid_key_sparse_dx_iterator_sub< dim, n_ele >::private_get_header_inf ( ) const
inline

Return the private member header.

Returns
header

Definition at line 365 of file SparseGrid_iterator.hpp.

◆ private_get_header_mask()

template<unsigned dim, unsigned int n_ele>
const openfpm::vector< mheader< n_ele > > * grid_key_sparse_dx_iterator_sub< dim, n_ele >::private_get_header_mask ( ) const
inline

Return the private member header.

Returns
header

Definition at line 373 of file SparseGrid_iterator.hpp.

◆ private_get_lin_id_pos()

template<unsigned dim, unsigned int n_ele>
const grid_key_dx< dim >(* grid_key_sparse_dx_iterator_sub< dim, n_ele >::private_get_lin_id_pos ( ) )[n_ele]
inline

Return the private member lin_id_pos.

Returns
lin_id_pos

Definition at line 381 of file SparseGrid_iterator.hpp.

◆ private_get_mask_it()

template<unsigned dim, unsigned int n_ele>
const short unsigned int(& grid_key_sparse_dx_iterator_sub< dim, n_ele >::private_get_mask_it ( ) )[n_ele]
inline

Return the private member mask_it.

Returns
mask_it

Definition at line 414 of file SparseGrid_iterator.hpp.

◆ private_get_mask_it_pnt()

template<unsigned dim, unsigned int n_ele>
size_t grid_key_sparse_dx_iterator_sub< dim, n_ele >::private_get_mask_it_pnt ( ) const
inline

Return the private member mask_it_pnt.

Returns
mask_it_pnt

Definition at line 406 of file SparseGrid_iterator.hpp.

◆ private_get_mask_nele()

template<unsigned dim, unsigned int n_ele>
size_t grid_key_sparse_dx_iterator_sub< dim, n_ele >::private_get_mask_nele ( ) const
inline

Return the private member mask_nele.

Returns
mask_nele

Definition at line 397 of file SparseGrid_iterator.hpp.

◆ reinitialize()

template<unsigned dim, unsigned int n_ele>
void grid_key_sparse_dx_iterator_sub< dim, n_ele >::reinitialize ( const grid_key_sparse_dx_iterator_sub< dim, n_ele > &  g_s_it)
inline

Reinitialize the iterator.

it re-initialize the iterator with the passed grid_key_dx_iterator_sub the actual position of the grid_key_dx_iterator_sub is ignored

Parameters
g_s_itgrid_key_dx_iterator_sub

Definition at line 261 of file SparseGrid_iterator.hpp.

◆ SelectValidAndFill_mask_it()

template<unsigned dim, unsigned int n_ele>
void grid_key_sparse_dx_iterator_sub< dim, n_ele >::SelectValidAndFill_mask_it ( )
inlineprivate

Everytime we move to a new chunk we calculate on which indexes we have to iterate.

Definition at line 191 of file SparseGrid_iterator.hpp.

Field Documentation

◆ bx

template<unsigned dim, unsigned int n_ele>
Box<dim,size_t> grid_key_sparse_dx_iterator_sub< dim, n_ele >::bx
private

Sub-grid box.

Definition at line 179 of file SparseGrid_iterator.hpp.

◆ chunk_id

template<unsigned dim, unsigned int n_ele>
size_t grid_key_sparse_dx_iterator_sub< dim, n_ele >::chunk_id
private

point to the actual chunk

Definition at line 164 of file SparseGrid_iterator.hpp.

◆ cnk_mask

template<unsigned dim, unsigned int n_ele>
const int grid_key_sparse_dx_iterator_sub< dim, n_ele >::cnk_mask = 2
staticprivate

Definition at line 152 of file SparseGrid_iterator.hpp.

◆ cnk_nele

template<unsigned dim, unsigned int n_ele>
const int grid_key_sparse_dx_iterator_sub< dim, n_ele >::cnk_nele = 1
staticprivate

Definition at line 151 of file SparseGrid_iterator.hpp.

◆ cnk_pos

template<unsigned dim, unsigned int n_ele>
const int grid_key_sparse_dx_iterator_sub< dim, n_ele >::cnk_pos = 0
staticprivate

Definition at line 150 of file SparseGrid_iterator.hpp.

◆ header_inf

template<unsigned dim, unsigned int n_ele>
const openfpm::vector<cheader<dim> >* grid_key_sparse_dx_iterator_sub< dim, n_ele >::header_inf
private

it store the information of each chunk

Definition at line 158 of file SparseGrid_iterator.hpp.

◆ header_mask

template<unsigned dim, unsigned int n_ele>
const openfpm::vector<mheader<n_ele> >* grid_key_sparse_dx_iterator_sub< dim, n_ele >::header_mask
private

It store the information of each chunk mask.

Definition at line 155 of file SparseGrid_iterator.hpp.

◆ lin_id_pos

template<unsigned dim, unsigned int n_ele>
const grid_key_dx<dim>(* grid_key_sparse_dx_iterator_sub< dim, n_ele >::lin_id_pos)[n_ele]
private

linearized id to position in coordinates conversion

Definition at line 161 of file SparseGrid_iterator.hpp.

◆ mask_it

template<unsigned dim, unsigned int n_ele>
short unsigned int grid_key_sparse_dx_iterator_sub< dim, n_ele >::mask_it[n_ele]
private

set of index in the chunk on which we have to iterate

Definition at line 185 of file SparseGrid_iterator.hpp.

◆ mask_it_pnt

template<unsigned dim, unsigned int n_ele>
size_t grid_key_sparse_dx_iterator_sub< dim, n_ele >::mask_it_pnt
private

Actual point in mask it.

Definition at line 170 of file SparseGrid_iterator.hpp.

◆ mask_nele

template<unsigned dim, unsigned int n_ele>
size_t grid_key_sparse_dx_iterator_sub< dim, n_ele >::mask_nele
private

Number of points in mask_it.

Definition at line 167 of file SparseGrid_iterator.hpp.

◆ start

template<unsigned dim, unsigned int n_ele>
grid_key_dx<dim> grid_key_sparse_dx_iterator_sub< dim, n_ele >::start
private

Starting point.

Definition at line 173 of file SparseGrid_iterator.hpp.

◆ stop

template<unsigned dim, unsigned int n_ele>
grid_key_dx<dim> grid_key_sparse_dx_iterator_sub< dim, n_ele >::stop
private

Stop point.

Definition at line 176 of file SparseGrid_iterator.hpp.

◆ sz_cnk

template<unsigned dim, unsigned int n_ele>
size_t grid_key_sparse_dx_iterator_sub< dim, n_ele >::sz_cnk[dim]
private

Chunk size.

Definition at line 182 of file SparseGrid_iterator.hpp.


The documentation for this class was generated from the following file: