OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
CartDecomposition< dim, T, Memory, layout_base, Distribution > Class Template Reference

This class decompose a space into sub-sub-domains and distribute them across processors. More...

Detailed Description

template<unsigned int dim, typename T, typename Memory, template< typename > class layout_base, typename Distribution>
class CartDecomposition< dim, T, Memory, layout_base, Distribution >

This class decompose a space into sub-sub-domains and distribute them across processors.

Template Parameters
dimis the dimensionality of the physical domain we are going to decompose.
Ttype of the space we decompose, Real, Integer, Complex ...
MemoryMemory factory used to allocate memory
Distributiontype of distribution, can be ParMetisDistribution or MetisDistribution

Given an N-dimensional space, this class decompose the space into a Cartesian grid of small sub-sub-domain. To each sub-sub-domain is assigned an id that identify at which processor is assigned (in general the union of all the sub-sub-domain assigned to a processor is simply connected space), a second step merge several sub-sub-domain with same id into bigger region sub-domain. Each sub-domain has an extended space called ghost part

Assuming that VCluster.getProcessUnitID(), equivalent to the MPI processor rank, return the processor local processor id, we define

  • local processor: processor rank
  • local sub-domain: sub-domain given to the local processor
  • external ghost box: (or ghost box) are the boxes that compose the ghost space of the processor, or the boxes produced expanding every local sub-domain by the ghost extension and intersecting with the sub-domain of the other processors
  • Near processors are the processors adjacent to the local processor, where with adjacent we mean all the processor that has a non-zero intersection with the ghost part of the local processor, or all the processors that produce non-zero external boxes with the local processor, or all the processor that should communicate in case of ghost data synchronization
  • internal ghost box: is the part of ghost of the near processor that intersect the space of the processor, or the boxes produced expanding the sub-domain of the near processors with the local sub-domain
  • Near processor sub-domain: is a sub-domain that live in the a near (or contiguous) processor
  • Near processor list: the list of all the near processor of the local processor (each processor has a list of the near processor)
  • Local ghosts internal or external are all the ghosts that does not involve inter-processor communications
See also
calculateGhostBoxes() for a visualization of internal and external ghost boxes

Create a Cartesian decomposition object on a Box space, distribute, calculate internal and external ghost boxes

Definition at line 140 of file CartDecomposition.hpp.

#include <CartDecomposition.hpp>

+ Inheritance diagram for CartDecomposition< dim, T, Memory, layout_base, Distribution >:

Data Structures

class  box_id
 class to select the returned id by ghost_processorID More...
 
class  lc_processor_id
 class to select the returned id by ghost_processorID More...
 
class  processor_id
 class to select the returned id by ghost_processorID More...
 
class  shift_id
 class to select the returned id by ghost_processorID More...
 

Public Types

typedef T domain_type
 Type of the domain we are going to decompose.
 
typedef SpaceBox< dim, T > Box
 It simplify to access the SpaceBox element.
 
typedef CartDecomposition< dim, T, Memory, layout_base, Distribution > base_type
 This class is base of itself.
 
typedef CartDecomposition_ext< dim, T, Memory, layout_base, Distribution > extended_type
 This class admit a class defined on an extended domain.
 
typedef ie_loc_ghost< dim, T, layout_base, Memory > ie_loc_ghost_type
 
typedef nn_prcs< dim, T, layout_base, Memory > nn_prcs_type
 
typedef ie_ghost< dim, T, Memory, layout_base > ie_ghost_type
 
typedef T stype
 Space type.
 

Public Member Functions

void initialize_fine_s (const ::Box< dim, T > &domain)
 
void construct_fine_s ()
 
void createSubdomains (Vcluster<> &v_cl, const size_t(&bc)[dim], size_t opt=0)
 Constructor, it decompose and distribute the sub-domains across the processors.
 
void Initialize_geo_cell_lists ()
 Initialize geo_cell lists.
 
void computeCommunicationAndMigrationCosts (size_t ts)
 Calculate communication and migration costs.
 
void CreateSubspaces ()
 Create the sub-domain that decompose your domain.
 
void calculateGhostBoxes ()
 It calculate the internal ghost boxes.
 
void incRef ()
 Increment the reference counter.
 
void decRef ()
 Decrement the reference counter.
 
long int ref ()
 Return the reference counter.
 
 CartDecomposition (Vcluster<> &v_cl)
 Cartesian decomposition constructor.
 
 CartDecomposition (const CartDecomposition< dim, T, Memory, layout_base, Distribution > &cart)
 Cartesian decomposition copy constructor.
 
 CartDecomposition (CartDecomposition< dim, T, Memory, layout_base, Distribution > &&cart)
 Cartesian decomposition copy constructor.
 
 ~CartDecomposition ()
 Cartesian decomposition destructor.
 
void applyPointBC (float(&pt)[dim]) const
 Apply boundary condition to the point.
 
void applyPointBC (Point< dim, T > &pt) const
 Apply boundary condition to the point.
 
template<typename Mem >
void applyPointBC (encapc< 1, Point< dim, T >, Mem > &&pt) const
 Apply boundary condition to the point.
 
CartDecomposition< dim, T, Memory, layout_base, Distribution > duplicate (const Ghost< dim, T > &g) const
 It create another object that contain the same decomposition information but with different ghost boxes.
 
CartDecomposition< dim, T, Memory, layout_base, Distribution > duplicate () const
 It create another object that contain the same information and act in the same way.
 
template<typename Memory2 , template< typename > class layout_base2>
CartDecomposition< dim, T, Memory2, layout_base2, Distribution > duplicate_convert () const
 It create another object that contain the same information and act in the same way.
 
CartDecomposition< dim, T, Memory, layout_base, Distribution > & operator= (const CartDecomposition &cart)
 Copy the element.
 
template<typename CartDecomposition2 >
CartDecomposition< dim, T, Memory, layout_base, Distribution > & operator= (const CartDecomposition2 &cart)
 Copy the element.
 
CartDecomposition< dim, T, Memory, layout_base, Distribution > & operator= (CartDecomposition &&cart)
 Copy the element, move semantic.
 
template<typename Mem >
size_t processorID (const encapc< 1, Point< dim, T >, Mem > &p) const
 Given a point return in which processor the particle should go.
 
size_t processorID (const Point< dim, T > &p) const
 Given a point return in which processor the particle should go.
 
size_t processorID (const T(&p)[dim]) const
 Given a point return in which processor the particle should go.
 
template<typename Mem >
size_t processorIDBC (encapc< 1, Point< dim, T >, Mem > p)
 Given a point return in which processor the point/particle should go.
 
size_t processorIDBC (const Point< dim, T > &p) const
 Given a point return in which processor the particle should go.
 
size_t processorIDBC (const T(&p)[dim]) const
 Given a point return in which processor the particle should go.
 
size_t periodicity (size_t i) const
 Get the periodicity on i dimension.
 
const size_t(& periodicity () const)[dim]
 Get the periodicity.
 
void calculate_magn (const grid_sm< dim, void > &gm)
 Calculate magnification.
 
void setGoodParameters (::Box< dim, T > &domain_, const size_t(&bc)[dim], const Ghost< dim, T > &ghost, size_t dec_gran, const grid_sm< dim, void > &sec_dist=grid_sm< dim, void >())
 Set the best parameters for the decomposition.
 
void getParameters (size_t(&div_)[dim])
 return the parameters of the decomposition
 
void setParameters (const size_t(&div_)[dim], ::Box< dim, T > &domain_, const size_t(&bc)[dim], const Ghost< dim, T > &ghost, const grid_sm< dim, void > &sec_dist=grid_sm< dim, void >())
 Set the parameter of the decomposition.
 
void reset ()
 Delete the decomposition and reset the data-structure.
 
void decompose (dec_options opt=dec_options::DEC_NONE)
 Start decomposition.
 
void refine (size_t ts)
 Refine the decomposition, available only for ParMetis distribution, for Metis it is a null call.
 
void redecompose (size_t ts)
 Refine the decomposition, available only for ParMetis distribution, for Metis it is a null call.
 
bool refine (DLB &dlb)
 Refine the decomposition, available only for ParMetis distribution, for Metis it is a null call.
 
float getUnbalance ()
 Get the current un-balance value.
 
size_t getProcessorLoad ()
 Compute the processor load counting the total weights of its vertices.
 
void getSubSubDomainPosition (size_t id, T(&pos)[dim])
 function that return the position of the cell in the space
 
size_t getNSubSubDomains ()
 Get the number of sub-sub-domains in this sub-graph.
 
void setSubSubDomainComputationCost (size_t id, size_t weight)
 Function that set the computational cost for a of a sub-sub domain.
 
size_t getSubSubDomainComputationCost (size_t id)
 function that return the computation cost of the sub-sub-domain id
 
size_t subSize ()
 Operator to access the size of the sub-graph.
 
size_t getNSubDomain ()
 Get the number of local sub-domains.
 
SpaceBox< dim, T > getSubDomain (size_t lc)
 Get the local sub-domain.
 
SpaceBox< dim, T > getSubDomainWithGhost (size_t lc)
 Get the local sub-domain enlarged with ghost extension.
 
const ::Box< dim, T > & getDomain () const
 Return the box of the physical domain.
 
const openfpm::vector< SpaceBox< dim, T >, Memory, layout_base > & getSubDomains () const
 
template<typename Mem >
bool isLocal (const encapc< 1, Point< dim, T >, Mem > p) const
 Check if the particle is local.
 
bool isLocal (const T(&pos)[dim]) const
 Check if the particle is local.
 
bool isLocal (const Point< dim, T > &pos) const
 Check if the particle is local.
 
template<typename Mem >
bool isLocalBC (const encapc< 1, Point< dim, T >, Mem > p, const size_t(&bc)[dim]) const
 Check if the particle is local considering boundary conditions.
 
bool isLocalBC (const Point< dim, T > &p, const size_t(&bc)[dim]) const
 Check if the particle is local considering boundary conditions.
 
openfpm::vector< size_t > & getDomainCells ()
 Get the domain Cells.
 
openfpm::vector< size_t > & getCRSDomainCells ()
 Get the CRS domain Cells with normal neighborhood.
 
void setNNParameters (grid_key_dx< dim > &shift, grid_sm< dim, void > &gs)
 set NN parameters to calculate cell-list neighborhood
 
openfpm::vector< subsub_lin< dim > > & getCRSAnomDomainCells ()
 Get the CRS anomalous cells.
 
bool isLocalBC (const T(&p)[dim], const size_t(&bc)[dim]) const
 Check if the particle is local considering boundary conditions.
 
::Box< dim, T > & getProcessorBounds ()
 Return the bounding box containing union of all the sub-domains for the local processor.
 
const Ghost< dim, T > & getGhost () const
 Return the ghost.
 
const grid_sm< dim, void > getGrid ()
 Decomposition grid.
 
const grid_sm< dim, void > getDistGrid ()
 Distribution grid.
 
bool write (std::string output) const
 Write the decomposition as VTK file.
 
VclustergetVC () const
 Get the Virtual Cluster machine.
 
void free_geo_cell ()
 Deallocate structures that identify a point to which internal ghost is located.
 
void free_fines ()
 Deallocate structures that identify a point to which internal ghost is located.
 
bool check_consistency ()
 function to check the consistency of the information of the decomposition
 
void debugPrint ()
 Print subdomains, external and internal ghost boxes.
 
bool is_equal (CartDecomposition< dim, T, Memory > &cart)
 Check if the CartDecomposition contain the same information.
 
bool is_equal_ng (CartDecomposition< dim, T, Memory > &cart)
 Check if the CartDecomposition 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.
 
Distribution & getDistribution ()
 Return the distribution object.
 
void addComputationCost (size_t gid, size_t i)
 Add computation cost i to the subsubdomain with global id gid.
 
size_t get_ndec ()
 Get the decomposition counter.
 
const CellDecomposer_sm< dim, T, shift< dim, T > > & getCellDecomposer ()
 Get the cell decomposer of the decomposition.
 
CartDecomposition_gpu< dim, T, Memory, layout_base > toKernel ()
 convert to a structure usable in a device kernel
 
openfpm::vector< SpaceBox< dim, T > > & private_get_sub_domains ()
 Return the internal data structure sub_domains.
 
const openfpm::vector< SpaceBox< dim, T > > & private_get_sub_domains () const
 Return the internal data structure sub_domains.
 
openfpm::vector< openfpm::vector< long unsigned int > > & private_get_box_nn_processor ()
 Return the internal data structure box_nn_processor.
 
const openfpm::vector< openfpm::vector< long unsigned int > > & private_get_box_nn_processor () const
 Return the internal data structure box_nn_processor.
 
CellList< dim, T, Mem_fast< Memory, int >, shift< dim, T > > & private_get_fine_s ()
 Return the internal data structure fine_s.
 
const CellList< dim, T, Mem_fast< Memory, int >, shift< dim, T > > & private_get_fine_s () const
 Return the internal data structure fine_s.
 
grid_sm< dim, void > & private_get_gr ()
 Return the internal data structure gr.
 
const grid_sm< dim, void > & private_get_gr () const
 Return the internal data structure gr.
 
grid_sm< dim, void > & private_get_gr_dist ()
 Return the internal data structure gr_dist.
 
const grid_sm< dim, void > & private_get_gr_dist () const
 Return the internal data structure gr_dist.
 
Distribution & private_get_dist ()
 Return the internal data structure dist.
 
const Distribution & private_get_dist () const
 Return the internal data structure dist.
 
bool & private_get_commCostSet ()
 Return the internal data structure commCostSet.
 
const bool & private_get_commCostSet () const
 Return the internal data structure commCostSet.
 
CellDecomposer_sm< dim, T, shift< dim, T > > & private_get_cd ()
 Return the internal data structure cd.
 
const CellDecomposer_sm< dim, T, shift< dim, T > > & private_get_cd () const
 Return the internal data structure cd.
 
::Box< dim, T > & private_get_domain ()
 Return the internal data structure domain.
 
const ::Box< dim, T > & private_get_domain () const
 Return the internal data structure domain.
 
openfpm::vector< Box_map< dim, T >, Memory, layout_base > & private_get_sub_domains_global ()
 Return the internal data structure sub_domains_global.
 
const openfpm::vector< Box_map< dim, T >, Memory, layout_base > & private_get_sub_domains_global () const
 Return the internal data structure sub_domains_global.
 
T & private_get_spacing (int i)
 Return the internal data structure spacing.
 
const T & private_get_spacing (int i) const
 Return the internal data structure spacing.
 
T & private_get_magn (int i)
 Return the internal data structure magn.
 
const T & private_get_magn (int i) const
 Return the internal data structure magn.
 
Ghost< dim, T > & private_get_ghost ()
 Return the internal data structure ghost.
 
const Ghost< dim, T > & private_get_ghost () const
 Return the internal data structure ghost.
 
::Box< dim, T > & private_get_bbox ()
 Return the internal data structure bbox.
 
const ::Box< dim, T > & private_get_bbox () const
 Return the internal data structure bbox.
 
size_t & private_get_bc (int i)
 Return the internal data structure bc.
 
const size_t & private_get_bc (int i) const
 Return the internal data structure bc.
 
- Public Member Functions inherited from ie_loc_ghost< dim, T, layout_base, Memory >
void create (openfpm::vector< SpaceBox< dim, T >, Memory, layout_base > &sub_domains, Box< dim, T > &domain, Ghost< dim, T > &ghost, const size_t(&bc)[dim])
 Create external and internal local ghosts.
 
 ie_loc_ghost ()
 Default constructor.
 
 ie_loc_ghost (const ie_loc_ghost< dim, T, layout_base, Memory > &ilg)
 Constructor from another ie_loc_ghost.
 
 ie_loc_ghost (ie_loc_ghost< dim, T, layout_base, Memory > &&ilg)
 Constructor from temporal ie_loc_ghost.
 
ie_loc_ghost< dim, T, layout_base, Memory > & operator= (const ie_loc_ghost< dim, T, layout_base, Memory > &ilg)
 copy the ie_loc_ghost
 
ie_loc_ghost< dim, T, layout_base, Memory > & operator= (ie_loc_ghost< dim, T, layout_base, Memory > &&ilg)
 copy the ie_loc_ghost
 
template<template< typename > class layout_base2, typename Memory2 >
ie_loc_ghost< dim, T, layout_base, Memory > & operator= (const ie_loc_ghost< dim, T, layout_base2, Memory2 > &ilg)
 copy the ie_loc_ghost
 
template<template< typename > class layout_base2, typename Memory2 >
ie_loc_ghost< dim, T, layout_base, Memory > & operator= (ie_loc_ghost< dim, T, layout_base2, Memory2 > &&ilg)
 copy the ie_loc_ghost
 
openfpm::vector< lBox_dom< dim, T > > & private_get_loc_ghost_box ()
 Get the internal loc_ghost_box.
 
size_t getNLocalSub ()
 Get the number of local ghost boxes.
 
size_t getLocalNEGhost (size_t id)
 Get the number of external local ghost box for each sub-domain.
 
size_t getLocalNIGhost (size_t id)
 Get the number of internal local ghost box for each sub-domain.
 
size_t getLocalIGhostE (size_t i, size_t j)
 For the sub-domain i intersected with a surrounding sub-domain enlarged j. Produce a internal ghost box from the prospecive of i and an associated external ghost box from the prospective of j. In order to retrieve the information about the external ghost box we have to use getLocalEGhostBox(x,k). where k is the value returned by getLocalIGhostE(i,j) and x is the value returned by getLocalIGhostSub(i,j)
 
const ::Box< dim, T > & getLocalIGhostBox (size_t i, size_t j) const
 Get the j internal local ghost box for the i sub-domain.
 
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.
 
const ::Box< dim, T > & getLocalEGhostBox (size_t i, size_t j) const
 Get the j external local ghost box for the local processor.
 
const comb< dim > & getLocalEGhostPos (size_t i, size_t j) const
 Get the j external local ghost box for the local processor.
 
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 from the intersection of 2 sub-domains i and j where j is enlarged, given the sub-domain i and the id k of the internal box, it return the id j of the other sub-domain that produced the intersection.
 
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 from the intersection of 2 sub-domains i and j where i is enlarged, given the sub-domain i and the id k of the external box, it return the id of the other sub-domain j that produced the intersection.
 
bool write (std::string output, size_t p_id) const
 Write the decomposition as VTK file.
 
bool check_consistency (size_t n_sub)
 function to check the consistency of the information of the decomposition
 
bool is_equal (ie_loc_ghost< dim, T, layout_base, Memory > &ilg)
 Check if the ie_loc_ghosts contain the same information.
 
bool is_equal_ng (ie_loc_ghost< dim, T, layout_base, Memory > &ilg)
 Check if the ie_loc_ghosts contain the same information with the exception of the ghost part.
 
void reset ()
 Reset the ie_loc_ghost.
 
- Public Member Functions inherited from nn_prcs< dim, T, layout_base, Memory >
 nn_prcs (Vcluster<> &v_cl)
 Constructor require Vcluster.
 
 nn_prcs (const nn_prcs< dim, T, layout_base, Memory > &ilg)
 Constructor from another nn_prcs.
 
 nn_prcs (nn_prcs< dim, T, layout_base, Memory > &&ilg)
 Constructor from temporal ie_loc_ghost.
 
nn_prcs< dim, T, layout_base, Memory > & operator= (const nn_prcs< dim, T, layout_base, Memory > &nnp)
 Copy the object.
 
nn_prcs< dim, T, layout_base, Memory > & operator= (nn_prcs< dim, T, layout_base, Memory > &&nnp)
 Copy the object.
 
template<typename Memory2 , template< typename > class layout_base2>
nn_prcs< dim, T, layout_base, Memory > & operator= (const nn_prcs< dim, T, layout_base2, Memory2 > &nnp)
 Copy the object.
 
openfpm::vector< size_t > & private_get_nn_processors ()
 Return the internal nn_processor struct.
 
std::unordered_map< size_t, N_box< dim, T > > & private_get_nn_processor_subdomains ()
 Return the internal nn_processor_subdomains.
 
openfpm::vector< openfpm::vector< size_t > > & private_get_proc_adj_box ()
 Return the internal proc_adj_box.
 
openfpm::vector< openfpm::vector< ::SpaceBox< dim, T > > > & private_get_boxes ()
 Return the internal boxes structure.
 
template<typename Memory2 , template< typename > class layout_base2>
nn_prcs< dim, T, layout_base, Memory > & operator= (nn_prcs< dim, T, layout_base2, Memory2 > &&nnp)
 Copy the object.
 
void create (const openfpm::vector< openfpm::vector< long unsigned int > > &box_nn_processor, const openfpm::vector< SpaceBox< dim, T >, Memory, layout_base > &sub_domains)
 Create the list of adjacent processors and the list of adjacent sub-domains.
 
size_t getNNProcessors () const
 Get the number of Near processors.
 
size_t IDtoProc (size_t id) const
 Return the processor id of the near processor list at place id.
 
const openfpm::vector< size_t > & getNearSubdomainsRealId (size_t p_id) const
 Get the real-id of the sub-domains of a near processor.
 
const openfpm::vector< ::Box< dim, T > > & getNearSubdomains (size_t p_id) const
 Get the sub-domains of a near processor.
 
size_t getNRealSubdomains (size_t p_id) const
 Get the number of real sub-domains of a near processor.
 
const openfpm::vector< comb< dim > > & getNearSubdomainsPos (size_t p_id) const
 Get the sub-domains sector position of a near processor.
 
size_t getNearProcessor (size_t p_id) const
 Get the near processor id.
 
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.
 
size_t ProctoID (size_t p) const
 Convert the processor rank to the id in the list.
 
bool write (std::string output) const
 Write the decomposition as VTK file.
 
void applyBC (const Box< dim, T > &domain, const Ghost< dim, T > &ghost, const size_t(&bc)[dim])
 Apply boundary conditions.
 
bool is_equal (nn_prcs< dim, T, layout_base, Memory > &np)
 Check if the nn_prcs contain the same information.
 
void reset ()
 Reset the nn_prcs structure.
 
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.
 
- Public Member Functions inherited from ie_ghost< dim, T, Memory, layout_base >
 ie_ghost ()
 Default constructor.
 
 ie_ghost (const ie_ghost< dim, T, Memory, layout_base > &ie)
 Copy constructor.
 
 ie_ghost (ie_ghost< dim, T, Memory, layout_base > &&ie)
 Copy constructor.
 
ie_ghost< dim, T, Memory, layout_base > & operator= (ie_ghost< dim, T, Memory, layout_base > &&ie)
 Copy operator.
 
ie_ghost< dim, T, Memory, layout_base > & operator= (const ie_ghost< dim, T, Memory, layout_base > &ie)
 Copy operator.
 
template<typename Memory2 , template< typename > class layout_base2>
ie_ghost< dim, T, Memory, layout_base > & operator= (const ie_ghost< dim, T, Memory2, layout_base2 > &ie)
 Copy operator.
 
template<typename Memory2 , template< typename > class layout_base2>
ie_ghost< dim, T, Memory2, layout_base2 > duplicate ()
 duplicate this structure changing layout and Memory
 
const openfpm::vector< Point< dim, T >, Memory, layout_base > & 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.
 
size_t getProcessorNEGhost (size_t id) const
 Get the number of External ghost boxes for one processor id.
 
const ::Box< dim, T > & getProcessorIGhostBox (size_t id, size_t j) const
 Get the j Internal ghost box for one processor.
 
const ::Box< dim, T > & getProcessorEGhostBox (size_t id, size_t j) const
 Get the j External ghost box.
 
const comb< dim > & getProcessorEGhostPos (size_t id, size_t j) const
 Get the j External ghost box sector.
 
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.
 
size_t getProcessorIGhostId (size_t id, size_t j) const
 Get the j Internal ghost box id.
 
size_t getProcessorEGhostId (size_t id, size_t j) const
 Get the j External ghost box id.
 
size_t getProcessorIGhostSSub (size_t id, size_t j) const
 Get the sub-domain send-id at witch belong the internal ghost box.
 
size_t getProcessorIGhostSub (size_t id, size_t j) const
 Get the local sub-domain at witch belong the internal ghost box.
 
size_t getProcessorEGhostSub (size_t id, size_t j) const
 Get the local sub-domain at witch belong the external ghost box.
 
size_t getNIGhostBox () const
 Return the total number of the calculated internal ghost boxes.
 
inline ::Box< dim, T > getIGhostBox (size_t b_id) const
 Given the internal ghost box id, it return the internal ghost box.
 
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.
 
size_t getNEGhostBox () const
 Get the number of the calculated external ghost boxes.
 
inline ::Box< dim, T > getEGhostBox (size_t b_id) const
 Given the external ghost box id, it return the external ghost box.
 
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.
 
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
 
template<typename output_type >
void ghost_processor_ID (const Point< dim, T > &p, output_type &output, unsigned int base, unsigned int pi)
 Get the number of processor a particle must sent.
 
unsigned int ghost_processorID_N (const Point< dim, T > &p)
 Get the number of processor a particle must sent.
 
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)
 
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)
 
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)
 
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)
 
bool write (std::string output, size_t p_id) const
 write the information about the ghost in vtk format
 
bool is_equal (ie_ghost< dim, T, Memory, layout_base > &ig)
 Check if the ie_ghosts contain the same information.
 
bool is_equal_ng (ie_ghost< dim, T, Memory, layout_base > &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.
 
void reset ()
 Reset the nn_prcs structure.
 
const openfpm::vector< openfpm::vector< Box_proc< dim, T > > > & private_get_box_nn_processor_int () const
 Return the internal data structure box_nn_processor_int.
 
openfpm::vector< openfpm::vector< Box_proc< dim, T > > > & private_get_box_nn_processor_int ()
 Return the internal data structure box_nn_processor_int.
 
openfpm::vector< Box_dom< dim, T > > & private_get_proc_int_box ()
 Return the internal data structure proc_int_box.
 
const openfpm::vector< Box_dom< dim, T > > & private_get_proc_int_box () const
 Return the internal data structure proc_int_box.
 
openfpm::vector< p_box< dim, T > > & private_get_vb_ext ()
 Return the internal data structure vb_ext.
 
const openfpm::vector< p_box< dim, T > > & private_get_vb_ext () const
 Return the internal data structure vb_ext.
 
openfpm::vector< aggregate< unsigned int, unsigned int, unsigned int >, Memory, layout_base > & private_get_vb_int ()
 Return the internal data structure vb_int.
 
const openfpm::vector< aggregate< unsigned int, unsigned int, unsigned int >, Memory, layout_base > & private_get_vb_int () const
 Return the internal data structure vb_int.
 
openfpm::vector< Box< dim, T >, Memory, layout_base > & private_get_vb_int_box ()
 Return the internal data structure vb_int_box.
 
const openfpm::vector< Box< dim, T >, Memory, layout_base > & private_get_vb_int_box () const
 Return the internal data structure vb_int_box.
 
CellList< dim, T, Mem_fast< Memory, int >, shift< dim, T > > & private_geo_cell ()
 Return the internal data structure proc_int_box.
 
const CellList< dim, T, Mem_fast< Memory, int >, shift< dim, T > > & private_geo_cell () const
 Return the internal data structure proc_int_box.
 
openfpm::vector< Point< dim, T >, Memory, layout_base > & private_get_shifts ()
 Return the internal data structure shifts.
 
const openfpm::vector< Point< dim, T >, Memory, layout_base > & private_get_shifts () const
 Return the internal data structure shifts.
 
openfpm::vector< std::pair< size_t, size_t > > & private_get_ids_p ()
 Return the internal data structure ids_p.
 
const openfpm::vector< std::pair< size_t, size_t > > & private_get_ids_p () const
 Return the internal data structure ids_p.
 
openfpm::vector< size_t > & private_get_ids ()
 Return the internal data structure ids_p.
 
const openfpm::vector< size_t > & private_get_ids () const
 Return the internal data structure ids_p.
 
Box< dim, T > & private_get_domain ()
 Return the internal data structure domain.
 
const Box< dim, T > & private_get_domain () const
 Return the internal data structure domain.
 
size_t private_get_bc (int i) const
 
size_t(& private_get_bc ())[dim]
 Return the internal data structure domain.
 
ie_ghost_gpu< dim, T, Memory, layout_base > toKernel ()
 toKernel() Convert this data-structure into a kernel usable data-structure
 
void reset_host_dev_transfer ()
 Notify that the next toKernel() data-structures must be re-offloaded.
 
- Public Member Functions inherited from domain_nn_calculator_cart< dim >
void setParameters (const Box< dim, long int > &proc_box)
 Set parameters to calculate the cell neighborhood.
 
void setNNParameters (openfpm::vector<::Box< dim, size_t > > &loc_box, const grid_key_dx< dim > &shift, const grid_sm< dim, void > &gs)
 Set parameters to calculate the cell neighborhood.
 
openfpm::vector< size_t > & getDomainCells ()
 Get the domain Cells.
 
openfpm::vector< size_t > & getCRSDomainCells ()
 Get the domain Cells.
 
openfpm::vector< subsub_lin< dim > > & getCRSAnomDomainCells ()
 Get the domain anomalous cells.
 
void reset ()
 In case you have to recompute the indexes.
 
- Public Member Functions inherited from domain_icell_calculator< dim, T, layout_base, Memory >
template<typename VCluster_type >
void CalculateInternalCells (VCluster_type &v_cl, openfpm::vector< Box< dim, T >, Memory, layout_base > &ig_box, openfpm::vector< SpaceBox< dim, T >, Memory, layout_base > &domain, Box< dim, T > &pbox, T r_cut, const Ghost< dim, T > &enlarge)
 Calculate the subdomain that are in the skin part of the domain.
 
openfpm::vector< aggregate< ids_type >, Memory, layout_base > & getIcells ()
 Return the list of the internal cells.
 
openfpm::vector< aggregate< ids_type >, Memory, layout_base > & getDcells ()
 Return the list of the internal cells.
 
Box< dim, T > getBoxCell (unsigned int ci)
 Given a cell index return the cell box.
 
const grid_sm< dim, void > & getGrid ()
 Get the grid base information about this cell decomposition.
 

Static Public Member Functions

static size_t getDefaultGrid (size_t n_sub)
 The default grid size.
 
- Static Public Member Functions inherited from nn_prcs< dim, T, layout_base, Memory >
static bool check_valid (comb< dim > cmb, const size_t(&bc)[dim])
 

Data Fields

friend extended_type
 friend classes
 

Static Public Attributes

static constexpr int dims = dim
 Space dimensions.
 

Protected Types

typedef openfpm::vector< SpaceBox< dim, T >, Memory, memory_traits_lin, openfpm::vector_grow_policy_default, openfpm::vect_isel< SpaceBox< dim, T > >::value >::access_key acc_key
 

Protected Member Functions

template<typename Memory_bx >
SpaceBox< dim, T > convertDecBoxIntoSubDomain (encapc< 1,::Box< dim, size_t >, Memory_bx > loc_box)
 It convert the box from the domain decomposition into sub-domain.
 
void collect_all_sub_domains (openfpm::vector< Box_map< dim, T >, Memory, layout_base > &sub_domains_global)
 
- Protected Member Functions inherited from ie_ghost< dim, T, Memory, layout_base >
void generateShiftVectors (const Box< dim, T > &domain, size_t(&bc)[dim])
 Here we generare the shift vectors.
 
void Initialize_geo_cell (const Box< dim, T > &domain, const size_t(&div)[dim])
 Initialize the geo cell list structure.
 
void free_geo_cell ()
 Deallocate structures that identify a point to which internal ghost is located.
 
void create_box_nn_processor_ext (Vcluster<> &v_cl, Ghost< dim, T > &ghost, openfpm::vector< SpaceBox< dim, T >, Memory, layout_base > &sub_domains, const openfpm::vector< openfpm::vector< long unsigned int > > &box_nn_processor, const nn_prcs< dim, T, layout_base, Memory > &nn_p)
 Create the box_nn_processor_int (bx part) structure.
 
void create_box_nn_processor_int (Vcluster<> &v_cl, Ghost< dim, T > &ghost, openfpm::vector< SpaceBox< dim, T >, Memory, layout_base > &sub_domains, const openfpm::vector< openfpm::vector< long unsigned int > > &box_nn_processor, const nn_prcs< dim, T, layout_base, Memory > &nn_p)
 Create the box_nn_processor_int (nbx part) structure, the geo_cell list and proc_int_box.
 
void reorder_geo_cell ()
 in this function we reorder the list in each cells by processor id
 

Protected Attributes

bool host_dev_transfer = false
 bool that indicate whenever the buffer has been already transfer to device
 
bool commCostSet = false
 Indicate the communication weight has been set.
 
openfpm::vector< SpaceBox< dim, T >, Memory, layout_base > sub_domains
 the set of all local sub-domain as vector
 
openfpm::vector< Box_map< dim, T >, Memory, layout_base > sub_domains_global
 the remote set of all sub-domains as vector of 'sub_domains' vectors
 
openfpm::vector< openfpm::vector< long unsigned int > > box_nn_processor
 for each sub-domain, contain the list of the neighborhood processors
 
CellList< dim, T, Mem_fast< Memory, int >, shift< dim, T > > fine_s
 
grid_sm< dim, void > gr
 Structure that store the cartesian grid information.
 
grid_sm< dim, void > gr_dist
 Structure that store the cartesian grid information.
 
CellDecomposer_sm< dim, T, shift< dim, T > > cd
 
::Box< dim, T > domain
 rectangular domain to decompose
 
spacing [dim]
 Box Spacing.
 
size_t magn [dim]
 
Vclusterv_cl
 Runtime virtual cluster machine.
 
Distribution dist
 Create distribution.
 
::Box< dim, T > bbox
 Processor bounding box.
 
long int ref_cnt
 reference counter of the object in case is shared between object
 
Ghost< dim, T > ghost
 ghost info
 
size_t bc [dim]
 Boundary condition info.
 
::Box< dim, size_t > proc_box
 Processor domain bounding box.
 
openfpm::vector<::Box< dim, size_t > > loc_box
 set of Boxes produced by the decomposition optimizer
 

Member Typedef Documentation

◆ acc_key

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
typedef openfpm::vector<SpaceBox<dim,T>,Memory,memory_traits_lin,openfpm::vector_grow_policy_default,openfpm::vect_isel<SpaceBox<dim,T>>::value>::access_key CartDecomposition< dim, T, Memory, layout_base, Distribution >::acc_key
protected

This is the key type to access data_s, for example in the case of vector acc_key is size_t

Definition at line 180 of file CartDecomposition.hpp.

◆ base_type

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
typedef CartDecomposition<dim,T,Memory,layout_base,Distribution> CartDecomposition< dim, T, Memory, layout_base, Distribution >::base_type

This class is base of itself.

Definition at line 155 of file CartDecomposition.hpp.

◆ Box

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
typedef SpaceBox<dim, T> CartDecomposition< dim, T, Memory, layout_base, Distribution >::Box

It simplify to access the SpaceBox element.

Definition at line 152 of file CartDecomposition.hpp.

◆ domain_type

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
typedef T CartDecomposition< dim, T, Memory, layout_base, Distribution >::domain_type

Type of the domain we are going to decompose.

Definition at line 149 of file CartDecomposition.hpp.

◆ extended_type

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
typedef CartDecomposition_ext<dim,T,Memory,layout_base,Distribution> CartDecomposition< dim, T, Memory, layout_base, Distribution >::extended_type

This class admit a class defined on an extended domain.

Definition at line 158 of file CartDecomposition.hpp.

◆ ie_ghost_type

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
typedef ie_ghost<dim,T,Memory,layout_base> CartDecomposition< dim, T, Memory, layout_base, Distribution >::ie_ghost_type

Definition at line 164 of file CartDecomposition.hpp.

◆ ie_loc_ghost_type

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
typedef ie_loc_ghost<dim, T,layout_base, Memory> CartDecomposition< dim, T, Memory, layout_base, Distribution >::ie_loc_ghost_type

Definition at line 160 of file CartDecomposition.hpp.

◆ nn_prcs_type

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
typedef nn_prcs<dim, T,layout_base,Memory> CartDecomposition< dim, T, Memory, layout_base, Distribution >::nn_prcs_type

Definition at line 162 of file CartDecomposition.hpp.

◆ stype

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
typedef T CartDecomposition< dim, T, Memory, layout_base, Distribution >::stype

Space type.

Definition at line 676 of file CartDecomposition.hpp.

Constructor & Destructor Documentation

◆ CartDecomposition() [1/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CartDecomposition< dim, T, Memory, layout_base, Distribution >::CartDecomposition ( Vcluster<> &  v_cl)
inline

Cartesian decomposition constructor.

Parameters
v_clVirtual cluster, used internally to handle or pipeline communication

Definition at line 697 of file CartDecomposition.hpp.

◆ CartDecomposition() [2/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CartDecomposition< dim, T, Memory, layout_base, Distribution >::CartDecomposition ( const CartDecomposition< dim, T, Memory, layout_base, Distribution > &  cart)
inline

Cartesian decomposition copy constructor.

Parameters
cartobject to copy

Definition at line 709 of file CartDecomposition.hpp.

◆ CartDecomposition() [3/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CartDecomposition< dim, T, Memory, layout_base, Distribution >::CartDecomposition ( CartDecomposition< dim, T, Memory, layout_base, Distribution > &&  cart)
inline

Cartesian decomposition copy constructor.

Parameters
cartobject to copy

Definition at line 720 of file CartDecomposition.hpp.

◆ ~CartDecomposition()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CartDecomposition< dim, T, Memory, layout_base, Distribution >::~CartDecomposition ( )
inline

Cartesian decomposition destructor.

Definition at line 727 of file CartDecomposition.hpp.

Member Function Documentation

◆ addComputationCost()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::addComputationCost ( size_t  gid,
size_t  i 
)
inline

Add computation cost i to the subsubdomain with global id gid.

Parameters
gidglobal id of the subsubdomain to update
iCost increment

Definition at line 2081 of file CartDecomposition.hpp.

◆ applyPointBC() [1/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
template<typename Mem >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::applyPointBC ( encapc< 1, Point< dim, T >, Mem > &&  pt) const
inline

Apply boundary condition to the point.

If the particle go out to the right, bring back the particle on the left in case of periodic, nothing in case of non periodic

Parameters
ptencapsulated point object (it's coordinated are changed according the the explanation before)

Definition at line 856 of file CartDecomposition.hpp.

◆ applyPointBC() [2/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::applyPointBC ( float(&)  pt[dim]) const
inline

Apply boundary condition to the point.

If the particle go out to the right, bring back the particle on the left in case of periodic, nothing in case of non periodic

Parameters
ptPoint to apply the boundary condition. (it's coordinated are changed according the the explanation before)

Definition at line 820 of file CartDecomposition.hpp.

◆ applyPointBC() [3/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::applyPointBC ( Point< dim, T > &  pt) const
inline

Apply boundary condition to the point.

If the particle go out to the right, bring back the particle on the left in case of periodic, nothing in case of non periodic

Parameters
ptPoint to apply the boundary conditions.(it's coordinated are changed according the the explanation before)

Definition at line 838 of file CartDecomposition.hpp.

◆ calculate_magn()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::calculate_magn ( const grid_sm< dim, void > &  gm)
inline

Calculate magnification.

Parameters
gmdistribution grid

Definition at line 1245 of file CartDecomposition.hpp.

◆ calculateGhostBoxes()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::calculateGhostBoxes ( )
inline

It calculate the internal ghost boxes.

Example: Processor 10 calculate B8_0 B9_0 B9_1 and B5_0

    +----------------------------------------------------+
    |                                                    |
    |                 Processor 8                        |
    |                 Sub+domain 0                       +-----------------------------------+
    |                                                    |                                   |
    |                                                    |                                   |
    ++--------------+---+---------------------------+----+        Processor 9                |
     |              |   |     B8_0                  |    |        Subdomain 0                |
     |              +------------------------------------+                                   |
     |              |   |                           |    |                                   |
     |              |   |                           |B9_0|                                   |
     |              | B |    Local processor        |    |                                   |
     | Processor 5  | 5 |    Subdomain 0            |    |                                   |
     | Subdomain 0  | _ |                           +----------------------------------------+
     |              | 0 |                           |    |                                   |
     |              |   |                           |    |                                   |
     |              |   |                           |    |        Processor 9                |
     |              |   |                           |B9_1|        Subdomain 1                |
     |              |   |                           |    |                                   |
     |              |   |                           |    |                                   |
     |              |   |                           |    |                                   |
     +--------------+---+---------------------------+----+                                   |
                                                         |                                   |
                                                         +-----------------------------------+
  and also
  G8_0 G9_0 G9_1 G5_0 (External ghost boxes)
          +----------------------------------------------------+
          |                 Processor 8                        |
          |                 Subdomain 0                        +-----------------------------------+
          |                                                    |                                   |
          |           +---------------------------------------------+                              |
          |           |         G8_0                           |    |                              |
    +-----+---------------+------------------------------------+    |   Processor 9                |
    |                 |   |                                    |    |   Subdomain 0                |
    |                 |   |                                    |G9_0|                              |
    |                 |   |                                    |    |                              |
    |                 |   |                                    |    |                              |
    |                 |   |        Local processor             |    |                              |
    |  Processor 5    |   |        Sub+domain 0                |    |                              |
    |  Subdomain 0    |   |                                    +-----------------------------------+
    |                 |   |                                    |    |                              |
    |                 | G |                                    |    |                              |
    |                 | 5 |                                    |    |   Processor 9                |
    |                 | | |                                    |    |   Subdomain 1                |
    |                 | 0 |                                    |G9_1|                              |
    |                 |   |                                    |    |                              |
    |                 |   |                                    |    |                              |
    +---------------------+------------------------------------+    |                              |
                      |                                        |    |                              |
                      +----------------------------------------+----+------------------------------+
   ghost margins for each dimensions (p1 negative part) (p2 positive part)


 \verbatim

                 ^ p2[1]
                 |
                 |
            +----+----+
            |         |
            |         |
 p1[0]<-----+         +----> p2[0]
            |         |
            |         |
            +----+----+
                 |
                 v  p1[1]

 \endverbatim

Definition at line 654 of file CartDecomposition.hpp.

◆ check_consistency()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::check_consistency ( )
inline

function to check the consistency of the information of the decomposition

Returns
false if is inconsistent

Definition at line 1931 of file CartDecomposition.hpp.

◆ collect_all_sub_domains()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::collect_all_sub_domains ( openfpm::vector< Box_map< dim, T >, Memory, layout_base > &  sub_domains_global)
inlineprotected

Definition at line 291 of file CartDecomposition.hpp.

◆ computeCommunicationAndMigrationCosts()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::computeCommunicationAndMigrationCosts ( size_t  ts)
inline

Calculate communication and migration costs.

Parameters
tshow many timesteps have passed since last calculation, used to approximate the cost

dist.getSubSubDomainComputationCost(i)

Definition at line 485 of file CartDecomposition.hpp.

◆ construct_fine_s()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::construct_fine_s ( )
inline

Definition at line 335 of file CartDecomposition.hpp.

◆ convertDecBoxIntoSubDomain()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
template<typename Memory_bx >
SpaceBox< dim, T > CartDecomposition< dim, T, Memory, layout_base, Distribution >::convertDecBoxIntoSubDomain ( encapc< 1,::Box< dim, size_t >, Memory_bx >  loc_box)
inlineprotected

It convert the box from the domain decomposition into sub-domain.

The decomposition box from the domain-decomposition contain the box in integer coordinates. This box is converted into a continuos box. It also adjust loc_box if the distribution grid and the decomposition grid are different.

Parameters
loc_boxlocal box
Returns
the corresponding sub-domain

Definition at line 250 of file CartDecomposition.hpp.

◆ createSubdomains()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::createSubdomains ( Vcluster<> &  v_cl,
const size_t(&)  bc[dim],
size_t  opt = 0 
)
inline

Constructor, it decompose and distribute the sub-domains across the processors.

Parameters
v_clVirtual cluster, used internally for communications
bcboundary conditions
optoption (one option is to construct)

Definition at line 372 of file CartDecomposition.hpp.

◆ CreateSubspaces()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::CreateSubspaces ( )
inline

Create the sub-domain that decompose your domain.

iterate through all subspaces

Create a new subspace

fill with the Margin of the box

add the space box

Definition at line 528 of file CartDecomposition.hpp.

◆ debugPrint()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::debugPrint ( )
inline

Print subdomains, external and internal ghost boxes.

Definition at line 1942 of file CartDecomposition.hpp.

◆ decompose()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::decompose ( dec_options  opt = dec_options::DEC_NONE)
inline

Start decomposition.

Definition at line 1400 of file CartDecomposition.hpp.

◆ decRef()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::decRef ( )
inline

Decrement the reference counter.

Definition at line 683 of file CartDecomposition.hpp.

◆ duplicate() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CartDecomposition< dim, T, Memory, layout_base, Distribution > CartDecomposition< dim, T, Memory, layout_base, Distribution >::duplicate ( ) const
inline

It create another object that contain the same information and act in the same way.

Returns
a duplicated CartDecomposition object

Definition at line 913 of file CartDecomposition.hpp.

◆ duplicate() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CartDecomposition< dim, T, Memory, layout_base, Distribution > CartDecomposition< dim, T, Memory, layout_base, Distribution >::duplicate ( const Ghost< dim, T > &  g) const
inline

It create another object that contain the same decomposition information but with different ghost boxes.

Parameters
gghost
Returns
a duplicated decomposition with different ghost boxes

Definition at line 872 of file CartDecomposition.hpp.

◆ duplicate_convert()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
template<typename Memory2 , template< typename > class layout_base2>
CartDecomposition< dim, T, Memory2, layout_base2, Distribution > CartDecomposition< dim, T, Memory, layout_base, Distribution >::duplicate_convert ( ) const
inline

It create another object that contain the same information and act in the same way.

Returns
a duplicated CartDecomposition object

Definition at line 953 of file CartDecomposition.hpp.

◆ free_fines()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::free_fines ( )
inline

Deallocate structures that identify a point to which internal ghost is located.

Definition at line 1920 of file CartDecomposition.hpp.

◆ free_geo_cell()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::free_geo_cell ( )
inline

Deallocate structures that identify a point to which internal ghost is located.

Definition at line 1912 of file CartDecomposition.hpp.

◆ get_ndec()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::get_ndec ( )
inline

Get the decomposition counter.

Returns
the decomposition counter

Definition at line 2093 of file CartDecomposition.hpp.

◆ getCellDecomposer()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const CellDecomposer_sm< dim, T, shift< dim, T > > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::getCellDecomposer ( )
inline

Get the cell decomposer of the decomposition.

Returns
the cell decomposer

Definition at line 2103 of file CartDecomposition.hpp.

◆ getCRSAnomDomainCells()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
openfpm::vector< subsub_lin< dim > > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::getCRSAnomDomainCells ( )
inline

Get the CRS anomalous cells.

This function return the anomalous cells

Returns
the anomalous cells with neighborhood

Definition at line 1792 of file CartDecomposition.hpp.

◆ getCRSDomainCells()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
openfpm::vector< size_t > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::getCRSDomainCells ( )
inline

Get the CRS domain Cells with normal neighborhood.

In case of symmetric interaction the neighborhood cells of a cell is different

 Symmetric      Normal

  * * *         * * *
    X *         * X *
                * * *

In case of CRS scheme some cells has the symmetric neighborhood some others has more complex neighborhood. This function return all the cells with normal neighborhood

Returns
the cell-id of the cells inside the processor-domain with normal neighborhood

Definition at line 1768 of file CartDecomposition.hpp.

◆ getDefaultGrid()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
static size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::getDefaultGrid ( size_t  n_sub)
inlinestatic

The default grid size.

The default grid is always an isotropic grid that adapt with the number of processors, it define in how many cell it will be divided the space for a particular required minimum number of sub-domain

Parameters
n_subnumber of subdomains per processors
Returns
grid dimension (it is one number because on the other dimensions is the same)

Definition at line 1120 of file CartDecomposition.hpp.

◆ getDistGrid()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const grid_sm< dim, void > CartDecomposition< dim, T, Memory, layout_base, Distribution >::getDistGrid ( )
inline

Distribution grid.

Returns
the grid

Definition at line 1857 of file CartDecomposition.hpp.

◆ getDistribution()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
Distribution & CartDecomposition< dim, T, Memory, layout_base, Distribution >::getDistribution ( )
inline

Return the distribution object.

Returns
the distribution object

Definition at line 2070 of file CartDecomposition.hpp.

◆ getDomain()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const ::Box< dim, T > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::getDomain ( ) const
inline

Return the box of the physical domain.

Returns
The physical domain box

Definition at line 1631 of file CartDecomposition.hpp.

◆ getDomainCells()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
openfpm::vector< size_t > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::getDomainCells ( )
inline

Get the domain Cells.

It return all the cells-id that are inside the processor-domain

Returns
the cells id inside the domain

Definition at line 1741 of file CartDecomposition.hpp.

◆ getGhost()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const Ghost< dim, T > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::getGhost ( ) const
inline

Return the ghost.

Returns
the ghost extension

Definition at line 1839 of file CartDecomposition.hpp.

◆ getGrid()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const grid_sm< dim, void > CartDecomposition< dim, T, Memory, layout_base, Distribution >::getGrid ( )
inline

Decomposition grid.

Returns
the grid

Definition at line 1848 of file CartDecomposition.hpp.

◆ getNSubDomain()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::getNSubDomain ( )
inline

Get the number of local sub-domains.

Returns
the number of sub-domains

Definition at line 1579 of file CartDecomposition.hpp.

◆ getNSubSubDomains()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::getNSubSubDomains ( )
inline

Get the number of sub-sub-domains in this sub-graph.

Returns
number of sub-sub-domains in this sub-graph

Definition at line 1537 of file CartDecomposition.hpp.

◆ getParameters()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::getParameters ( size_t(&)  div_[dim])
inline

return the parameters of the decomposition

Parameters
div_number of divisions in each dimension

Definition at line 1330 of file CartDecomposition.hpp.

◆ getProcessorBounds()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
::Box< dim, T > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::getProcessorBounds ( )
inline

Return the bounding box containing union of all the sub-domains for the local processor.

Returns
The bounding box

Definition at line 1827 of file CartDecomposition.hpp.

◆ getProcessorLoad()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::getProcessorLoad ( )
inline

Compute the processor load counting the total weights of its vertices.

Returns
the current processor load

Definition at line 1516 of file CartDecomposition.hpp.

◆ getSubDomain()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
SpaceBox< dim, T > CartDecomposition< dim, T, Memory, layout_base, Distribution >::getSubDomain ( size_t  lc)
inline

Get the local sub-domain.

Parameters
lc(each local processor can have more than one sub-domain)
Returns
the sub-domain

Definition at line 1591 of file CartDecomposition.hpp.

◆ getSubDomains()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const openfpm::vector< SpaceBox< dim, T >, Memory, layout_base > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::getSubDomains ( ) const
inline

Definition at line 1637 of file CartDecomposition.hpp.

◆ getSubDomainWithGhost()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
SpaceBox< dim, T > CartDecomposition< dim, T, Memory, layout_base, Distribution >::getSubDomainWithGhost ( size_t  lc)
inline

Get the local sub-domain enlarged with ghost extension.

Parameters
lc(each processor can have more than one sub-domain)
Returns
the sub-domain extended

Definition at line 1615 of file CartDecomposition.hpp.

◆ getSubSubDomainComputationCost()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::getSubSubDomainComputationCost ( size_t  id)
inline

function that return the computation cost of the sub-sub-domain id

Parameters
idsub-sub-domain id
Returns
the computational cost

Definition at line 1560 of file CartDecomposition.hpp.

◆ getSubSubDomainPosition()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::getSubSubDomainPosition ( size_t  id,
T(&)  pos[dim] 
)
inline

function that return the position of the cell in the space

Parameters
idvertex id
posvector that will contain x, y, z

Definition at line 1527 of file CartDecomposition.hpp.

◆ getUnbalance()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
float CartDecomposition< dim, T, Memory, layout_base, Distribution >::getUnbalance ( )
inline

Get the current un-balance value.

Returns
the un-balance percentage value

Definition at line 1507 of file CartDecomposition.hpp.

◆ getVC()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
Vcluster & CartDecomposition< dim, T, Memory, layout_base, Distribution >::getVC ( ) const
inline

Get the Virtual Cluster machine.

Returns
the Virtual cluster machine

Definition at line 1901 of file CartDecomposition.hpp.

◆ incRef()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::incRef ( )
inline

Increment the reference counter.

Definition at line 679 of file CartDecomposition.hpp.

◆ initialize_fine_s()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::initialize_fine_s ( const ::Box< dim, T > &  domain)
inline

Definition at line 323 of file CartDecomposition.hpp.

◆ Initialize_geo_cell_lists()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::Initialize_geo_cell_lists ( )
inline

Initialize geo_cell lists.

Definition at line 460 of file CartDecomposition.hpp.

◆ is_equal()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::is_equal ( CartDecomposition< dim, T, Memory > &  cart)
inline

Check if the CartDecomposition contain the same information.

Parameters
cartElement to check with
Returns
true if they are equal

Definition at line 1984 of file CartDecomposition.hpp.

◆ is_equal_ng()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::is_equal_ng ( CartDecomposition< dim, T, Memory > &  cart)
inline

Check if the CartDecomposition 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.

Parameters
cartElement to check with
Returns
true if the two CartDecomposition are equal

Definition at line 2030 of file CartDecomposition.hpp.

◆ isLocal() [1/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
template<typename Mem >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::isLocal ( const encapc< 1, Point< dim, T >, Mem >  p) const
inline

Check if the particle is local.

Warning
if the particle id outside the domain the result is unreliable
Parameters
pobject position
Returns
true if it is local

Definition at line 1651 of file CartDecomposition.hpp.

◆ isLocal() [2/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::isLocal ( const Point< dim, T > &  pos) const
inline

Check if the particle is local.

Warning
if the particle id outside the domain the result is unreliable
Parameters
posobject position
Returns
true if it is local

Definition at line 1679 of file CartDecomposition.hpp.

◆ isLocal() [3/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::isLocal ( const T(&)  pos[dim]) const
inline

Check if the particle is local.

Warning
if the particle id outside the domain the result is unreliable
Parameters
posobject position
Returns
true if it is local

Definition at line 1665 of file CartDecomposition.hpp.

◆ isLocalBC() [1/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
template<typename Mem >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::isLocalBC ( const encapc< 1, Point< dim, T >, Mem >  p,
const size_t(&)  bc[dim] 
) const
inline

Check if the particle is local considering boundary conditions.

Warning
if the particle id outside the domain and non periodic boundary the result is unreliable
Parameters
pobject position
bcboundary conditions
Returns
true if it is local

Definition at line 1696 of file CartDecomposition.hpp.

◆ isLocalBC() [2/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::isLocalBC ( const Point< dim, T > &  p,
const size_t(&)  bc[dim] 
) const
inline

Check if the particle is local considering boundary conditions.

Warning
if the particle id outside the domain and non periodic boundary the result is unreliable
Parameters
pobject position
bcboundary conditions
Returns
true if it is local

Definition at line 1721 of file CartDecomposition.hpp.

◆ isLocalBC() [3/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::isLocalBC ( const T(&)  p[dim],
const size_t(&)  bc[dim] 
) const
inline

Check if the particle is local considering boundary conditions.

Warning
if the particle id outside the domain and non periodic boundary the result is unreliable
Parameters
pobject position
bcboundary conditions
Returns
true if it is local

Definition at line 1808 of file CartDecomposition.hpp.

◆ operator=() [1/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CartDecomposition< dim, T, Memory, layout_base, Distribution > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::operator= ( CartDecomposition< dim, T, Memory, layout_base, Distribution > &&  cart)
inline

Copy the element, move semantic.

Parameters
cartelement to copy
Returns
itself

Definition at line 1073 of file CartDecomposition.hpp.

◆ operator=() [2/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CartDecomposition< dim, T, Memory, layout_base, Distribution > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::operator= ( const CartDecomposition< dim, T, Memory, layout_base, Distribution > &  cart)
inline

Copy the element.

Parameters
cartelement to copy
Returns
itself

Definition at line 992 of file CartDecomposition.hpp.

◆ operator=() [3/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
template<typename CartDecomposition2 >
CartDecomposition< dim, T, Memory, layout_base, Distribution > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::operator= ( const CartDecomposition2 &  cart)
inline

Copy the element.

Parameters
cartelement to copy
Returns
itself

Definition at line 1033 of file CartDecomposition.hpp.

◆ periodicity() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const size_t(& CartDecomposition< dim, T, Memory, layout_base, Distribution >::periodicity ( ) )[dim]
inline

Get the periodicity.

Returns
the periodicity

Definition at line 1235 of file CartDecomposition.hpp.

◆ periodicity() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::periodicity ( size_t  i) const
inline

Get the periodicity on i dimension.

Parameters
idimension
Returns
the periodicity in direction i

Definition at line 1224 of file CartDecomposition.hpp.

◆ private_get_bbox() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
::Box< dim, T > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_bbox ( )
inline

Return the internal data structure bbox.

Returns
bbox

Definition at line 2405 of file CartDecomposition.hpp.

◆ private_get_bbox() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const ::Box< dim, T > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_bbox ( ) const
inline

Return the internal data structure bbox.

Returns
bbox

Definition at line 2415 of file CartDecomposition.hpp.

◆ private_get_bc() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_bc ( int  i)
inline

Return the internal data structure bc.

Returns
bc

Definition at line 2425 of file CartDecomposition.hpp.

◆ private_get_bc() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const size_t & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_bc ( int  i) const
inline

Return the internal data structure bc.

Returns
bc

Definition at line 2435 of file CartDecomposition.hpp.

◆ private_get_box_nn_processor() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
openfpm::vector< openfpm::vector< long unsigned int > > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_box_nn_processor ( )
inline

Return the internal data structure box_nn_processor.

Returns
box_nn_processor

Definition at line 2164 of file CartDecomposition.hpp.

◆ private_get_box_nn_processor() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const openfpm::vector< openfpm::vector< long unsigned int > > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_box_nn_processor ( ) const
inline

Return the internal data structure box_nn_processor.

Returns
box_nn_processor

Definition at line 2174 of file CartDecomposition.hpp.

◆ private_get_cd() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CellDecomposer_sm< dim, T, shift< dim, T > > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_cd ( )
inline

Return the internal data structure cd.

Returns
cd

Definition at line 2284 of file CartDecomposition.hpp.

◆ private_get_cd() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const CellDecomposer_sm< dim, T, shift< dim, T > > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_cd ( ) const
inline

Return the internal data structure cd.

Returns
cd

Definition at line 2294 of file CartDecomposition.hpp.

◆ private_get_commCostSet() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_commCostSet ( )
inline

Return the internal data structure commCostSet.

Returns
commCostSet

Definition at line 2264 of file CartDecomposition.hpp.

◆ private_get_commCostSet() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const bool & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_commCostSet ( ) const
inline

Return the internal data structure commCostSet.

Returns
commCostSet

Definition at line 2274 of file CartDecomposition.hpp.

◆ private_get_dist() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
Distribution & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_dist ( )
inline

Return the internal data structure dist.

Returns
dist

Definition at line 2244 of file CartDecomposition.hpp.

◆ private_get_dist() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const Distribution & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_dist ( ) const
inline

Return the internal data structure dist.

Returns
dist

Definition at line 2254 of file CartDecomposition.hpp.

◆ private_get_domain() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
::Box< dim, T > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_domain ( )
inline

Return the internal data structure domain.

Returns
domain

Definition at line 2304 of file CartDecomposition.hpp.

◆ private_get_domain() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const ::Box< dim, T > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_domain ( ) const
inline

Return the internal data structure domain.

Returns
domain

Definition at line 2314 of file CartDecomposition.hpp.

◆ private_get_fine_s() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CellList< dim, T, Mem_fast< Memory, int >, shift< dim, T > > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_fine_s ( )
inline

Return the internal data structure fine_s.

Returns
fine_s

Definition at line 2184 of file CartDecomposition.hpp.

◆ private_get_fine_s() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const CellList< dim, T, Mem_fast< Memory, int >, shift< dim, T > > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_fine_s ( ) const
inline

Return the internal data structure fine_s.

Returns
fine_s

Definition at line 2194 of file CartDecomposition.hpp.

◆ private_get_ghost() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
Ghost< dim, T > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_ghost ( )
inline

Return the internal data structure ghost.

Returns
ghost

Definition at line 2385 of file CartDecomposition.hpp.

◆ private_get_ghost() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const Ghost< dim, T > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_ghost ( ) const
inline

Return the internal data structure ghost.

Returns
ghost

Definition at line 2395 of file CartDecomposition.hpp.

◆ private_get_gr() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
grid_sm< dim, void > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_gr ( )
inline

Return the internal data structure gr.

Returns
gr

Definition at line 2204 of file CartDecomposition.hpp.

◆ private_get_gr() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const grid_sm< dim, void > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_gr ( ) const
inline

Return the internal data structure gr.

Returns
gr

Definition at line 2214 of file CartDecomposition.hpp.

◆ private_get_gr_dist() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
grid_sm< dim, void > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_gr_dist ( )
inline

Return the internal data structure gr_dist.

Returns
gr_dist

Definition at line 2224 of file CartDecomposition.hpp.

◆ private_get_gr_dist() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const grid_sm< dim, void > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_gr_dist ( ) const
inline

Return the internal data structure gr_dist.

Returns
gr_dist

Definition at line 2234 of file CartDecomposition.hpp.

◆ private_get_magn() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
T & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_magn ( int  i)
inline

Return the internal data structure magn.

Returns
magn

Definition at line 2364 of file CartDecomposition.hpp.

◆ private_get_magn() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const T & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_magn ( int  i) const
inline

Return the internal data structure magn.

Returns
magn

Definition at line 2374 of file CartDecomposition.hpp.

◆ private_get_spacing() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
T & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_spacing ( int  i)
inline

Return the internal data structure spacing.

Returns
spacing

Definition at line 2344 of file CartDecomposition.hpp.

◆ private_get_spacing() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const T & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_spacing ( int  i) const
inline

Return the internal data structure spacing.

Returns
spacing

Definition at line 2354 of file CartDecomposition.hpp.

◆ private_get_sub_domains() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
openfpm::vector< SpaceBox< dim, T > > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_sub_domains ( )
inline

Return the internal data structure sub_domains.

Returns
sub_domains

Definition at line 2144 of file CartDecomposition.hpp.

◆ private_get_sub_domains() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const openfpm::vector< SpaceBox< dim, T > > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_sub_domains ( ) const
inline

Return the internal data structure sub_domains.

Returns
sub_domains

Definition at line 2154 of file CartDecomposition.hpp.

◆ private_get_sub_domains_global() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
openfpm::vector< Box_map< dim, T >, Memory, layout_base > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_sub_domains_global ( )
inline

Return the internal data structure sub_domains_global.

Returns
sub_domains_global

Definition at line 2324 of file CartDecomposition.hpp.

◆ private_get_sub_domains_global() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
const openfpm::vector< Box_map< dim, T >, Memory, layout_base > & CartDecomposition< dim, T, Memory, layout_base, Distribution >::private_get_sub_domains_global ( ) const
inline

Return the internal data structure sub_domains_global.

Returns
sub_domains_global

Definition at line 2334 of file CartDecomposition.hpp.

◆ processorID() [1/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
template<typename Mem >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::processorID ( const encapc< 1, Point< dim, T >, Mem > &  p) const
inline

Given a point return in which processor the particle should go.

Parameters
ppoint
Returns
processorID

Definition at line 1134 of file CartDecomposition.hpp.

◆ processorID() [2/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::processorID ( const Point< dim, T > &  p) const
inline

Given a point return in which processor the particle should go.

Parameters
ppoint
Returns
processorID

Definition at line 1146 of file CartDecomposition.hpp.

◆ processorID() [3/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::processorID ( const T(&)  p[dim]) const
inline

Given a point return in which processor the particle should go.

Parameters
ppoint
Returns
processorID

Definition at line 1158 of file CartDecomposition.hpp.

◆ processorIDBC() [1/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::processorIDBC ( const Point< dim, T > &  p) const
inline

Given a point return in which processor the particle should go.

Boundary conditions are considered

Parameters
ppoint
Returns
processorID

Definition at line 1190 of file CartDecomposition.hpp.

◆ processorIDBC() [2/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::processorIDBC ( const T(&)  p[dim]) const
inline

Given a point return in which processor the particle should go.

Boundary consition are considered

Parameters
ppoint position
Returns
processorID

Definition at line 1209 of file CartDecomposition.hpp.

◆ processorIDBC() [3/3]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
template<typename Mem >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::processorIDBC ( encapc< 1, Point< dim, T >, Mem >  p)
inline

Given a point return in which processor the point/particle should go.

Boundary conditions are considered

Parameters
ppoint
Returns
processorID

Definition at line 1172 of file CartDecomposition.hpp.

◆ redecompose()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::redecompose ( size_t  ts)
inline

Refine the decomposition, available only for ParMetis distribution, for Metis it is a null call.

Parameters
tsnumber of time step from the previous load balancing

Definition at line 1456 of file CartDecomposition.hpp.

◆ ref()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
long int CartDecomposition< dim, T, Memory, layout_base, Distribution >::ref ( )
inline

Return the reference counter.

Definition at line 687 of file CartDecomposition.hpp.

◆ refine() [1/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::refine ( DLB dlb)
inline

Refine the decomposition, available only for ParMetis distribution, for Metis it is a null call.

Parameters
dlbDynamic load balancing object
Returns
true if the re-balance has been executed, false otherwise

Definition at line 1479 of file CartDecomposition.hpp.

◆ refine() [2/2]

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::refine ( size_t  ts)
inline

Refine the decomposition, available only for ParMetis distribution, for Metis it is a null call.

Parameters
tsnumber of time step from the previous load balancing

Definition at line 1434 of file CartDecomposition.hpp.

◆ reset()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::reset ( )
inline

Delete the decomposition and reset the data-structure.

Definition at line 1386 of file CartDecomposition.hpp.

◆ setGoodParameters()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::setGoodParameters ( ::Box< dim, T > &  domain_,
const size_t(&)  bc[dim],
const Ghost< dim, T > &  ghost,
size_t  dec_gran,
const grid_sm< dim, void > &  sec_dist = grid_sm<dim,void>() 
)
inline

Set the best parameters for the decomposition.

It based on number of processors and dimensionality find a "good" parameter setting

Parameters
domain_domain to decompose
bcboundary conditions
ghostGhost size
sec_distDistribution grid. The distribution grid help in reducing the underlying distribution problem simplifying decomposition problem. This is done in order to reduce the load/balancing dynamic load balancing problem
dec_grannumber of sub-sub-domain for each processor

Definition at line 1278 of file CartDecomposition.hpp.

◆ setNNParameters()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::setNNParameters ( grid_key_dx< dim > &  shift,
grid_sm< dim, void > &  gs 
)
inline

set NN parameters to calculate cell-list neighborhood

Parameters
shiftto apply in cell linearization
gscell grid

Definition at line 1779 of file CartDecomposition.hpp.

◆ setParameters()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::setParameters ( const size_t(&)  div_[dim],
::Box< dim, T > &  domain_,
const size_t(&)  bc[dim],
const Ghost< dim, T > &  ghost,
const grid_sm< dim, void > &  sec_dist = grid_sm<dim,void>() 
)
inline

Set the parameter of the decomposition.

Parameters
div_storing into how many sub-sub-domains to decompose on each dimension
domain_domain to decompose
bcboundary conditions
ghostGhost size
sec_distDistribution grid. The distribution grid help in reducing the underlying distribution problem simplifying decomposition problem. This is done in order to reduce the load/balancing dynamic load balancing problem

Definition at line 1347 of file CartDecomposition.hpp.

◆ setSubSubDomainComputationCost()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
void CartDecomposition< dim, T, Memory, layout_base, Distribution >::setSubSubDomainComputationCost ( size_t  id,
size_t  weight 
)
inline

Function that set the computational cost for a of a sub-sub domain.

Parameters
idvertex id
weightcompotational cost

Definition at line 1548 of file CartDecomposition.hpp.

◆ subSize()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::subSize ( )
inline

Operator to access the size of the sub-graph.

Returns
the size of the subgraph

Definition at line 1569 of file CartDecomposition.hpp.

◆ toKernel()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CartDecomposition_gpu< dim, T, Memory, layout_base > CartDecomposition< dim, T, Memory, layout_base, Distribution >::toKernel ( )
inline

convert to a structure usable in a device kernel

Returns
a data-structure that can be used directy on GPU

Definition at line 2114 of file CartDecomposition.hpp.

◆ write()

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::write ( std::string  output) const
inline

Write the decomposition as VTK file.

The function generate several files

  • subdomains_X.vtk domain for the local processor (X) as union of sub-domain
  • subdomains_adjacent_X.vtk sub-domains adjacent to the local processor (X)
  • internal_ghost_X.vtk Internal ghost boxes for the local processor (X)
  • external_ghost_X.vtk External ghost boxes for the local processor (X)
  • local_internal_ghost_X.vtk internal local ghost boxes for the local processor (X)
  • local_external_ghost_X.vtk external local ghost boxes for the local processor (X)

where X is the local processor rank

Parameters
outputdirectory where to write the files
Returns
true if the write succeed

subdomains_X.vtk domain for the local processor (X) as union of sub-domain

Definition at line 1882 of file CartDecomposition.hpp.

Field Documentation

◆ bbox

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
::Box<dim,T> CartDecomposition< dim, T, Memory, layout_base, Distribution >::bbox
protected

Processor bounding box.

Definition at line 222 of file CartDecomposition.hpp.

◆ bc

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::bc[dim]
protected

Boundary condition info.

Definition at line 231 of file CartDecomposition.hpp.

◆ box_nn_processor

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
openfpm::vector<openfpm::vector<long unsigned int> > CartDecomposition< dim, T, Memory, layout_base, Distribution >::box_nn_processor
protected

for each sub-domain, contain the list of the neighborhood processors

Definition at line 189 of file CartDecomposition.hpp.

◆ cd

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CellDecomposer_sm<dim, T, shift<dim,T> > CartDecomposition< dim, T, Memory, layout_base, Distribution >::cd
protected

Structure that decompose the space into cells without creating them useful to convert positions to CellId or sub-domain id in this case

Definition at line 203 of file CartDecomposition.hpp.

◆ commCostSet

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::commCostSet = false
protected

Indicate the communication weight has been set.

Definition at line 172 of file CartDecomposition.hpp.

◆ dims

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
constexpr int CartDecomposition< dim, T, Memory, layout_base, Distribution >::dims = dim
staticconstexpr

Space dimensions.

Definition at line 673 of file CartDecomposition.hpp.

◆ dist

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
Distribution CartDecomposition< dim, T, Memory, layout_base, Distribution >::dist
protected

Create distribution.

Definition at line 219 of file CartDecomposition.hpp.

◆ domain

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
::Box<dim,T> CartDecomposition< dim, T, Memory, layout_base, Distribution >::domain
protected

rectangular domain to decompose

Definition at line 206 of file CartDecomposition.hpp.

◆ extended_type

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
friend CartDecomposition< dim, T, Memory, layout_base, Distribution >::extended_type

friend classes

Definition at line 2137 of file CartDecomposition.hpp.

◆ fine_s

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
CellList<dim,T,Mem_fast<Memory,int>,shift<dim,T> > CartDecomposition< dim, T, Memory, layout_base, Distribution >::fine_s
protected

Structure that contain for each sub-sub-domain box the processor id exist for efficient global communication

Definition at line 193 of file CartDecomposition.hpp.

◆ ghost

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
Ghost<dim,T> CartDecomposition< dim, T, Memory, layout_base, Distribution >::ghost
protected

ghost info

Definition at line 228 of file CartDecomposition.hpp.

◆ gr

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
grid_sm<dim, void> CartDecomposition< dim, T, Memory, layout_base, Distribution >::gr
protected

Structure that store the cartesian grid information.

Definition at line 196 of file CartDecomposition.hpp.

◆ gr_dist

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
grid_sm<dim, void> CartDecomposition< dim, T, Memory, layout_base, Distribution >::gr_dist
protected

Structure that store the cartesian grid information.

Definition at line 199 of file CartDecomposition.hpp.

◆ host_dev_transfer

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
bool CartDecomposition< dim, T, Memory, layout_base, Distribution >::host_dev_transfer = false
protected

bool that indicate whenever the buffer has been already transfer to device

Definition at line 169 of file CartDecomposition.hpp.

◆ loc_box

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
openfpm::vector<::Box<dim, size_t> > CartDecomposition< dim, T, Memory, layout_base, Distribution >::loc_box
protected

set of Boxes produced by the decomposition optimizer

Definition at line 237 of file CartDecomposition.hpp.

◆ magn

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
size_t CartDecomposition< dim, T, Memory, layout_base, Distribution >::magn[dim]
protected

Magnification factor between distribution and decomposition

Definition at line 213 of file CartDecomposition.hpp.

◆ proc_box

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
::Box<dim,size_t> CartDecomposition< dim, T, Memory, layout_base, Distribution >::proc_box
protected

Processor domain bounding box.

Definition at line 234 of file CartDecomposition.hpp.

◆ ref_cnt

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
long int CartDecomposition< dim, T, Memory, layout_base, Distribution >::ref_cnt
protected

reference counter of the object in case is shared between object

Definition at line 225 of file CartDecomposition.hpp.

◆ spacing

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
T CartDecomposition< dim, T, Memory, layout_base, Distribution >::spacing[dim]
protected

Box Spacing.

Definition at line 209 of file CartDecomposition.hpp.

◆ sub_domains

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
openfpm::vector<SpaceBox<dim, T>,Memory,layout_base> CartDecomposition< dim, T, Memory, layout_base, Distribution >::sub_domains
protected

the set of all local sub-domain as vector

Definition at line 183 of file CartDecomposition.hpp.

◆ sub_domains_global

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
openfpm::vector<Box_map<dim, T>,Memory,layout_base> CartDecomposition< dim, T, Memory, layout_base, Distribution >::sub_domains_global
mutableprotected

the remote set of all sub-domains as vector of 'sub_domains' vectors

Definition at line 186 of file CartDecomposition.hpp.

◆ v_cl

template<unsigned int dim, typename T , typename Memory , template< typename > class layout_base, typename Distribution >
Vcluster& CartDecomposition< dim, T, Memory, layout_base, Distribution >::v_cl
protected

Runtime virtual cluster machine.

Definition at line 216 of file CartDecomposition.hpp.


The documentation for this class was generated from the following file: