8 #ifndef SRC_DECOMPOSITION_CARTDECOMPOSITION_EXT_HPP_
9 #define SRC_DECOMPOSITION_CARTDECOMPOSITION_EXT_HPP_
11 #include "memory/HeapMemory.hpp"
12 #include "Decomposition/Distribution/ParMetisDistribution.hpp"
13 #include "Space/Ghost.hpp"
14 #include "Decomposition/nn_processor.hpp"
16 template<
unsigned int dim,
typename T,
typename Memory = HeapMemory,
typename Distribution = ParMetisDistribution<dim, T>>
41 template<
unsigned int dim,
typename T,
typename Memory = HeapMemory,
typename Distribution = ParMetisDistribution<dim, T>>
57 typedef ::Box<dim,T> b;
67 for (
size_t j = 0 ; j < dim ; j++)
70 box.
setLow(j,ext_dom.getLow(j));
75 box.
setHigh(j,ext_dom.getHigh(j));
84 this->
bbox.enclose(box);
106 for (
size_t i = 0; i < dim ; i++)
108 size_t p1 = (dec.
domain.getLow(i) - dec.
domain.getLow(i)) / dec.
cd.getCellBox().getHigh(i) + 1;
109 size_t p2 = (dec.
domain.getLow(i) - dec.
domain.getLow(i)) / dec.
cd.getCellBox().getHigh(i) + 1;
113 sz_new[i] = p1+p2+dec.
cd.getGrid().size(i);
114 sz_old[i] = dec.
cd.getGrid().size(i);
137 for (
size_t i = 0 ; i < dim ; i++)
140 if (key_old.
get(i) < 0)
142 else if(key_old.
get(i) >= (
long int)info_old.
size(i) )
154 this->
cd.setDimensions(dec.
cd,ext);
226 this->
domain = ext_domain;
230 for (
size_t i = 0 ; i < dim ; i++)
236 for (
size_t i = 0 ; i < dim ; i++)
237 this->
bc[i] = dec.
bc[i];
openfpm::vector< size_t > fine_s
This class represent an N-dimensional box.
CellDecomposer_sm< dim, T, shift< dim, T > > cd
mem_id LinId(const grid_key_dx< N > &gk, const char sum_id[N]) const
Linearization of the grid_key_dx with a specified shift.
void extend_subdomains(const CartDecomposition< dim, T, Memory, Distribution > &dec, const ::Box< dim, T > &ext_dom)
It copy the sub-domains into another CartesianDecomposition object extending them.
Vcluster & v_cl
Runtime virtual cluster machine.
This class decompose a space into sub-sub-domains and distribute them across processors.
T getLow(int i) const
get the i-coordinate of the low bound interval of the box
grid_key_dx is the key to access any element in the grid
CartDecomposition_ext(Vcluster &v_cl)
Cartesian decomposition constructor.
::Box< dim, T > bbox
Processor bounding box.
CartDecomposition< dim, T, Memory, Distribution > base_type
The non-extended decomposition base class.
size_t size() const
Return the size of the grid.
T spacing[dim]
Box Spacing.
void extend_fines(const CartDecomposition< dim, T, Memory, Distribution > &dec)
Extend the fines for the new Cartesian decomposition.
void setHigh(int i, T val)
set the high interval of the box
Distribution dist
Create distribution.
grid_sm< dim, void > gr
Structure that store the cartesian grid information.
mem_id get(size_t i) const
Get the i index.
Implementation of VCluster class.
void setParameters(const CartDecomposition< dim, T, Memory, Distribution > &dec, const Ghost< dim, T > &g, const ::Box< dim, T > &ext_domain)
It create another object that contain the same decomposition information but with different ghost box...
This class decompose a space into sub-sub-domains and distribute them across processors.
void Initialize_geo_cell_lists()
Initialize geo_cell lists.
const grid_key_dx< dim > & get() const
Get the actual key.
Ghost< dim, T > ghost
ghost info
size_t bc[dim]
Boundary condition info.
void setLow(int i, T val)
set the low interval of the box
bool isNext()
Check if there is the next element.
This class is a trick to indicate the compiler a specific specialization pattern. ...
void calculateGhostBoxes()
It calculate the internal ghost boxes.
void set_d(size_t i, mem_id id)
Set the i index.
::Box< dim, T > domain
rectangular domain to decompose
openfpm::vector< SpaceBox< dim, T > > sub_domains
the set of all local sub-domain as vector
openfpm::vector< openfpm::vector< long unsigned int > > box_nn_processor
for each sub-domain, contain the list of the neighborhood processors
void setDimensions(const size_t(&dims)[N])
Reset the dimension of the grid.
void applyBC(openfpm::vector< Box_loc_sub< dim, T >> &sub_domains, const Box< dim, T > &domain, const Ghost< dim, T > &ghost, const size_t(&bc)[dim])
In case of periodic boundary conditions we replicate the sub-domains at the border.
This class store the adjacent processors and the adjacent sub_domains.