RepastHPC  2.3.1
Public Member Functions | Public Attributes | List of all members
repast::CartesianTopology Class Reference

Public Member Functions

 CartesianTopology (std::vector< int > processesPerDim, bool spaceIsPeriodic, boost::mpi::communicator *world)
 
int getRank (std::vector< int > &loc, std::vector< int > &relLoc)
 Gets the rank of the process at the specified offset from the specified location.
 
void getCoordinates (int rank, std::vector< int > &coords)
 Gets the coordinates in the MPI Cartesian Communicator for the specified rank.
 
GridDimensions getDimensions (int rank, GridDimensions globalBoundaries)
 Gets the GridDimensions boundaries for the specified rank.
 
GridDimensions getDimensions (std::vector< int > &pCoordinates, GridDimensions globalBoundaries)
 Gets the GridDimensions boundaries for the specified MPI coordinates.
 
RelativeLocation trim (int rank, RelativeLocation volume)
 Trims the relative location volume to only valid values. More...
 
bool matches (std::vector< int > processesPerDim, bool spaceIsPeriodic)
 Returns true only if the periodicity specified matches the periodicity of this CartesianTopology, the size of the vector of processes per dimension matches, and the value for each dimension matches.
 

Public Attributes

MPI_Comm topologyComm
 

Member Function Documentation

◆ trim()

RelativeLocation repast::CartesianTopology::trim ( int  rank,
RelativeLocation  volume 
)

Trims the relative location volume to only valid values.

If the CartesianTopology is periodic, this will have no effect, but if part of the relative location falls outside the boundaries of a (nonperiodic) Cartesian Topology, the RelativeLocation returned will include only the locations that fall within the boundaries and will be initialized to the minima values


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