MPI_mgparc
Functions
geom.cpp File Reference

Functions

void IniGeom (const int myid, const int procx, const int procy, int neigh[], int &color)
 
void IniCoord (const int myid, const int procx, const int procy, double &xl, double &xr, double &yb, double &yt)
 

Function Documentation

void IniCoord ( const int  myid,
const int  procx,
const int  procy,
double &  xl,
double &  xr,
double &  yb,
double &  yt 
)

The quadratic domain [0,1] x [0,1] is divided into procx * procy subdomains numbered rowise. According to my process with rank number myid, the coordinates of the lower left corner (xl, yb) and of the upper right corner (xr, yt) are generated.

Parameters
[in]myidmy rank
[in]procxnumber of processes in x-direction
[in]procynumber of processes in y-direction
[out]xlx-coordinate of left boundary
[out]xrx-coordinate of right boundary
[out]yby-coordinate of lower boundary
[out]yty-coordinate of upper boundary
void IniGeom ( const int  myid,
const int  procx,
const int  procy,
int  neigh[],
int &  color 
)

The quadratic domain [0,1] x [0,1] is divided into procx * procy subdomains numbered rowise. According to my process with rank number myid, the vector neigh contains the ranks of the neighbours t the South, East, North, West.

Parameters
[in]myidmy rank
[in]procxnumber of processes in x-direction
[in]procynumber of processes in y-direction
[out]neighvector of 4 elements containing the ranks of neighbouring processes, -1 indicates a boundary in this direction
[out]colorred/black coloring of subdomains (0/1)