Alsvinn  0.5.3
The fast FVM simulator with UQ support
Functions
alsfvm::mpi::cartesian Namespace Reference

Functions

std::vector< int > computeDisplacements (int side, int dimensions, ivec3 numberOfCellsPerDirection, int ghostCells, int baseOffset)
 
std::vector< int > computeLengths (int side, int dimensions, ivec3 numberOfCellsPerDirection, int ghostCells)
 
int computeNumberOfSegments (int side, int dimensions, ivec3 numberOfCellsPerDirection)
 
ivec3 getCoordinates (int rank, const ivec3 &numberOfProcessors)
 
int getRankIndex (const ivec3 &coordinate, const ivec3 &numberOfProcessors)
 

Function Documentation

◆ computeDisplacements()

std::vector<int> alsfvm::mpi::cartesian::computeDisplacements ( int  side,
int  dimensions,
ivec3  numberOfCellsPerDirection,
int  ghostCells,
int  baseOffset 
)
inline

Computes the displacmenets (offsets) of the segments

Parameters
sidean integer from 0 to 5 (inclusive)
//! Index Spatial side 1D Spatial side 2D Spatial side 3D
0 left left left
1 right right right
2 < not used > bottom bottom
3 < not used > top top
4 < not used > < not used > front
5 < not used > < not used > back
dimensionsthe number of dimension (from 1 to 3)
numberOfCellsPerDirectionfor each direction, list the total number of cells in that direction (this includes ghost cells)
ghostCellsnumber of ghost cells in the given direction
baseOffsetthe offset to use in the direction. This is to handle the receive and send types. This should always be of non-negative quantity, the sign will be deduced

◆ computeLengths()

std::vector<int> alsfvm::mpi::cartesian::computeLengths ( int  side,
int  dimensions,
ivec3  numberOfCellsPerDirection,
int  ghostCells 
)
inline

Computes the lengths (in number of reals) of the segments

Parameters
sidean integer from 0 to 5 (inclusive)
Index Spatial side 1D Spatial side 2D Spatial side 3D
0 left left left
1 right right right
2 < not used > bottom bottom
3 < not used > top top
4 < not used > < not used > front
5 < not used > < not used > back
dimensionsthe number of dimension (from 1 to 3)
numberOfCellsPerDirectionfor each direction, list the total number of cells in that direction (this includes ghost cells)
ghostCellsnumber of ghost cells in the given direction

◆ computeNumberOfSegments()

int alsfvm::mpi::cartesian::computeNumberOfSegments ( int  side,
int  dimensions,
ivec3  numberOfCellsPerDirection 
)
inline

Returns the number of segment needed for the MPI_Type

Parameters
sidean integer from 0 to 5 (inclusive)
Index Spatial side 1D Spatial side 2D Spatial side 3D
0 left left left
1 right right right
2 < not used > bottom bottom
3 < not used > top top
4 < not used > < not used > front
5 < not used > < not used > back
dimensionsthe number of dimension (from 1 to 3)
numberOfCellsPerDirectionfor each direction, list the total number of cells in that direction (this includes ghost cells)

◆ getCoordinates()

ivec3 alsfvm::mpi::cartesian::getCoordinates ( int  rank,
const ivec3 numberOfProcessors 
)

Computes the 3d coordinates of a linear rank (this is for domain decomposition to know where your CPU is "in space")

Parameters
rankthe mpi rank
numberOfProcessorsthe number of processors in each direction
See also
getRankIndex

◆ getRankIndex()

int alsfvm::mpi::cartesian::getRankIndex ( const ivec3 coordinate,
const ivec3 numberOfProcessors 
)

Computes the rank from the 3d coordinates (this is for domain decomposition to know where your CPU is "in space")

Parameters
coordinatethe coordinates
numberOfProcessorsthe number of processors in each direction
See also
getCoordinates