HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Exchange data and fill ghost points for a 1D array. More...
Go to the source code of this file.
Functions | |
int | MPIExchangeBoundaries1D (void *m, double *x, int N, int ghosts, int dir, int ndims) |
Exchange data and fill ghost points for a 1D array.
Definition in file MPIExchangeBoundaries1D.c.
int MPIExchangeBoundaries1D | ( | void * | m, |
double * | x, | ||
int | N, | ||
int | ghosts, | ||
int | dir, | ||
int | ndims | ||
) |
Exchange the data across MPI ranks and fill in ghost points for a 1D array. In a multidimensional simulation, a 1D array is an array of data along one of the spatial dimensions, i.e. its an array storing a variable that varies in only one of the spatial dimension. For example, for a 2D problem on a Cartesian grid (with spatial dimensions x and y), the array of x-coordinates is a 1D array along x, and the array of y-coordinates is a 1D array along y. Thus, the size of the 1D array is equal to the size of the domain along the spatial dimension corresponding to that array.
Consider a two-dimensional problem, partitioned on 21 MPI ranks as follows:
If the argument dir is specified as 0, and thus we are dealing with a 1D array along dimension 0, then
If dir is specified as 1, and thus we are dealing with a 1D array along dimension 1, then
m | MPI object of type MPIVariables |
x | The 1D array for which to exchange data |
N | Size of the array |
ghosts | Number of ghost points |
dir | Spatial dimension corresponding to the 1D array |
ndims | Number of spatial dimensions in the simulation |
Definition at line 32 of file MPIExchangeBoundaries1D.c.