8 #ifndef SRC_DECOMPOSITION_GHOST_DEC_IE_GHOST_HPP_ 
    9 #define SRC_DECOMPOSITION_GHOST_DEC_IE_GHOST_HPP_ 
   11 #include "Space/Shape/Box.hpp" 
   12 #include "Space/Ghost.hpp" 
   13 #include "Space/SpaceBox.hpp" 
   15 #include "VTKWriter/VTKWriter.hpp" 
   16 #include "nn_processor.hpp" 
   26 template<
unsigned int dim, 
typename T>
 
   52         for (
size_t i = 0 ; i < sub_domains.size() ; i++)
 
   60             for (
size_t j = 0 ; j < sub_domains_prc.size() ; j++)
 
   62                 size_t rj = sub_domains_prc.get(j).sub;
 
   64                 if (rj == i && sub_domains_prc.get(j).cmb == zero)
 
   69                 bool intersect = sub_with_ghost.
Intersect(sub_domains_prc.get(j).bx,bi);
 
   71                 if (intersect == 
true)
 
   76                     b.
cmb = sub_domains_prc.get(j).cmb;
 
   84                         if (
loc_ghost_box.get(rj).ibx.get(k).sub == i && 
loc_ghost_box.get(rj).ibx.get(k).cmb == sub_domains_prc.get(j).cmb.operator-())
 
  113         for (
size_t i = 0 ; i < sub_domains.size() ; i++)
 
  116             for (
size_t j = 0 ; j < sub_domains_prc.size() ; j++)
 
  119                 size_t rj = sub_domains_prc.get(j).sub;
 
  122                 if (rj == i && sub_domains_prc.get(j).cmb == zero)
 
  132                 if (intersect == 
true)
 
  138                     b.
cmb = sub_domains_prc.get(j).cmb;
 
  160         for (
long int i = dim-1 ; i >= 0 ; i--)
 
  164             for (
size_t j = 0 ; j < cmbs.size() ; j++)
 
  172                 for (
size_t k = 0 ; k < dim ; k++)
 
  197                 for (
size_t k = 0 ; k < sub_domains.size() ; k++)
 
  261         for (
size_t i = 0 ; i < sub_domains.size() ; i++)
 
  264             sub_domains_prc.add(bls);
 
  265             sub_domains_prc.last().sub = i;
 
  268         applyBC(sub_domains_prc,domain,ghost,bc);
 
  511     bool write(std::string output, 
size_t p_id)
 const 
  525         for (
size_t p = 0 ; p < vv5.
size() ; p++)
 
  527             vtk_box5.add(vv5.get(p));
 
  529         vtk_box5.write(output + std::string(
"local_internal_ghost_") + std::to_string(p_id) + std::string(
".vtk"));
 
  543         for (
size_t p = 0 ; p < vv6.
size() ; p++)
 
  545             vtk_box6.add(vv6.get(p));
 
  547         vtk_box6.write(output + std::string(
"local_external_ghost_") + std::to_string(p_id) + std::string(
".vtk"));
 
  568                     std::cout << __FILE__ << 
":" << __LINE__ << 
" Error: inconsistent decomposition no ibx link" << 
"\n";
 
  577                     std::cout << __FILE__ << 
":" << __LINE__ << 
" Error: inconsistent link between an external ghost box and an internal ghost box" << 
"\n";
 
This class represent an N-dimensional box. 
 
openfpm::vector< Box_loc_sub< dim, T > > sub_domains_tmp
temporal added sub-domains 
 
size_t getLocalIGhostSub(size_t i, size_t k) const 
Considering that sub-domains has N internal local ghost box identified with the 0 <= k < N that come ...
 
openfpm::vector< lBox_dom< dim, T > > loc_ghost_box
It contain the calculated local ghost boxes. 
 
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. 
 
void add_subdomain(const Box_loc_sub< dim, T > &bx)
add sub-domains to a temporal list 
 
void flush(openfpm::vector< Box_loc_sub< dim, T >> &sub_domains)
Flush the temporal added sub-domain to the sub-domain list. 
 
ie_loc_ghost< dim, T > & operator=(ie_loc_ghost< dim, T > &&ilg)
copy the ie_loc_ghost 
 
Box< dim, T > bx
extension of this local internal ghost box 
 
for each sub-domain box sub contain the real the sub-domain id 
 
T getHigh(int i) const 
get the high interval of the box 
 
void setHigh(int i, T val)
set the high interval of the box 
 
bool check_consistency(size_t n_sub)
function to check the consistency of the information of the decomposition 
 
This class implement the point shape in an N-dimensional space. 
 
static std::vector< comb< dim > > getCombinations_R_bc(size_t d, const size_t(&bc)[dim])
 
size_t getLocalNEGhost(size_t id)
Get the number of external local ghost box for each sub-domain. 
 
const ::Box< dim, T > & getLocalEGhostBox(size_t i, size_t j) const 
Get the j external local ghost box for the local processor. 
 
Particular case for local internal ghost boxes. 
 
void reset()
Reset the ie_loc_ghost. 
 
const comb< dim > & getLocalIGhostPos(size_t i, size_t j) const 
Get the j internal local ghost box boundary position for the i sub-domain of the local processor...
 
bool Intersect(const Box< dim, T > &b, Box< dim, T > &b_out) const 
Intersect. 
 
size_t getNLocalSub()
Get the number of local sub-domains. 
 
void create_loc_ghost_ibox(Ghost< dim, T > &ghost, openfpm::vector< SpaceBox< dim, T >> &sub_domains, openfpm::vector< Box_loc_sub< dim, T >> &sub_domains_prc)
Create the internal local ghost boxes. 
 
void enlarge(const Box< dim, T > &gh)
Enlarge the box with ghost margin. 
 
void create(openfpm::vector< SpaceBox< dim, T >> &sub_domains, Box< dim, T > &domain, Ghost< dim, T > &ghost, const size_t(&bc)[dim])
Create external and internal local ghosts. 
 
size_t getLocalIGhostE(size_t i, size_t j)
For the sub-domain i intersected with a surrounding sub-domain enlarged. Produce a internal ghost box...
 
ie_loc_ghost(ie_loc_ghost< dim, T > &&ilg)
Constructor from temporal ie_loc_ghost. 
 
ie_loc_ghost()
Default constructor. 
 
const T & get(size_t i) const 
Get coordinate. 
 
void setLow(int i, T val)
set the low interval of the box 
 
const comb< dim > & getLocalEGhostPos(size_t i, size_t j) const 
Get the j external local ghost box for the local processor. 
 
bool is_equal(ie_loc_ghost< dim, T > &ilg)
Check if the ie_loc_ghosts contain the same information. 
 
void zero()
Set all the elements to zero. 
 
This class represent an N-dimensional box. 
 
bool is_equal_ng(ie_loc_ghost< dim, T > &ilg)
Check if the ie_loc_ghosts contain the same information with the exception of the ghost part...
 
bool write(std::string output, size_t p_id) const 
Write the decomposition as VTK file. 
 
comb< dim > cmb
Where this sub_domain live. 
 
const ::Box< dim, T > & getLocalIGhostBox(size_t i, size_t j) const 
Get the j internal local ghost box for the i sub-domain. 
 
structure that store and compute the internal and external local ghost box 
 
size_t getLocalEGhostSub(size_t i, size_t k) const 
Considering that sub-domains has N external local ghost box identified with the 0 <= k < N that come ...
 
This class calculate elements of the hyper-cube. 
 
ie_loc_ghost< dim, T > & operator=(const ie_loc_ghost< dim, T > &ilg)
copy the ie_loc_ghost 
 
size_t getLocalNIGhost(size_t id)
Get the number of internal local ghost box for each sub-domain. 
 
ie_loc_ghost(const ie_loc_ghost< dim, T > &ilg)
Constructor from another ie_loc_ghost. 
 
Implementation of 1-D std::vector like structure. 
 
void create_loc_ghost_ebox(Ghost< dim, T > &ghost, openfpm::vector< SpaceBox< dim, T >> &sub_domains, openfpm::vector< Box_loc_sub< dim, T >> &sub_domains_prc)
Create the external local ghost boxes. 
 
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.