template<unsigned int dim, typename T>
class nn_prcs< dim, T >
This class store the adjacent processors and the adjacent sub_domains.
- Template Parameters
-
dim | is the dimensionality of the physical domain we are going to decompose. |
T | type of the space we decompose, Real, Integer, Complex ... |
- See Also
- CartDecomposition
Definition at line 23 of file nn_processor.hpp.
|
| nn_prcs (Vcluster &v_cl) |
| Constructor require Vcluster.
|
|
| nn_prcs (const nn_prcs< dim, T > &ilg) |
| Constructor from another nn_prcs.
|
|
| nn_prcs (nn_prcs< dim, T > &&ilg) |
| Constructor from temporal ie_loc_ghost.
|
|
nn_prcs< dim, T > & | operator= (const nn_prcs< dim, T > &nnp) |
| Copy the object. More...
|
|
nn_prcs< dim, T > & | operator= (nn_prcs< dim, T > &&nnp) |
| Copy the object. More...
|
|
void | create (const openfpm::vector< openfpm::vector< long unsigned int > > &box_nn_processor, const openfpm::vector< SpaceBox< dim, T >> &sub_domains) |
| Create the list of adjacent processors and the list of adjacent sub-domains. More...
|
|
size_t | getNNProcessors () const |
| Get the number of Near processors. More...
|
|
size_t | IDtoProc (size_t id) const |
| Return the processor id of the near processor list at place id. More...
|
|
const openfpm::vector< size_t > & | getNearSubdomainsRealId (size_t p_id) const |
| Get the real-id of the sub-domains of a near processor. More...
|
|
const openfpm::vector< ::Box
< dim, T > > & | getNearSubdomains (size_t p_id) const |
| Get the sub-domains of a near processor. More...
|
|
size_t | getNRealSubdomains (size_t p_id) const |
| Get the number of real sub-domains of a near processor. More...
|
|
const openfpm::vector< comb
< dim > > & | getNearSubdomainsPos (size_t p_id) const |
| Get the sub-domains sector position of a near processor. More...
|
|
size_t | getNearProcessor (size_t p_id) const |
| Get the near processor id. More...
|
|
const openfpm::vector< size_t > & | getSentSubdomains (size_t p_id) const |
| For each near processor it give a vector with the id of the local sub-domain sent to that processor. More...
|
|
size_t | ProctoID (size_t p) const |
| Convert the processor rank to the id in the list. More...
|
|
bool | write (std::string output) const |
| Write the decomposition as VTK file. More...
|
|
void | applyBC (const Box< dim, T > &domain, const Ghost< dim, T > &ghost, const size_t(&bc)[dim]) |
| Apply boundary conditions. More...
|
|
bool | is_equal (nn_prcs< dim, T > &np) |
| Check if the nn_prcs contain the same information. More...
|
|
void | reset () |
| Reset the nn_prcs structure. More...
|
|
std::unordered_map< size_t,
N_box< dim, T > > & | get_nn_processor_subdomains () |
| Used for testing porpose do not use.
|
|
openfpm::vector< size_t > & | get_nn_processors () |
| Used for testing porpose do not use.
|
|
|
void | consistent_shift (Box< dim, T > &box, const Box< dim, T > &domain, const Point< dim, T > &shift) |
| It shift a box but it does consistently. More...
|
|
void | add_nn_subdomain (size_t i, size_t r_sub, const Box< dim, T > &bx, const comb< dim > &c) |
| add sub-domains to processor for a near processor i More...
|
|
void | add_box_periodic (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. More...
|
|
void | flush () |
| Flush the temporal added sub-domain to the processor sub-domain. More...
|
|
template<unsigned int dim, typename T>
void nn_prcs< dim, T >::consistent_shift |
( |
Box< dim, T > & |
box, |
|
|
const Box< dim, T > & |
domain, |
|
|
const Point< dim, T > & |
shift |
|
) |
| |
|
inlineprivate |
It shift a box but it does consistently.
In calculating internal and external ghost boxes, domains are shifted by periodicity. In particular, consider a box touching with the left bolder the left border of the domain
before shift after shift
+--------------------------—+ +---------------------------—+ | | | |
domain | | domain |
| | |
+------—+ | | +------—+ |
+--------------------------—+ +---------------------------—+
shifting the box on the right by the size of the domain, we expect to have a box touching with
the left side the right side of the domain. Because of rounding off problem this is not possible
with a simple shift. This function ensure consistency like ensuring the previous condition, with
the assumption that the shift is +/- the domain size
\param box to shift
\param domain
\param shift
Definition at line 93 of file nn_processor.hpp.
template<unsigned int dim, typename T>
bool nn_prcs< dim, T >::write |
( |
std::string |
output | ) |
const |
|
inline |
Write the decomposition as VTK file.
The function generate several files
1) subdomains_adjacent_X.vtk sub-domains adjacent to the local processor (X)
where X is the local processor rank
- Parameters
-
output | directory where to write the files |
- Returns
- true if the write procedure succeed
subdomains_adjacent_X.vtk sub-domains adjacent to the local processor (X)
Definition at line 605 of file nn_processor.hpp.