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

This class calculate processor domains and neighborhood of each processor domain. More...

Detailed Description

template<unsigned int dim>
class domain_nn_calculator_cart< dim >

This class calculate processor domains and neighborhood of each processor domain.

Parameters
dimDimensionality

Definition at line 21 of file Domain_NN_calculator_cart.hpp.

#include <Domain_NN_calculator_cart.hpp>

+ Inheritance diagram for domain_nn_calculator_cart< dim >:

Public Member Functions

void setParameters (const Box< dim, long int > &proc_box)
 Set parameters to calculate the cell neighborhood.
 
void setNNParameters (openfpm::vector<::Box< dim, size_t > > &loc_box, const grid_key_dx< dim > &shift, const grid_sm< dim, void > &gs)
 Set parameters to calculate the cell neighborhood.
 
openfpm::vector< size_t > & getDomainCells ()
 Get the domain Cells.
 
openfpm::vector< size_t > & getCRSDomainCells ()
 Get the domain Cells.
 
openfpm::vector< subsub_lin< dim > > & getCRSAnomDomainCells ()
 Get the domain anomalous cells.
 
void reset ()
 In case you have to recompute the indexes.
 

Private Member Functions

void CalculateDomAndAnomCells (openfpm::vector< subsub< dim > > &sub_keys, openfpm::vector< grid_key_dx< dim > > &dom_subsub, openfpm::vector< grid_key_dx< dim > > &dom_cells, const ::Box< dim, long int > &proc_box, const openfpm::vector<::Box< dim, size_t > > &loc_box)
 Calculate the subdomain that are in the skin part of the domain.
 
void linearize_subsub (const openfpm::vector< subsub< dim > > &anom, openfpm::vector< subsub_lin< dim > > &anom_lin, const grid_key_dx< dim > &shift, const grid_sm< dim, void > &gs)
 Linearize the sub-sub-domains ids.
 

Private Attributes

bool are_domain_anom_computed
 True if domain and anomalous domain cells are computed.
 
openfpm::vector< subsub< dim > > anom
 anomalous cell neighborhood for CRS
 
openfpm::vector< subsub_lin< dim > > anom_lin
 Set of anomalous CRS domain cells linearized.
 
openfpm::vector< grid_key_dx< dim > > dom
 Set of normal domain cells for CRS.
 
openfpm::vector< size_t > dom_lin
 Set of normal CRS domain cells linearized.
 
openfpm::vector< grid_key_dx< dim > > dom_cells
 Set of domain cells.
 
openfpm::vector< size_t > dom_cells_lin
 Set of linearized domain cells.
 
Box< dim, long int > proc_box
 Processor box.
 
grid_sm< dim, void > gs
 Processor cells-grid.
 
grid_key_dx< dim > one
 key with all coordinates set to one
 

Constructor & Destructor Documentation

◆ domain_nn_calculator_cart()

template<unsigned int dim>
domain_nn_calculator_cart< dim >::domain_nn_calculator_cart ( )
inline

Definition at line 250 of file Domain_NN_calculator_cart.hpp.

Member Function Documentation

◆ CalculateDomAndAnomCells()

template<unsigned int dim>
void domain_nn_calculator_cart< dim >::CalculateDomAndAnomCells ( openfpm::vector< subsub< dim > > &  sub_keys,
openfpm::vector< grid_key_dx< dim > > &  dom_subsub,
openfpm::vector< grid_key_dx< dim > > &  dom_cells,
const ::Box< dim, long int > &  proc_box,
const openfpm::vector<::Box< dim, size_t > > &  loc_box 
)
inlineprivate

Calculate the subdomain that are in the skin part of the domain.

 +---+---+---+---+---+---+
 | 1 | 2 | 3 | 4 | 5 | 6 |
 +---+---+---+---+---+---+
 |27 |               | 7 |
 +---+               +---+
 |26 |               | 8 |
 +---+               +---+
 |25 |               | 9 |
 +---+   DOM1        +---+
 |24 |               |10 |
 +---+               +---+
 |23 |               |11 |
 +---+               +---+
 |22 |               |12 |
 +---+-----------+---+---+
 |21 |           |13 |
 +---+           +---+
 |20 |   DOM2    |14 |
 +---+---+---+---+---+
 |19 |18 |17 | 16|15 |
 +---+---+---+---+---+    <----- Domain end here
                               |
                 ^             |
                 |_____________|

In some cases like symmetric with CRS Scheme The cells indicated with numbers has a non straigh-forward neighborhood. This function calculate the list of the domain cells with normal symmetric neighborhood type and compute a list of cells with more complex neighboring cells.

Parameters
sub_keysarray that contain the position of the sub-sub-domains indicated with numbers in grid coordinates + for each its neighboring cells
dom_cellslist of all the domain cells
dom_subsubcells with normal neighborhood
loc_boxarray of local sub-sub-domain in grid coordinates
proc_boxProcessor bounding box in local coordinates

Definition at line 108 of file Domain_NN_calculator_cart.hpp.

◆ getCRSAnomDomainCells()

template<unsigned int dim>
openfpm::vector< subsub_lin< dim > > & domain_nn_calculator_cart< dim >::getCRSAnomDomainCells ( )
inline

Get the domain anomalous cells.

Returns
The set of anomalous cells

Definition at line 328 of file Domain_NN_calculator_cart.hpp.

◆ getCRSDomainCells()

template<unsigned int dim>
openfpm::vector< size_t > & domain_nn_calculator_cart< dim >::getCRSDomainCells ( )
inline

Get the domain Cells.

Returns
The set of domain cells

Definition at line 317 of file Domain_NN_calculator_cart.hpp.

◆ getDomainCells()

template<unsigned int dim>
openfpm::vector< size_t > & domain_nn_calculator_cart< dim >::getDomainCells ( )
inline

Get the domain Cells.

Returns
The set of domain cells

Definition at line 306 of file Domain_NN_calculator_cart.hpp.

◆ linearize_subsub()

template<unsigned int dim>
void domain_nn_calculator_cart< dim >::linearize_subsub ( const openfpm::vector< subsub< dim > > &  anom,
openfpm::vector< subsub_lin< dim > > &  anom_lin,
const grid_key_dx< dim > &  shift,
const grid_sm< dim, void > &  gs 
)
inlineprivate

Linearize the sub-sub-domains ids.

A subsub domain can be identified by a set of number (i,j). The linearization transform it into a number

Parameters
anomset of grid keys to linearize
anom_linlinearized output
shiftshifting to add for the linearizaton
gsinformation about the grid to linearize

Definition at line 212 of file Domain_NN_calculator_cart.hpp.

◆ reset()

template<unsigned int dim>
void domain_nn_calculator_cart< dim >::reset ( )
inline

In case you have to recompute the indexes.

Definition at line 338 of file Domain_NN_calculator_cart.hpp.

◆ setNNParameters()

template<unsigned int dim>
void domain_nn_calculator_cart< dim >::setNNParameters ( openfpm::vector<::Box< dim, size_t > > &  loc_box,
const grid_key_dx< dim > &  shift,
const grid_sm< dim, void > &  gs 
)
inline

Set parameters to calculate the cell neighborhood.

Parameters
loc_boxset of local sub-domains
shiftto apply in the linearization
gsgrid of cells (for the processor domain)

Definition at line 272 of file Domain_NN_calculator_cart.hpp.

◆ setParameters()

template<unsigned int dim>
void domain_nn_calculator_cart< dim >::setParameters ( const Box< dim, long int > &  proc_box)
inline

Set parameters to calculate the cell neighborhood.

Parameters
proc_boxprocessor cells box

Definition at line 260 of file Domain_NN_calculator_cart.hpp.

Field Documentation

◆ anom

template<unsigned int dim>
openfpm::vector<subsub<dim> > domain_nn_calculator_cart< dim >::anom
private

anomalous cell neighborhood for CRS

Definition at line 29 of file Domain_NN_calculator_cart.hpp.

◆ anom_lin

template<unsigned int dim>
openfpm::vector<subsub_lin<dim> > domain_nn_calculator_cart< dim >::anom_lin
private

Set of anomalous CRS domain cells linearized.

Definition at line 32 of file Domain_NN_calculator_cart.hpp.

◆ are_domain_anom_computed

template<unsigned int dim>
bool domain_nn_calculator_cart< dim >::are_domain_anom_computed
private

True if domain and anomalous domain cells are computed.

Definition at line 24 of file Domain_NN_calculator_cart.hpp.

◆ dom

template<unsigned int dim>
openfpm::vector<grid_key_dx<dim> > domain_nn_calculator_cart< dim >::dom
private

Set of normal domain cells for CRS.

Definition at line 35 of file Domain_NN_calculator_cart.hpp.

◆ dom_cells

template<unsigned int dim>
openfpm::vector<grid_key_dx<dim> > domain_nn_calculator_cart< dim >::dom_cells
private

Set of domain cells.

Definition at line 43 of file Domain_NN_calculator_cart.hpp.

◆ dom_cells_lin

template<unsigned int dim>
openfpm::vector<size_t> domain_nn_calculator_cart< dim >::dom_cells_lin
private

Set of linearized domain cells.

Definition at line 46 of file Domain_NN_calculator_cart.hpp.

◆ dom_lin

template<unsigned int dim>
openfpm::vector<size_t> domain_nn_calculator_cart< dim >::dom_lin
private

Set of normal CRS domain cells linearized.

Definition at line 38 of file Domain_NN_calculator_cart.hpp.

◆ gs

template<unsigned int dim>
grid_sm<dim,void> domain_nn_calculator_cart< dim >::gs
private

Processor cells-grid.

Definition at line 54 of file Domain_NN_calculator_cart.hpp.

◆ one

template<unsigned int dim>
grid_key_dx<dim> domain_nn_calculator_cart< dim >::one
private

key with all coordinates set to one

Definition at line 57 of file Domain_NN_calculator_cart.hpp.

◆ proc_box

template<unsigned int dim>
Box<dim,long int> domain_nn_calculator_cart< dim >::proc_box
private

Processor box.

Definition at line 51 of file Domain_NN_calculator_cart.hpp.


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