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

This is a distributed grid. More...

Detailed Description

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
class grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >

This is a distributed grid.

Implementation of a distributed grid the decomposition is geometrical, grid is splitted across several processor

Parameters
dimDimensionality of the grid
StType of space where the grid is living
Tobject the grid is storing
DecompositionClass that decompose the grid for example CartDecomposition
MemIs the allocator
devicetype of base structure is going to store the data

Create a distributed grid and access it

// grid size
size_t sz[2];
sz[0] = k;
sz[1] = k;
float factor = pow(create_vcluster().getProcessingUnits()/2.0f,1.0f/2.0f);
// Ghost
Ghost<2,float> g(0.01 / factor);
// Distributed grid with id decomposition
// check the consistency of the decomposition
bool val = g_dist.getDecomposition().check_consistency();
BOOST_REQUIRE_EQUAL(val,true);
// Grid sm
grid_sm<2,void> info(sz);
// get the domain iterator
size_t count = 0;
auto dom = g_dist.getDomainIterator();
while (dom.isNext())
{
auto key = dom.get();
auto key_g = g_dist.getGKey(key);
g_dist.template get<0>(key) = info.LinId(key_g);
// Count the point
count++;
++dom;
}

Synchronize the ghosts and check the information

g_dist.template ghost_get<0>();
// check that the communication is correctly completed
auto domg = g_dist.getDomainGhostIterator();
// check that the grid with the ghost past store the correct information
while (domg.isNext())
{
auto key = domg.get();
auto key_g = g_dist.getGKey(key);
// In this case the boundary condition are non periodic
if (g_dist.isInside(key_g))
{
match &= (g_dist.template get<0>(key) == info.LinId(key_g))?true:false;
}
++domg;
}
BOOST_REQUIRE_EQUAL(match,true);

Create and access a distributed grid for complex structures

// grid size
size_t sz[2];
sz[0] = k;
sz[1] = k;
float factor = pow(create_vcluster().getProcessingUnits()/2.0f,1.0f/2.0f);
// Ghost
Ghost<2,float> g(0.01 / factor);
// Distributed grid with id decomposition
// check the consistency of the decomposition
bool val = g_dist.getDecomposition().check_consistency();
BOOST_REQUIRE_EQUAL(val,true);
// Grid sm
grid_sm<2,void> info(sz);
// get the domain iterator
size_t count = 0;
auto dom = g_dist.getDomainIterator();
while (dom.isNext())
{
auto key = dom.get();
auto key_g = g_dist.getGKey(key);
size_t k = info.LinId(key_g);
g_dist.template get<p::x>(key) = 1 + k;
g_dist.template get<p::y>(key) = 567 + k;
g_dist.template get<p::z>(key) = 341 + k;
g_dist.template get<p::s>(key) = 5670 + k;
g_dist.template get<p::v>(key)[0] = 921 + k;
g_dist.template get<p::v>(key)[1] = 5675 + k;
g_dist.template get<p::v>(key)[2] = 117 + k;
g_dist.template get<p::t>(key)[0][0] = 1921 + k;
g_dist.template get<p::t>(key)[0][1] = 25675 + k;
g_dist.template get<p::t>(key)[0][2] = 3117 + k;
g_dist.template get<p::t>(key)[1][0] = 4921 + k;
g_dist.template get<p::t>(key)[1][1] = 55675 + k;
g_dist.template get<p::t>(key)[1][2] = 6117 + k;
g_dist.template get<p::t>(key)[2][0] = 7921 + k;
g_dist.template get<p::t>(key)[2][1] = 85675 + k;
g_dist.template get<p::t>(key)[2][2] = 9117 + k;
// Count the point
count++;
++dom;
}

Synchronize a distributed grid for complex structures

g_dist.template ghost_get<p::x,p::y,p::z,p::s,p::v,p::t>();
// check that the communication is correctly completed
auto domg = g_dist.getDomainGhostIterator();
// check that the grid with the ghost past store the correct information
while (domg.isNext())
{
auto key = domg.get();
auto key_g = g_dist.getGKey(key);
// In this case the boundary condition are non periodic
if (g_dist.isInside(key_g))
{
size_t k = info.LinId(key_g);
match &= (g_dist.template get<p::x>(key) == 1 + k)?true:false;
match &= (g_dist.template get<p::y>(key) == 567 + k)?true:false;
match &= (g_dist.template get<p::z>(key) == 341 + k)?true:false;
match &= (g_dist.template get<p::s>(key) == 5670 + k)?true:false;
match &= (g_dist.template get<p::v>(key)[0] == 921 + k)?true:false;
match &= (g_dist.template get<p::v>(key)[1] == 5675 + k)?true:false;
match &= (g_dist.template get<p::v>(key)[2] == 117 + k)?true:false;
match &= (g_dist.template get<p::t>(key)[0][0] == 1921 + k)?true:false;
match &= (g_dist.template get<p::t>(key)[0][1] == 25675 + k)?true:false;
match &= (g_dist.template get<p::t>(key)[0][2] == 3117 + k)?true:false;
match &= (g_dist.template get<p::t>(key)[1][0] == 4921 + k)?true:false;
match &= (g_dist.template get<p::t>(key)[1][1] == 55675 + k)?true:false;
match &= (g_dist.template get<p::t>(key)[1][2] == 6117 + k)?true:false;
match &= (g_dist.template get<p::t>(key)[2][0] == 7921 + k)?true:false;
match &= (g_dist.template get<p::t>(key)[2][1] == 85675 + k)?true:false;
match &= (g_dist.template get<p::t>(key)[2][2] == 9117 + k)?true:false;
}
++domg;
}

Usage of a grid dist iterator sub

Construct two grid with the same decomposition

// Distributed grid with id decomposition (It work also without the third template parameter)
// Here is given to show that the 2 grid MUST have the same decomposition strategy
// another grid with the same decomposition
grid_dist_id<3, float, Point_test<float>, CartDecomposition<3,float>> g_dist2(g_dist1.getDecomposition(),sz,g);

Definition at line 69 of file grid_dist_id.hpp.

#include <grid_dist_id.hpp>

+ Inheritance diagram for grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >:

Public Types

typedef device_grid d_grid
 Which kind of grid the structure store.
 
typedef Decomposition decomposition
 Decomposition used.
 
typedef T value_type
 value_type
 
typedef St stype
 Type of space.
 
typedef Memory memory_type
 Type of Memory.
 
typedef device_grid device_grid_type
 Type of device grid.
 

Public Member Functions

const Box< dim, St > getDomain () const
 Get the domain where the grid is defined. More...
 
Point< dim, St > getOffset (size_t i)
 Get the point where it start the origin of the grid of the sub-domain i. More...
 
St spacing (size_t i) const
 Get the spacing of the grid in direction i. More...
 
size_t size () const
 Return the total number of points in the grid. More...
 
size_t size (size_t i) const
 Return the total number of points in the grid. More...
 
template<typename H >
 grid_dist_id (const grid_dist_id< dim, St, H, typename Decomposition::base_type, Memory, grid_cpu< dim, H >> &g, const Ghost< dim, long int > &gh, Box< dim, size_t > ext)
 This constructor is special, it construct an expanded grid that perfectly overlap with the previous. More...
 
 grid_dist_id (const Decomposition &dec, const size_t(&g_sz)[dim], const Ghost< dim, St > &ghost)
 
 grid_dist_id (Decomposition &&dec, const size_t(&g_sz)[dim], const Ghost< dim, St > &ghost)
 
 grid_dist_id (const Decomposition &dec, const size_t(&g_sz)[dim], const Ghost< dim, long int > &g)
 
 grid_dist_id (Decomposition &&dec, const size_t(&g_sz)[dim], const Ghost< dim, long int > &g)
 
 grid_dist_id (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, St > &g)
 
 grid_dist_id (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, long int > &g)
 
 grid_dist_id (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, St > &g, const periodicity< dim > &p)
 
 grid_dist_id (const size_t(&g_sz)[dim], const Box< dim, St > &domain, const Ghost< dim, long int > &g, const periodicity< dim > &p)
 
const grid_sm< dim, T > & getGridInfo () const
 Get an object containing the grid informations. More...
 
const grid_sm< dim, void > & getGridInfoVoid () const
 Get an object containing the grid informations without type. More...
 
DecompositiongetDecomposition ()
 Get the object that store the information about the decomposition. More...
 
const DecompositiongetDecomposition () const
 Get the object that store the information about the decomposition. More...
 
const CellDecomposer_sm< dim,
St, shift< dim, St > > & 
getCellDecomposer () const
 Return the cell decomposer. More...
 
bool isInside (const grid_key_dx< dim > &gk) const
 Check that the global grid key is inside the grid domain. More...
 
size_t getLocalDomainSize () const
 Get the total number of grid points for the calling processor. More...
 
size_t getLocalDomainWithGhostSize () const
 Get the total number of grid points with ghost for the calling processor. More...
 
const openfpm::vector< GBoxes
< device_grid::dims > > & 
getLocalGridsInfo ()
 It return the informations about the local grids. More...
 
void getGlobalGridsInfo (openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext_global) const
 It gathers the information about local grids for all of the processors. More...
 
grid_dist_iterator< dim,
device_grid, FREE > 
getOldDomainIterator () const
 It return an iterator that span the full grid domain (each processor span its local domain) More...
 
grid_dist_iterator< dim,
device_grid, FREE > 
getDomainIterator () const
 It return an iterator that span the full grid domain (each processor span its local domain) More...
 
template<unsigned int Np>
grid_dist_iterator< dim,
device_grid, FREE,
stencil_offset_compute< dim,
Np > > 
getDomainIteratorStencil (const grid_key_dx< dim >(&stencil_pnt)[Np]) const
 It return an iterator that span the full grid domain (each processor span its local domain) More...
 
grid_dist_iterator< dim,
device_grid, FIXED > 
getDomainGhostIterator () const
 It return an iterator that span the grid domain + ghost part. More...
 
grid_dist_iterator_sub< dim,
device_grid > 
getSubDomainIterator (const grid_key_dx< dim > &start, const grid_key_dx< dim > &stop) const
 It return an iterator that span the grid domain only in the specified part. More...
 
grid_dist_iterator_sub< dim,
device_grid > 
getSubDomainIterator (const long int(&start)[dim], const long int(&stop)[dim]) const
 It return an iterator that span the grid domain only in the specified part. More...
 
 ~grid_dist_id ()
 Destructor.
 
VclustergetVC ()
 Get the Virtual Cluster machine. More...
 
bool is_staggered ()
 Indicate that this grid is not staggered. More...
 
template<unsigned int p = 0>
auto get (const grid_dist_key_dx< dim > &v1) const -> typename std::add_lvalue_reference< decltype(loc_grid.get(v1.getSub()).template get< p >(v1.getKey()))>::type
 Get the reference of the selected element. More...
 
template<unsigned int p = 0>
auto get (const grid_dist_key_dx< dim > &v1) -> typename std::add_lvalue_reference< decltype(loc_grid.get(v1.getSub()).template get< p >(v1.getKey()))>::type
 Get the reference of the selected element. More...
 
template<unsigned int p = 0>
auto get (grid_dist_g_dx< device_grid > &v1) const -> typename std::add_lvalue_reference< decltype(v1.getSub() ->template get< p >(v1.getKey()))>::type
 Get the reference of the selected element. More...
 
template<unsigned int p = 0>
auto get (grid_dist_g_dx< device_grid > &v1) -> typename std::add_lvalue_reference< decltype(v1.getSub() ->template get< p >(v1.getKey()))>::type
 Get the reference of the selected element. More...
 
template<unsigned int p = 0>
auto get (const grid_dist_lin_dx &v1) const -> typename std::add_lvalue_reference< decltype(loc_grid.get(v1.getSub()).template get< p >(v1.getKey()))>::type
 Get the reference of the selected element. More...
 
template<unsigned int p = 0>
auto get (const grid_dist_lin_dx &v1) -> typename std::add_lvalue_reference< decltype(loc_grid.get(v1.getSub()).template get< p >(v1.getKey()))>::type
 Get the reference of the selected element. More...
 
template<unsigned int p = 0>
auto getProp (const grid_dist_key_dx< dim > &v1) const -> decltype(this->template get< p >(v1))
 Get the reference of the selected element. More...
 
template<unsigned int p = 0>
auto getProp (const grid_dist_key_dx< dim > &v1) -> decltype(this->template get< p >(v1))
 Get the reference of the selected element. More...
 
template<int... prp>
void ghost_get ()
 It synchronize the ghost parts. More...
 
template<template< typename, typename > class op, int... prp>
void ghost_put ()
 It synchronize the ghost parts. More...
 
grid_dist_id< dim, St, T,
Decomposition, Memory,
device_grid > & 
copy (grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > &g, bool use_memcpy=true)
 Copy the give grid into this grid. More...
 
Point< dim, St > getSpacing ()
 Get the spacing on each dimension. More...
 
grid_key_dx< dim > getGKey (const grid_dist_key_dx< dim > &k)
 Convert a g_dist_key_dx into a global key. More...
 
bool write (std::string output, size_t opt=VTK_WRITER|FORMAT_ASCII)
 Write the distributed grid information. More...
 
bool write_frame (std::string output, size_t i, size_t opt=VTK_WRITER|FORMAT_ASCII)
 Write the distributed grid information. More...
 
device_grid & get_loc_grid (size_t i)
 Get the i sub-domain grid. More...
 
grid_key_dx_iterator_sub< dim,
no_stencil
get_loc_grid_iterator (size_t i)
 Get the i sub-domain grid. More...
 
template<unsigned int Np>
grid_key_dx_iterator_sub< dim,
stencil_offset_compute< dim,
Np > > 
get_loc_grid_iterator_stencil (size_t i, const grid_key_dx< dim >(&stencil_pnt)[Np])
 Get the i sub-domain grid. More...
 
size_t getN_loc_grid ()
 Return the number of local grid. More...
 
long int who ()
 It return the id of structure in the allocation list. More...
 
void debugPrint ()
 It print the internal ghost boxes and external ghost boxes in global unit. More...
 
void setPropNames (const openfpm::vector< std::string > &names)
 Set the properties names. More...
 
void map ()
 It move all the grid parts that do not belong to the local processor to the respective processor. More...
 
void save (const std::string &filename) const
 
void load (const std::string &filename)
 
const openfpm::vector
< i_lbox_grid< dim > > & 
get_loc_ig_box ()
 Get the internal local ghost box. More...
 
const openfpm::vector
< i_lbox_grid< dim > > & 
get_ig_box ()
 Get the internal ghost box. More...
 
- Public Member Functions inherited from grid_dist_id_comm< dim, St, T, Decomposition, Memory, device_grid >
void grids_reconstruct (openfpm::vector< openfpm::vector< aggregate< device_grid, SpaceBox< dim, long int >>>> &m_oGrid_recv, openfpm::vector< device_grid > &loc_grid, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, CellDecomposer_sm< dim, St, shift< dim, St >> &cd_sm)
 Reconstruct the local grids. More...
 
void labelIntersectionGridsProcessor (Decomposition &dec, CellDecomposer_sm< dim, St, shift< dim, St >> &cd_sm, openfpm::vector< device_grid > &loc_grid_old, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext_old, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext_global, openfpm::vector< openfpm::vector< aggregate< device_grid, SpaceBox< dim, long int >>>> &lbl_b, openfpm::vector< size_t > &prc_sz)
 Label intersection grids for mappings. More...
 
void map_ (Decomposition &dec, CellDecomposer_sm< dim, St, shift< dim, St >> &cd_sm, openfpm::vector< device_grid > &loc_grid, openfpm::vector< device_grid > &loc_grid_old, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext_old, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext_global)
 Moves all the grids that does not belong to the local processor to the respective processor. More...
 
template<int... prp>
void ghost_get_ (const openfpm::vector< ip_box_grid< dim >> &ig_box, const openfpm::vector< ep_box_grid< dim >> &eg_box, const openfpm::vector< i_lbox_grid< dim >> &loc_ig_box, const openfpm::vector< e_lbox_grid< dim >> &loc_eg_box, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< device_grid > &loc_grid, std::unordered_map< size_t, size_t > &g_id_to_external_ghost_box)
 It fill the ghost part of the grids. More...
 
template<template< typename, typename > class op, int... prp>
void ghost_put_ (const openfpm::vector< ip_box_grid< dim >> &ig_box, const openfpm::vector< ep_box_grid< dim >> &eg_box, const openfpm::vector< i_lbox_grid< dim >> &loc_ig_box, const openfpm::vector< e_lbox_grid< dim >> &loc_eg_box, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< device_grid > &loc_grid, openfpm::vector< std::unordered_map< size_t, size_t >> &g_id_to_internal_ghost_box)
 It merge the information in the ghost with the real information. More...
 
 grid_dist_id_comm ()
 Constructor. More...
 

Data Fields

bool init_e_g_box = false
 Flag that indicate if the external ghost box has been initialized.
 
bool init_i_g_box = false
 Flag that indicate if the internal ghost box has been initialized.
 
bool init_fix_ie_g_box = false
 Flag that indicate if the internal and external ghost box has been fixed.
 
openfpm::vector< ip_box_grid
< dim > > 
ig_box
 Internal ghost boxes in grid units.
 
openfpm::vector< ep_box_grid
< dim > > 
eg_box
 External ghost boxes in grid units.
 
openfpm::vector< i_lbox_grid
< dim > > 
loc_ig_box
 Local internal ghost boxes in grid units.
 
openfpm::vector< e_lbox_grid
< dim > > 
loc_eg_box
 Local external ghost boxes in grid units.
 

Static Public Attributes

static const unsigned int dims = dim
 Number of dimensions.
 

Protected Member Functions

Box< dim, size_t > getDomain (size_t i)
 Given a local sub-domain i with a local grid Domain + ghost return the part of the local grid that is domain. More...
 

Static Protected Member Functions

static Ghost< dim, float > convert_ghost (const Ghost< dim, long int > &gd, const CellDecomposer_sm< dim, St, shift< dim, St >> &cd_sm)
 Convert a ghost from grid point units into continus space. More...
 

Private Member Functions

Box< dim, long int > flip_box (const Box< dim, long int > &box, const comb< dim > &cmb)
 flip box just convert and internal ghost box into an external ghost box More...
 
void set_for_adjustment (const Box< dim, long int > &sub_domain, const Box< dim, St > &sub_domain_other, const comb< dim > &cmb, Box< dim, long int > &ib, Ghost< dim, long int > &g)
 this function is for optimization of the ghost size More...
 
void create_ig_box ()
 Create per-processor internal ghost boxes list in grid units and g_id_to_external_ghost_box. More...
 
void create_eg_box ()
 Create per-processor internal ghost box list in grid units. More...
 
void create_local_ig_box ()
 Create local internal ghost box in grid units. More...
 
void create_local_eg_box ()
 Create per-processor external ghost boxes list in grid units. More...
 
void check_size (const size_t(&g_sz)[dim])
 Check the grid has a valid size. More...
 
void Create ()
 Create the grids on memory. More...
 
 grid_dist_id (const grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > &g)
 Default Copy constructor on this class make no sense and is unsafe, this definition disable it. More...
 
void InitializeCellDecomposer (const CellDecomposer_sm< dim, St, shift< dim, St >> &cd_old, const Box< dim, size_t > &ext)
 Initialize the Cell decomposer of the grid enforcing perfect overlap of the cells. More...
 
void InitializeCellDecomposer (const size_t(&g_sz)[dim], const size_t(&bc)[dim])
 Initialize the Cell decomposer of the grid. More...
 
void InitializeDecomposition (const size_t(&g_sz)[dim], const size_t(&bc)[dim])
 Initialize the grid. More...
 
void InitializeStructures (const size_t(&g_sz)[dim])
 Initialize the grid. More...
 

Static Private Member Functions

static void * msg_alloc_external_box (size_t msg_i, size_t total_msg, size_t total_p, size_t i, size_t ri, void *ptr)
 Call-back to allocate buffer to receive incoming objects (external ghost boxes) More...
 

Private Attributes

Box< dim, St > domain
 Domain.
 
Ghost< dim, St > ghost
 Ghost expansion.
 
Ghost< dim, long int > ghost_int
 Ghost expansion.
 
openfpm::vector< device_grid > loc_grid
 Local grids.
 
openfpm::vector< device_grid > loc_grid_old
 Old local grids.
 
Decomposition dec
 Space Decomposition.
 
openfpm::vector< GBoxes
< device_grid::dims > > 
gdb_ext
 Extension of each grid: Domain and ghost + domain.
 
openfpm::vector< GBoxes
< device_grid::dims > > 
gdb_ext_global
 Global gdb_ext.
 
openfpm::vector< GBoxes
< device_grid::dims > > 
gdb_ext_old
 Extension of each old grid (old): Domain and ghost + domain.
 
size_t g_sz [dim]
 Size of the grid on each dimension.
 
CellDecomposer_sm< dim, St,
shift< dim, St > > 
cd_sm
 Structure that divide the space into cells.
 
Vclusterv_cl
 Communicator class.
 
openfpm::vector< std::string > prp_names
 properties names
 
std::unordered_map< size_t,
size_t > 
g_id_to_external_ghost_box
 
openfpm::vector
< std::unordered_map< size_t,
size_t > > 
g_id_to_internal_ghost_box
 
openfpm::vector< size_t > recv_sz
 Receiving size.
 
openfpm::vector< HeapMemoryrecv_mem_gg
 Receiving buffer for particles ghost get.
 
grid_sm< dim, T > ginfo
 Grid informations object.
 
grid_sm< dim, void > ginfo_v
 Grid informations object without type.
 
bool init_local_i_g_box = false
 Indicate if the local internal ghost box has been initialized.
 
bool init_local_e_g_box = false
 Indicate if the local external ghost box has been initialized.
 

Constructor & Destructor Documentation

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::grid_dist_id ( const grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > &  g)
inlineprivate

Default Copy constructor on this class make no sense and is unsafe, this definition disable it.

Parameters
ggrid to copy

Definition at line 523 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<typename H >
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::grid_dist_id ( const grid_dist_id< dim, St, H, typename Decomposition::base_type, Memory, grid_cpu< dim, H >> &  g,
const Ghost< dim, long int > &  gh,
Box< dim, size_t >  ext 
)
inline

This constructor is special, it construct an expanded grid that perfectly overlap with the previous.

The key-word here is "perfectly overlap". Using the default constructor you could create something similar, but because of rounding-off error it can happen that it is not perfectly overlapping

Parameters
gprevious grid
ghGhost part in grid units
extextension of the grid (must be positive on every direction)

Definition at line 735 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::grid_dist_id ( const Decomposition dec,
const size_t(&)  g_sz[dim],
const Ghost< dim, St > &  ghost 
)
inline

It constructs a grid of a specified size, defined on a specified Box space, forcing to follow a specified decomposition and with a specified ghost size

Parameters
decDecomposition
g_szgrid size on each dimension
ghostGhost part

Definition at line 785 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::grid_dist_id ( Decomposition &&  dec,
const size_t(&)  g_sz[dim],
const Ghost< dim, St > &  ghost 
)
inline

It constructs a grid of a specified size, defined on a specified Box space, forcing to follow a specified decomposition and with a specified ghost size

Parameters
decDecomposition
g_szgrid size on each dimension
ghostGhost part

Definition at line 806 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::grid_dist_id ( const Decomposition dec,
const size_t(&)  g_sz[dim],
const Ghost< dim, long int > &  g 
)
inline

It constructs a grid of a specified size, defined on a specified Box space, forcing to follow a specified decomposition, and having a specified ghost size

Parameters
decDecomposition
g_szgrid size on each dimension
gGhost part (given in grid units)
Warning
In very rare case the ghost part can be one point bigger than the one specified

Definition at line 828 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::grid_dist_id ( Decomposition &&  dec,
const size_t(&)  g_sz[dim],
const Ghost< dim, long int > &  g 
)
inline

It construct a grid of a specified size, defined on a specified Box space, forcing to follow a specified decomposition, and having a specified ghost size

Parameters
decDecomposition
g_szgrid size on each dimension
gGhost part (given in grid units)
Warning
In very rare case the ghost part can be one point bigger than the one specified

Definition at line 855 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::grid_dist_id ( const size_t(&)  g_sz[dim],
const Box< dim, St > &  domain,
const Ghost< dim, St > &  g 
)
inline

It construct a grid of a specified size, defined on a specified Box space, and having a specified ghost size

Parameters
g_szgrid size on each dimension
domainBox that contain the grid
gGhost part (given in grid units)
Warning
In very rare case the ghost part can be one point bigger than the one specified

Definition at line 880 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::grid_dist_id ( const size_t(&)  g_sz[dim],
const Box< dim, St > &  domain,
const Ghost< dim, long int > &  g 
)
inline

It construct a grid of a specified size, defined on a specified Box space, having a specified ghost size and periodicity

Parameters
g_szgrid size on each dimension
domainBox that contain the grid
gGhost part of the domain (given in grid units)
Warning
In very rare case the ghost part can be one point bigger than the one specified

Definition at line 895 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::grid_dist_id ( const size_t(&)  g_sz[dim],
const Box< dim, St > &  domain,
const Ghost< dim, St > &  g,
const periodicity< dim > &  p 
)
inline

It construct a grid of a specified size, defined on a specified Box space, having a specified ghost size, and specified periodicity

Parameters
g_szgrid size on each dimension
domainBox that contain the grid
gGhost part (given in grid units)
pBoundary conditions
Warning
In very rare case the ghost part can be one point bigger than the one specified

Definition at line 910 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::grid_dist_id ( const size_t(&)  g_sz[dim],
const Box< dim, St > &  domain,
const Ghost< dim, long int > &  g,
const periodicity< dim > &  p 
)
inline

It construct a grid of a specified size, defined on a specified Box space, having a specified ghost size and periodicity

Parameters
g_szgrid size on each dimension
domainBox that contain the grid
gGhost part of the domain (given in grid units)
pperiodicity
Warning
In very rare case the ghost part can be one point bigger than the one specified

Definition at line 934 of file grid_dist_id.hpp.

Member Function Documentation

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::check_size ( const size_t(&)  g_sz[dim])
inlineprivate

Check the grid has a valid size.

Parameters
g_szsize of the grid

Definition at line 473 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
static Ghost<dim,float> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::convert_ghost ( const Ghost< dim, long int > &  gd,
const CellDecomposer_sm< dim, St, shift< dim, St >> &  cd_sm 
)
inlinestaticprotected

Convert a ghost from grid point units into continus space.

Parameters
gdGhost in continuous space
cd_smCellDecomposer of the grid
Returns
the ghost in continuous unit

Definition at line 625 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_id<dim,St,T,Decomposition,Memory,device_grid>& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::copy ( grid_dist_id< dim, St, T, Decomposition, Memory, device_grid > &  g,
bool  use_memcpy = true 
)
inline

Copy the give grid into this grid.

It copy the first grid into the given grid (No ghost)

Warning
the Decomposition must be ensured to be the same, otherwise crashes can happen, if you want to copy the grid independently from the decomposition please use the operator equal
Parameters
gGrid to copy
use_memcpyuse memcpy function if possible
Returns
itself

Definition at line 1509 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::Create ( )
inlineprivate

Create the grids on memory.

Definition at line 485 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::create_eg_box ( )
inlineprivate

Create per-processor internal ghost box list in grid units.

Definition at line 310 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::create_ig_box ( )
inlineprivate

Create per-processor internal ghost boxes list in grid units and g_id_to_external_ghost_box.

Definition at line 248 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::create_local_eg_box ( )
inlineprivate

Create per-processor external ghost boxes list in grid units.

Definition at line 436 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::create_local_ig_box ( )
inlineprivate

Create local internal ghost box in grid units.

Definition at line 386 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::debugPrint ( )
inline

It print the internal ghost boxes and external ghost boxes in global unit.

Definition at line 1733 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
Box<dim,long int> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::flip_box ( const Box< dim, long int > &  box,
const comb< dim > &  cmb 
)
inlineprivate

flip box just convert and internal ghost box into an external ghost box

Parameters
boxto convert
cmbsector position of the box
Returns
the converted box

Definition at line 172 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int p = 0>
auto grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get ( const grid_dist_key_dx< dim > &  v1) const -> typename std::add_lvalue_reference<decltype(loc_grid.get(v1.getSub()).template get<p>(v1.getKey()))>::type
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 1297 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int p = 0>
auto grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get ( const grid_dist_key_dx< dim > &  v1) -> typename std::add_lvalue_reference<decltype(loc_grid.get(v1.getSub()).template get<p>(v1.getKey()))>::type
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 1313 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int p = 0>
auto grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get ( grid_dist_g_dx< device_grid > &  v1) const -> typename std::add_lvalue_reference<decltype(v1.getSub()->template get<p>(v1.getKey()))>::type
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 1329 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int p = 0>
auto grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get ( grid_dist_g_dx< device_grid > &  v1) -> typename std::add_lvalue_reference<decltype(v1.getSub()->template get<p>(v1.getKey()))>::type
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 1345 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int p = 0>
auto grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get ( const grid_dist_lin_dx v1) const -> typename std::add_lvalue_reference<decltype(loc_grid.get(v1.getSub()).template get<p>(v1.getKey()))>::type
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 1361 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int p = 0>
auto grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get ( const grid_dist_lin_dx v1) -> typename std::add_lvalue_reference<decltype(loc_grid.get(v1.getSub()).template get<p>(v1.getKey()))>::type
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 1377 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
const openfpm::vector<i_lbox_grid<dim> >& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get_ig_box ( )
inline

Get the internal ghost box.

Returns
the internal local ghost box

Definition at line 1821 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
device_grid& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get_loc_grid ( size_t  i)
inline

Get the i sub-domain grid.

Parameters
isub-domain
Returns
local grid

Definition at line 1667 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_key_dx_iterator_sub<dim,no_stencil> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get_loc_grid_iterator ( size_t  i)
inline

Get the i sub-domain grid.

Parameters
isub-domain
Returns
local grid

Definition at line 1679 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int Np>
grid_key_dx_iterator_sub<dim,stencil_offset_compute<dim,Np> > grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get_loc_grid_iterator_stencil ( size_t  i,
const grid_key_dx< dim >(&)  stencil_pnt[Np] 
)
inline

Get the i sub-domain grid.

Parameters
isub-domain
Returns
local grid

Definition at line 1694 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
const openfpm::vector<i_lbox_grid<dim> >& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::get_loc_ig_box ( )
inline

Get the internal local ghost box.

Returns
the internal local ghost box

Definition at line 1811 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
const CellDecomposer_sm<dim,St,shift<dim,St> >& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getCellDecomposer ( ) const
inline

Return the cell decomposer.

Returns
the cell decomposer

Definition at line 1008 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
Decomposition& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getDecomposition ( )
inline

Get the object that store the information about the decomposition.

Returns
the decomposition object

Definition at line 982 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
const Decomposition& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getDecomposition ( ) const
inline

Get the object that store the information about the decomposition.

Returns
the decomposition object

Definition at line 995 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
Box<dim,size_t> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getDomain ( size_t  i)
inlineprotected

Given a local sub-domain i with a local grid Domain + ghost return the part of the local grid that is domain.

Parameters
isub-domain
Returns
the Box defining the domain in the local grid

Definition at line 612 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
const Box<dim,St> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getDomain ( ) const
inline

Get the domain where the grid is defined.

Returns
the domain of the grid

Definition at line 673 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_iterator<dim,device_grid,FIXED> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getDomainGhostIterator ( ) const
inline

It return an iterator that span the grid domain + ghost part.

Returns
the iterator

Definition at line 1206 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_iterator<dim,device_grid,FREE> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getDomainIterator ( ) const
inline

It return an iterator that span the full grid domain (each processor span its local domain)

Returns
the iterator

Definition at line 1160 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int Np>
grid_dist_iterator<dim,device_grid,FREE,stencil_offset_compute<dim,Np> > grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getDomainIteratorStencil ( const grid_key_dx< dim >(&)  stencil_pnt[Np]) const
inline

It return an iterator that span the full grid domain (each processor span its local domain)

Parameters
stencil_pntstencil points
Returns
the iterator

Definition at line 1185 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_key_dx<dim> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getGKey ( const grid_dist_key_dx< dim > &  k)
inline

Convert a g_dist_key_dx into a global key.

See Also
grid_dist_key_dx
grid_dist_iterator
Parameters
kgrid_dist_key_dx point (in general returned by the iterators)
Returns
the global position in the grid

Definition at line 1575 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getGlobalGridsInfo ( openfpm::vector< GBoxes< device_grid::dims >> &  gdb_ext_global) const
inline

It gathers the information about local grids for all of the processors.

Parameters
gdb_ext_globalwhere to store the grid infos

Definition at line 1096 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
const grid_sm<dim,T>& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getGridInfo ( ) const
inline

Get an object containing the grid informations.

Returns
an information object about this grid

Definition at line 956 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
const grid_sm<dim,void>& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getGridInfoVoid ( ) const
inline

Get an object containing the grid informations without type.

Returns
an information object about this grid

Definition at line 969 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
size_t grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getLocalDomainSize ( ) const
inline

Get the total number of grid points for the calling processor.

Returns
The number of grid points

Definition at line 1042 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
size_t grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getLocalDomainWithGhostSize ( ) const
inline

Get the total number of grid points with ghost for the calling processor.

Returns
The number of grid points

Definition at line 1062 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
const openfpm::vector<GBoxes<device_grid::dims> >& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getLocalGridsInfo ( )
inline

It return the informations about the local grids.

Returns
The information about the local grids

Definition at line 1083 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
size_t grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getN_loc_grid ( )
inline

Return the number of local grid.

Returns
the number of local grid

Definition at line 1707 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
Point<dim,St> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getOffset ( size_t  i)
inline

Get the point where it start the origin of the grid of the sub-domain i.

Parameters
isub-domain
Returns
the point

Definition at line 685 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_iterator<dim,device_grid,FREE> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getOldDomainIterator ( ) const
inline

It return an iterator that span the full grid domain (each processor span its local domain)

Returns
the iterator

Definition at line 1139 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int p = 0>
auto grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getProp ( const grid_dist_key_dx< dim > &  v1) const -> decltype(this->template get<p>(v1))
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 1393 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<unsigned int p = 0>
auto grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getProp ( const grid_dist_key_dx< dim > &  v1) -> decltype(this->template get<p>(v1))
inline

Get the reference of the selected element.

Template Parameters
pproperty to get (is an integer)
Parameters
v1grid_key that identify the element in the grid
Returns
the selected element

Definition at line 1406 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
Point<dim,St> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getSpacing ( )
inline

Get the spacing on each dimension.

Returns
the spacing of the grid on each dimension as a point

Definition at line 1560 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_iterator_sub<dim,device_grid> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getSubDomainIterator ( const grid_key_dx< dim > &  start,
const grid_key_dx< dim > &  stop 
) const
inline

It return an iterator that span the grid domain only in the specified part.

The key spanned are the one inside the box spanned by the start point and the end point included

Parameters
startpoint
stoppoint
Returns
the sub-domain iterator

Definition at line 1228 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
grid_dist_iterator_sub<dim,device_grid> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getSubDomainIterator ( const long int(&)  start[dim],
const long int(&)  stop[dim] 
) const
inline

It return an iterator that span the grid domain only in the specified part.

The key spanned are the one inside the box spanned by the start point and the end point included

Parameters
startpoint
stoppoint
Returns
an iterator on the sub-part of the grid

Definition at line 1250 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
Vcluster& grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::getVC ( )
inline

Get the Virtual Cluster machine.

Returns
the Virtual cluster machine

Definition at line 1271 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<int... prp>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::ghost_get ( )
inline

It synchronize the ghost parts.

Template Parameters
prp...Properties to synchronize

Definition at line 1437 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<template< typename, typename > class op, int... prp>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::ghost_put ( )
inline

It synchronize the ghost parts.

Template Parameters
prp...Properties to synchronize

Definition at line 1469 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::InitializeCellDecomposer ( const CellDecomposer_sm< dim, St, shift< dim, St >> &  cd_old,
const Box< dim, size_t > &  ext 
)
inlineprivate

Initialize the Cell decomposer of the grid enforcing perfect overlap of the cells.

Parameters
cd_oldthe CellDecomposer we are trying to mach
extextension of the domain

Definition at line 537 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::InitializeCellDecomposer ( const size_t(&)  g_sz[dim],
const size_t(&)  bc[dim] 
)
inlineprivate

Initialize the Cell decomposer of the grid.

Parameters
g_szSize of the grid
bcboundary conditions

Definition at line 549 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::InitializeDecomposition ( const size_t(&)  g_sz[dim],
const size_t(&)  bc[dim] 
)
inlineprivate

Initialize the grid.

Parameters
g_szGlobal size of the grid
bcboundary conditions

Definition at line 568 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::InitializeStructures ( const size_t(&)  g_sz[dim])
inlineprivate

Initialize the grid.

Parameters
g_szGlobal size of the grid

Definition at line 594 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
bool grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::is_staggered ( )
inline

Indicate that this grid is not staggered.

Returns
false

Definition at line 1284 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
bool grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::isInside ( const grid_key_dx< dim > &  gk) const
inline

Check that the global grid key is inside the grid domain.

Parameters
gkpoint to check
Returns
true if is inside

Definition at line 1023 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::map ( )
inline

It move all the grid parts that do not belong to the local processor to the respective processor.

Definition at line 1779 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
static void* grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::msg_alloc_external_box ( size_t  msg_i,
size_t  total_msg,
size_t  total_p,
size_t  i,
size_t  ri,
void *  ptr 
)
inlinestaticprivate

Call-back to allocate buffer to receive incoming objects (external ghost boxes)

Parameters
msg_imessage size required to receive from i
total_msgmessage size to receive from all the processors
total_pthe total number of processor want to communicate with you
iprocessor id
rirequest id (it is an id that goes from 0 to total_p, and is unique every time message_alloc is called)
ptrvoid pointer parameter for additional data to pass to the call-back

Definition at line 147 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::set_for_adjustment ( const Box< dim, long int > &  sub_domain,
const Box< dim, St > &  sub_domain_other,
const comb< dim > &  cmb,
Box< dim, long int > &  ib,
Ghost< dim, long int > &  g 
)
inlineprivate

this function is for optimization of the ghost size

Because the decomposition work in continuum and discrete ghost is converted in continuum, in some case continuum ghost because of rounding-off error can produce ghost bigger than the discrete selected one. This function adjust for this round-off error

Parameters
sub_domainthe sub-domain
sub_domain_otherthe other sub-domain
ibinternal ghost box to adjust

Definition at line 210 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::setPropNames ( const openfpm::vector< std::string > &  names)
inline

Set the properties names.

It is useful to specify name for the properties in vtk writers

Parameters
namesset of properties names

Definition at line 1767 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
size_t grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::size ( ) const
inline

Return the total number of points in the grid.

Returns
number of points

Definition at line 707 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
size_t grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::size ( size_t  i) const
inline

Return the total number of points in the grid.

Parameters
idirection
Returns
number of points on direction i

Definition at line 719 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
St grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::spacing ( size_t  i) const
inline

Get the spacing of the grid in direction i.

Parameters
idimension
Returns
the spacing

Definition at line 697 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
long int grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::who ( )
inline

It return the id of structure in the allocation list.

See Also
print_alloc and SE_CLASS2
Returns
the id

Definition at line 1720 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
bool grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::write ( std::string  output,
size_t  opt = VTK_WRITER | FORMAT_ASCII 
)
inline

Write the distributed grid information.

  • grid_X.vtk Output each local grids for each local processor X
  • internal_ghost_X.vtk Internal ghost boxes in grid units for the local processor X
Parameters
outputdirectory where to put the files + prefix
optoptions
Returns
true if the write operation succeed

Definition at line 1602 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
bool grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::write_frame ( std::string  output,
size_t  i,
size_t  opt = VTK_WRITER | FORMAT_ASCII 
)
inline

Write the distributed grid information.

  • grid_X.vtk Output each local grids for each local processor X
  • internal_ghost_X.vtk Internal ghost boxes in grid units for the local processor X
Parameters
outputdirectory where to put the files + prefix
iframe number
optoptions
Returns
true id the write succeed

Definition at line 1636 of file grid_dist_id.hpp.

Field Documentation

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
std::unordered_map<size_t,size_t> grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::g_id_to_external_ghost_box
private

It map a global ghost id (g_id) to the external ghost box information It is unique across all the near processor

Definition at line 112 of file grid_dist_id.hpp.

template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
openfpm::vector<std::unordered_map<size_t,size_t> > grid_dist_id< dim, St, T, Decomposition, Memory, device_grid >::g_id_to_internal_ghost_box
private

It map a global ghost id (g_id) to the internal ghost box information (is unique for processor), it is not unique across all the near processor

Definition at line 116 of file grid_dist_id.hpp.


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