OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
PointIterator< dim, T, Decomposition > Class Template Reference

this class draw particles on subset of grid-like position More...

Detailed Description

template<unsigned int dim, typename T, typename Decomposition>
class PointIterator< dim, T, Decomposition >

this class draw particles on subset of grid-like position

                  Point B
                    |                 (0.6,0.6)
  +   +   +   +   + |  +   +   +   +
    +---------------+
  + | +   +   +   + | +   +   +   +
    |               |
  + | +   +   +   + | +   +   +   +
    |               |
  + | +   +   +   + | +   +   +   +
    |               |
  + | +   +   +   + | +   +   +   +
    |               |
  + | +   +   +   + | +   +   +   +
    |               |
  + | +   +   +   + | +   +   +   +
    |               |
  + | +   +   +   + | +   +   +   +
    +---------------+
  +   +   +   +   + ^ +   +   +   +
(-1.0,-1.0)         |
                    |
                   (Point A)
Suppose we have a grid 9x9 from (-1.0,-1.0 to 0.6,0.6)

Defined a Box (-0.9,-0.9 to -0.1,0.5)

This class will return the points

(-0.8 -0.8)
(-0.6 -0.8)
(-0.4 -0.8)
...
(-0.1,-0.8) Point A
...
(-0.1,0.5) Point B

Definition at line 58 of file PointIterator.hpp.

#include <PointIterator.hpp>

+ Inheritance diagram for PointIterator< dim, T, Decomposition >:

Public Member Functions

 PointIterator (Decomposition &dec, size_t(&sz)[dim], const Box< dim, T > &domain, Box< dim, T > &sub_domain)
 Draw Particles. More...
 
Point< dim, T > & get ()
 
PointIteratoroperator++ ()
 Next point. More...
 
bool isNext ()
 
Box< dim, T > getBoxMargins ()
 Return the real Margin of the box. More...
 

Private Member Functions

void calculateAp ()
 

Static Private Member Functions

static grid_key_dx< dim > getStart (size_t(&gs)[dim], const Box< dim, T > &dom, Box< dim, T > &sub_dom, T(&sp)[dim])
 
static grid_key_dx< dim > getStop (size_t(&gs)[dim], const Box< dim, T > &dom, Box< dim, T > &sub_dom, T(&sp)[dim])
 

Private Attributes

Point< dim, T > ap
 Actual point.
 
Box< dim, T > sub_domain
 sub_domain
 
Box< dim, T > domain
 domain
 
sp [dim]
 Spacing.
 

Additional Inherited Members

- Protected Member Functions inherited from grid_dist_id_iterator_dec< Decomposition >
grid_dist_id_iterator_dec
< Decomposition > & 
operator= (const grid_dist_id_iterator_dec< Decomposition > &tmp)
 Copy operator=. More...
 
 grid_dist_id_iterator_dec (const grid_dist_id_iterator_dec< Decomposition > &tmp)
 Copy constructor. More...
 
 grid_dist_id_iterator_dec (Decomposition &dec, const size_t(&sz)[Decomposition::dims])
 Constructor of the distributed grid iterator. More...
 
 grid_dist_id_iterator_dec (Decomposition &dec, const size_t(&sz)[Decomposition::dims], grid_key_dx< Decomposition::dims > start, grid_key_dx< Decomposition::dims > stop)
 Constructor of the distributed grid iterator. More...
 
grid_dist_id_iterator_dec
< Decomposition > & 
operator++ ()
 Get the next element. More...
 
bool isNext ()
 Check if there is the next element. More...
 
Decomposition::stype getSpacing (size_t i)
 Get the spacing of the grid. More...
 
grid_key_dx< Decomposition::dims > get ()
 Get the actual global key of the grid. More...
 
grid_dist_key_dx
< Decomposition::dims > 
get_dist ()
 Get the actual grid key for a distributed grid. More...
 
grid_key_dx< Decomposition::dims > getStart ()
 Get the starting point of the sub-grid we are iterating. More...
 
grid_key_dx< Decomposition::dims > getStop ()
 Get the starting point of the sub-grid we are iterating. More...
 

Constructor & Destructor Documentation

template<unsigned int dim, typename T , typename Decomposition >
PointIterator< dim, T, Decomposition >::PointIterator ( Decomposition dec,
size_t(&)  sz[dim],
const Box< dim, T > &  domain,
Box< dim, T > &  sub_domain 
)
inline

Draw Particles.

Parameters
spgrid spacing

Definition at line 116 of file PointIterator.hpp.

Member Function Documentation

template<unsigned int dim, typename T , typename Decomposition >
Point<dim,T>& PointIterator< dim, T, Decomposition >::get ( )
inline

the actual point

Definition at line 126 of file PointIterator.hpp.

template<unsigned int dim, typename T , typename Decomposition >
Box<dim,T> PointIterator< dim, T, Decomposition >::getBoxMargins ( )
inline

Return the real Margin of the box.

For example consider to have a domain (0.0,0.0) to (1.0,1.0) 11 points in each direction (spacing 0.1). if we have a sub-domain (0.15,0.15) to (0.55,0.55) getBoxMargins return the box (0.2,0.2) to (0.5,0.5). the smallest box that enclose the points that the point iterator is going to give

Definition at line 159 of file PointIterator.hpp.

template<unsigned int dim, typename T , typename Decomposition >
PointIterator& PointIterator< dim, T, Decomposition >::operator++ ( )
inline

Next point.

Returns
itself

Definition at line 136 of file PointIterator.hpp.


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