structure that store and compute the internal and external local ghost box More...
structure that store and compute the internal and external local ghost box
dim | is the dimensionality of the physical domain we are going to decompose. |
T | type of the space we decompose, Real, Integer, Complex ... |
Definition at line 25 of file ie_ghost.hpp.
#include <ie_ghost.hpp>
Public Member Functions | |
ie_ghost () | |
Default constructor. | |
ie_ghost (const ie_ghost< dim, T > &ie) | |
Copy constructor. | |
ie_ghost (ie_ghost< dim, T > &&ie) | |
Copy constructor. | |
ie_ghost< dim, T > & | operator= (ie_ghost< dim, T > &&ie) |
Copy operator. | |
ie_ghost< dim, T > & | operator= (const ie_ghost< dim, T > &ie) |
Copy operator. | |
const openfpm::vector< Point < dim, T > > & | getShiftVectors () |
size_t | convertShift (const comb< dim > &cmb) |
size_t | getProcessorNIGhost (size_t id) const |
Get the number of Internal ghost boxes for one processor. More... | |
size_t | getProcessorNEGhost (size_t id) const |
Get the number of External ghost boxes for one processor id. More... | |
const ::Box< dim, T > & | getProcessorIGhostBox (size_t id, size_t j) const |
Get the j Internal ghost box for one processor. More... | |
const ::Box< dim, T > & | getProcessorEGhostBox (size_t id, size_t j) const |
Get the j External ghost box. More... | |
const comb< dim > & | getProcessorEGhostPos (size_t id, size_t j) const |
Get the j External ghost box sector. More... | |
const comb< dim > & | getProcessorIGhostPos (size_t id, size_t j) const |
Get the ghost box sector of the external ghost box linked with the j internal ghost box. More... | |
size_t | getProcessorIGhostId (size_t id, size_t j) const |
Get the j Internal ghost box id. More... | |
size_t | getProcessorEGhostId (size_t id, size_t j) const |
Get the j External ghost box id. More... | |
size_t | getProcessorIGhostSSub (size_t id, size_t j) const |
Get the sub-domain send-id at witch belong the internal ghost box. More... | |
size_t | getProcessorIGhostSub (size_t id, size_t j) const |
Get the local sub-domain at witch belong the internal ghost box. More... | |
size_t | getProcessorEGhostSub (size_t id, size_t j) const |
Get the local sub-domain at witch belong the external ghost box. More... | |
size_t | getNIGhostBox () const |
Return the total number of the calculated internal ghost boxes. More... | |
const ::Box< dim, T > & | getIGhostBox (size_t b_id) const |
Given the internal ghost box id, it return the internal ghost box. More... | |
size_t | getIGhostBoxProcessor (size_t b_id) const |
Given the internal ghost box id, it return the near processor at witch belong or the near processor that produced this internal ghost box. More... | |
size_t | getNEGhostBox () const |
Get the number of the calculated external ghost boxes. More... | |
inline::Box< dim, T > | getEGhostBox (size_t b_id) const |
Given the external ghost box id, it return the external ghost box. More... | |
size_t | getEGhostBoxProcessor (size_t b_id) const |
Given the external ghost box id, it return the near processor at witch belong or the near processor that produced this external ghost box. More... | |
auto | getInternalIDBoxes (Point< dim, T > &p) -> decltype(geo_cell.getCellIterator(geo_cell.getCell(p))) |
auto | labelPoint (Point< dim, T > &p) -> decltype(geo_cell.getCellIterator(geo_cell.getCell(p))) |
if the point fall into the ghost of some near processor it return the processors id's in which it fall More... | |
template<typename id1 , typename id2 > | |
const openfpm::vector < std::pair< size_t, size_t > > | ghost_processorID_pair (Point< dim, T > &p, const int opt=MULTIPLE) |
Given a position it return if the position belong to any neighborhood processor ghost (Internal ghost) More... | |
template<typename id > | |
const openfpm::vector< size_t > | ghost_processorID (const Point< dim, T > &p, const int opt=MULTIPLE) |
Given a position it return if the position belong to any neighborhood processor ghost (Internal ghost) More... | |
template<typename id1 , typename id2 , typename Mem > | |
const openfpm::vector < std::pair< size_t, size_t > > & | ghost_processorID_pair (const encapc< 1, Point< dim, T >, Mem > &p, const int opt=MULTIPLE) |
Given a position it return if the position belong to any neighborhood processor ghost (Internal ghost) More... | |
template<typename id , typename Mem > | |
const openfpm::vector< size_t > & | ghost_processorID (const encapc< 1, Point< dim, T >, Mem > &p, const int opt=MULTIPLE) |
Given a position it return if the position belong to any neighborhood processor ghost (Internal ghost) More... | |
bool | write (std::string output, size_t p_id) const |
write the information about the ghost in vtk format More... | |
bool | is_equal (ie_ghost< dim, T > &ig) |
Check if the ie_ghosts contain the same information. More... | |
bool | is_equal_ng (ie_ghost< dim, T > &ig) |
Check if the ie_loc_ghosts contain the same information with the exception of the ghost part It is anyway required that the ghost come from the same sub-domains decomposition. More... | |
void | reset () |
Reset the nn_prcs structure. More... | |
Protected Member Functions | |
void | generateShiftVectors (const Box< dim, T > &domain, size_t(&bc)[dim]) |
Here we generare the shift vectors. More... | |
void | Initialize_geo_cell (const Box< dim, T > &domain, const size_t(&div)[dim]) |
Initialize the geo cell list structure. More... | |
void | create_box_nn_processor_ext (Vcluster &v_cl, Ghost< dim, T > &ghost, openfpm::vector< SpaceBox< dim, T >> &sub_domains, const openfpm::vector< openfpm::vector< long unsigned int > > &box_nn_processor, const nn_prcs< dim, T > &nn_p) |
Create the box_nn_processor_int (bx part) structure. More... | |
void | create_box_nn_processor_int (Vcluster &v_cl, Ghost< dim, T > &ghost, openfpm::vector< SpaceBox< dim, T >> &sub_domains, const openfpm::vector< openfpm::vector< long unsigned int > > &box_nn_processor, const nn_prcs< dim, T > &nn_p) |
Create the box_nn_processor_int (nbx part) structure, the geo_cell list and proc_int_box. More... | |
Private Member Functions | |
size_t | link_ebx_ibx (const nn_prcs< dim, T > &nn_p, size_t p_id, size_t i) |
Given a local sub-domain i, it give the id of such sub-domain in the sent list for the processor p_id. More... | |
size_t | ebx_ibx_form (size_t k, size_t b, size_t p_id, const comb< dim > &c, size_t N_b, Vcluster &v_cl, const bool ei) |
This is the external and internal ghost box link formula. More... | |
Private Attributes | |
openfpm::vector < openfpm::vector< Box_proc < dim, T > > > | box_nn_processor_int |
openfpm::vector< Box_dom< dim, T > > | proc_int_box |
It store the same information of box_nn_processor_int organized by processor id. | |
openfpm::vector< p_box< dim, T > > | vb_ext |
External ghost boxes for this processor. | |
openfpm::vector< p_box< dim, T > > | vb_int |
Internal ghost boxes for this processor domain. | |
CellList< dim, T, Mem_fast <>, shift< dim, T > > | geo_cell |
Cell-list that store the geometrical information of the internal ghost boxes. | |
openfpm::vector< Point< dim, T > > | shifts |
shift vectors | |
openfpm::vector< std::pair < size_t, size_t > > | ids_p |
Temporal buffers to return temporal information for ghost_processorID. | |
openfpm::vector< size_t > | ids |
Temporal buffers to return temporal information. | |
shift_vect_converter< dim, T > | sc_convert |
shift converter | |
|
inline |
It return the converted shift vector
In high dimensions the number of shifts vectors explode exponentially, so we are expecting that some of the boundary is non periodic to reduce the numbers of shift vectors
Definition at line 521 of file ie_ghost.hpp.
|
inlineprotected |
Create the box_nn_processor_int (bx part) structure.
For each sub-domain of the local processor it store the intersection between the enlarged sub-domain of the calling processor with the adjacent processors sub-domains (External ghost box)
v_cl | Virtual cluster |
ghost | margins |
sub_domains | vector of local sub-domains |
box_nn_processor | it will store for each sub-domain the near processors |
nn_p | contain the sub-domains of the near processors |
Definition at line 195 of file ie_ghost.hpp.
|
inlineprotected |
Create the box_nn_processor_int (nbx part) structure, the geo_cell list and proc_int_box.
This structure store for each sub-domain of this processors the boxes that come from the intersection of the near processors sub-domains enlarged by the ghost size (Internal ghost box). These boxes fill a geometrical cell list. The proc_int_box store the same information ordered by near processors
v_cl | Virtual cluster |
ghost | margins |
sub_domains | |
box_nn_processor | sub-domains of the near processors |
nn_p | structure that store the near processor sub-domains |
Definition at line 296 of file ie_ghost.hpp.
|
inlineprivate |
This is the external and internal ghost box link formula.
This formula is pretty important and require an extensive explanation
+------------+ | | | +---+---------+ | Processor 5| | | | | E | Proc 6 | | Sub 0 | 0 | | | | _ | Sub 9 | | | 9 | | | | | | | +---+---------+ | | +------------+ *
E0_6 is an external ghost box from the prospective of processor 5 and an internal ghost boxes from the prospective of processor 6. So for every external ghost box that processor 5 compute, exist an internal ghost box in processor 6
Here we link this information with an unique id, for processor 5 and 6. Consider Processor 5 sending to processor 6 its sub-domains, including the one in figure with id 0 in the list, and receive from processor 6 the sub-domain in figure as id 9. Consider also we have 16 processor. E0_9 come from the intersection of the expanded sub-domain 0 with 9 (Careful the id is related to the send and receive position in the list) and the intersection is in the sector 0
The id of the external box (for processor 5) is calculated as
((k * N_b + b) * v_cl.getProcessingUnits() + p_id) * openfpm::math::pow(3,dim) + c.lin()
The parameter assume a different meaning if they the formula is used for calculating external/internal ghost boxes id
k | expanded sub-domain sent/received to/from p_id ( 0 ) |
b | sub-domain received/sent from/to p_id ( 9 ) |
p_id | processor id ( 6 ) |
c | sector where the sub-domain b live |
N_b | number of sub-domain received/sent from/to p_id |
v_cl | Vcluster |
ei | indicate if the formula is used to calculate external (true) or internal (false) ids |
Definition at line 143 of file ie_ghost.hpp.
|
inlineprotected |
Here we generare the shift vectors.
domain | box that describe the domain |
Definition at line 160 of file ie_ghost.hpp.
|
inline |
Given the external ghost box id, it return the external ghost box.
b_id | external ghost box id |
Definition at line 720 of file ie_ghost.hpp.
|
inline |
Given the external ghost box id, it return the near processor at witch belong or the near processor that produced this external ghost box.
b_id | external ghost box id |
Definition at line 733 of file ie_ghost.hpp.
|
inline |
Given the internal ghost box id, it return the internal ghost box.
b_id | internal ghost box id |
Definition at line 685 of file ie_ghost.hpp.
|
inline |
Given the internal ghost box id, it return the near processor at witch belong or the near processor that produced this internal ghost box.
b_id | internal ghost box id |
Definition at line 698 of file ie_ghost.hpp.
|
inline |
/brief Given a point it return the set of boxes in which the point fall
p | Point to check |
Definition at line 745 of file ie_ghost.hpp.
|
inline |
Get the number of the calculated external ghost boxes.
Definition at line 708 of file ie_ghost.hpp.
|
inline |
Return the total number of the calculated internal ghost boxes.
Definition at line 673 of file ie_ghost.hpp.
|
inline |
Get the j External ghost box.
id | near processor list id (the id go from 0 to getNNProcessor()) |
j | box (each near processor can produce more than one external ghost box) |
Definition at line 567 of file ie_ghost.hpp.
|
inline |
Get the j External ghost box id.
Every external ghost box has a linked internal ghost box, because they overlap and they must contain the same information (Think on a ghost_get). So if exist an internal ghost box with id x, exist also an external ghost box with id x
id | near processor list id (the id go from 0 to getNNProcessor()) |
j | box (each near processor can produce more than one external ghost box) |
Definition at line 623 of file ie_ghost.hpp.
|
inline |
Get the j External ghost box sector.
id | near processor list id (the id go from 0 to getNNProcessor()) |
j | box (each near processor can produce more than one external ghost box) |
Definition at line 579 of file ie_ghost.hpp.
|
inline |
Get the local sub-domain at witch belong the external ghost box.
id | near processor list id (the id go from 0 to getNNProcessor()) |
j | box (each near processor can produce more than one external ghost box) |
Definition at line 663 of file ie_ghost.hpp.
|
inline |
Get the j Internal ghost box for one processor.
id | near processor list id (the id go from 0 to getNNProcessor()) |
j | box (each near processor can produce more than one internal ghost box) |
Definition at line 555 of file ie_ghost.hpp.
|
inline |
Get the j Internal ghost box id.
Every internal ghost box has a linked external ghost box, because they overlap and they must contain the same information (Think on a ghost_get). So if exist an internal ghost box with id x, exist also an external ghost box with id x
id | near processor list id (the id go from 0 to getNNProcessor()) |
j | box (each near processor can produce more than one internal ghost box) |
Definition at line 607 of file ie_ghost.hpp.
|
inline |
Get the ghost box sector of the external ghost box linked with the j internal ghost box.
id | near processor list id (the id go from 0 to getNNProcessor()) |
j | box (each near processor can produce more than one internal ghost box) |
Definition at line 591 of file ie_ghost.hpp.
|
inline |
Get the sub-domain send-id at witch belong the internal ghost box.
The internal ghost box is create from the intersection a local sub-domain and an extended sub-domain communicated from another processor. This function return the id of the sub-domain in the receiving list
id | adjacent processor list id (the id go from 0 to getNNProcessor()) |
j | box (each near processor can produce more than one internal ghost box) |
Definition at line 639 of file ie_ghost.hpp.
|
inline |
Get the local sub-domain at witch belong the internal ghost box.
id | adjacent processor list id (the id go from 0 to getNNProcessor()) |
j | box (each near processor can produce more than one internal ghost box) |
Definition at line 651 of file ie_ghost.hpp.
|
inline |
Get the number of External ghost boxes for one processor id.
id | near processor list id (the id go from 0 to getNNProcessor()) |
Definition at line 543 of file ie_ghost.hpp.
|
inline |
Get the number of Internal ghost boxes for one processor.
id | near processor list id (the id go from 0 to getNNProcessor()) |
Definition at line 532 of file ie_ghost.hpp.
|
inline |
It return the shift vector
Consider a domain with some ghost, at the border of the domain the ghost must be treated in a special way, depending on the periodicity of the boundary
[1,1] +---------+------------------------+---------+ | (1,-1) | | (1,1) | | | | (1,0) --> 7 | | | | v | | v | | 6 | | 8 | +--------------------------------------------+ | | | | | | | | | | | | | (-1,0) | | (1,0) | | | | | | | | v | (0,0) --> 4 | v | | 3 | | 5 | | | | | B | | | A | * | | | * | | | | | | | | | | | | | +--------------------------------------------+ | (-1,-1) | | (-1,1) | | | | (-1,0) --> 1 | | | | v | | v | | 0 | | 2 | +---------+------------------------+---------+
if a particle is bound in (1,0) linearized to 5, before communicate this particle (A in figure) must be shifted on -1.0 on x (B in figure)
This function return the set of shift vectors that determine such shift, for example in the example above the shift at position 5 will be (0,-1.0)
Definition at line 507 of file ie_ghost.hpp.
|
inline |
Given a position it return if the position belong to any neighborhood processor ghost (Internal ghost)
if the particle come from an internal ghost from the periodicity of the domain, position must be shifted this function return the id of the shift vector
id | type of id to get box_id processor_id lc_processor_id shift_id |
p | Particle position |
opt | intersection boxes of the same processor can overlap, so in general the function can produce more entry with the same processor, the UNIQUE option eliminate double entries (UNIQUE) is for particle data (MULTIPLE) is for grid data [default MULTIPLE] |
Definition at line 828 of file ie_ghost.hpp.
|
inline |
Given a position it return if the position belong to any neighborhood processor ghost (Internal ghost)
id | type of if to get box_id processor_id lc_processor_id |
p | Particle position |
opt | it indicate if the entry in the vector must be unique or not |
Definition at line 915 of file ie_ghost.hpp.
|
inline |
Given a position it return if the position belong to any neighborhood processor ghost (Internal ghost)
if the particle come from an internal ghost from the periodicity of the domain, position must be shifted this function return the id of the shift vector
id | type of id to get box_id processor_id lc_processor_id shift_id |
p | Particle position |
opt | intersection boxes of the same processor can overlap, so in general the function can produce more entry with the same processor, the UNIQUE option eliminate double entries (UNIQUE) is for particle data (MULTIPLE) is for grid data [default MULTIPLE] |
Definition at line 779 of file ie_ghost.hpp.
|
inline |
Given a position it return if the position belong to any neighborhood processor ghost (Internal ghost)
id1 | first index type to get box_id processor_id lc_processor_id |
id2 | second index type to get box_id processor_id lc_processor_id |
p | Particle position |
opt | indicate if the entries in the vector must be unique |
Definition at line 872 of file ie_ghost.hpp.
|
inlineprotected |
Initialize the geo cell list structure.
The geo cell list structure exist to speed up the labelling the points if they fall on some internal ghost
domain | where the cell list is defined |
div | number of division of the cell list |
Definition at line 174 of file ie_ghost.hpp.
|
inline |
Check if the ie_ghosts contain the same information.
ig | Element to check |
Definition at line 993 of file ie_ghost.hpp.
|
inline |
Check if the ie_loc_ghosts contain the same information with the exception of the ghost part It is anyway required that the ghost come from the same sub-domains decomposition.
ig | Element to check |
Definition at line 1058 of file ie_ghost.hpp.
|
inline |
if the point fall into the ghost of some near processor it return the processors id's in which it fall
p | Point |
Definition at line 757 of file ie_ghost.hpp.
|
inlineprivate |
Given a local sub-domain i, it give the id of such sub-domain in the sent list for the processor p_id.
Processor 5 send its sub-domains to processor 6 and will receive the list from 6
This function search if a local sub-domain has been sent to a processor p_id, if found it return at witch position is in the list of the sent sub-domains
nn_p | structure that store the processor graph as near processor |
p_id | near processor rank |
i | sub-domain |
Definition at line 73 of file ie_ghost.hpp.
|
inline |
Reset the nn_prcs structure.
Definition at line 1066 of file ie_ghost.hpp.
|
inline |
write the information about the ghost in vtk format
1) internal_ghost_X.vtk Internal ghost boxes for the local processor (X) 2) external_ghost_X.vtk External ghost boxes for the local processor (X)
output | directory |
p_id | processor rank |
internal_ghost_X.vtk Internal ghost boxes for the local processor (X)
external_ghost_X.vtk External ghost boxes for the local processor (X)
Definition at line 959 of file ie_ghost.hpp.
|
private |
for each sub-domain (first vector), contain the list (nested vector) of the neighborhood processors and for each processor contain the boxes calculated from the intersection of the sub-domains + ghost with the near-by processor sub-domain () and the other way around
Definition at line 31 of file ie_ghost.hpp.