8 #ifndef SRC_GRID_GRID_DIST_UTIL_HPP_
9 #define SRC_GRID_GRID_DIST_UTIL_HPP_
11 #include "NN/CellList/CellDecomposer.hpp"
21 template<
unsigned int dim>
void getCellDecomposerPar(
size_t (& c_g)[dim],
const size_t (& g_sz)[dim],
const size_t (& bc)[dim])
23 for (
size_t i = 0 ; i < dim ; i++)
25 if (bc[i] == NON_PERIODIC)
26 c_g[i] = (g_sz[i]-1 > 0)?(g_sz[i]-1):1;
52 for(
size_t i = 0 ; i < dim ; i++)
53 p.bc[i] = NON_PERIODIC;
71 size_t n_grid = dec.getNSubDomain();
74 for (
size_t i = 0 ; i < n_grid ; i++)
86 for (
size_t i = 0 ; i < Decomposition::dims ; i++)
97 gdb_ext.last().origin = sp_tg.
getP1();
101 gdb_ext.last().Dbox = sp_t;
102 gdb_ext.last().Dbox -= sp_tg.
getP1();
104 gdb_ext.last().GDbox = sp_tg;
105 gdb_ext.last().GDbox -= sp_tg.
getP1();
122 CellDecomposer_sm<Decomposition::dims,typename Decomposition::stype, shift<Decomposition::dims,typename Decomposition::stype>> cd_sm;
127 getCellDecomposerPar<Decomposition::dims>(cdp,sz,dec.periodicity());
130 cd_sm.setDimensions(domain,cdp,0);
132 create_gdb_ext<dim,Decomposition>(gdb_ext,dec,cd_sm);
135 for (
size_t i = 0 ; i < dim ; i++)
136 {spacing[i] = cd_sm.getCellBox().getP2()[i];}
This class represent an N-dimensional box.
comb< dim > cmb
Sector position of the external ghost.
T getLow(int i) const
get the i-coordinate of the low bound interval of the box
Position of the element of dimension d in the hyper-cube of dimension dim.
size_t sub
sub_id in which sub-domain this box live
it store an internal ghost box, the linked external ghost box and the sub-domain from where it come f...
T getHigh(int i) const
get the high interval of the box
Per-processor Internal ghost box.
void setHigh(int i, T val)
set the high interval of the box
::Box< dim, long int > box
Box.
comb< dim > cmb
Sector where it live the linked external ghost box.
Point< dim, T > getP1() const
Get the point p1.
size_t k
external ghost box linked to this internal ghost box
It store the information about the local external ghost box.
This structure store the Box that define the domain inside the Ghost + domain box.
This class define the domain decomposition interface.
bool initialized
Has this external ghost box initialized.
it store a box, its unique id and the sub-domain from where it come from
size_t k
external ghost box linked to this internal ghost box
comb< dim > cmb
combination
void setLow(int i, T val)
set the low interval of the box
It store the information about the external ghost box.
This class represent an N-dimensional box.
size_t sub
sub_id in which sub-domain this box live
::Box< dim, long int > box
Box defining the external ghost box in local coordinates.
Per-processor external ghost box.
::Box< dim, long int > l_e_box
Box defining the external ghost box in local coordinates.
::Box< dim, long int > g_e_box
Box defining the external ghost box in global coordinates.
Per-processor external ghost box.
size_t r_sub
r_sub id of the sub-domain in the sent list
Implementation of 1-D std::vector like structure.
comb< dim > cmb
Sector position of the local external ghost box.
::Box< dim, long int > box
Box.