MPI_mgparc
|
#include <malloc.h>
#include <cstdlib>
#include <cassert>
#include <mpi.h>
#include "mg.h"
#include "header.h"
Functions | |
int | AllocLevels (const int nlevels, const int nx, const int ny, PointerStruct *pp) |
int | IniLevels (const double xl, const double xr, const double yb, const double yt, const int neigh[], const int color, const int, const MPI::Intracomm &icomm, const int nlevels, const PointerStruct *pp) |
int | FreeLevels (const int nlevels, PointerStruct *pp) |
int | Comp (const void *ii, const void *jj) |
void | MergePatterns (const int numprocs, const int nsk, const int id1, const int id2, const int hh[], int cik[], int kk[], const int) |
int | GlobalCoarse (const int neigh[], const int color, const int myid, const MPI::Intracomm &icomm, const int, PointerStruct *pp) |
int AllocLevels | ( | const int | nlevels, |
const int | nx, | ||
const int | ny, | ||
PointerStruct * | pp | ||
) |
Allocates the memory for nlevels
levels for a rectangle discretized into nx
x ny
equidistant intervals on the coarsest grid at level 0. The geometric multigrid hierarchy assume bisection of intervals as refinement strategy.
[in] | nlevels | number of multigrid levels |
[in] | nx | number of discretization intervals in x-direction |
[in] | ny | number of discretization intervals in y-direction |
[out] | *pp | pointer to the structure performing the grid management |
int Comp | ( | const void * | ii, |
const void * | jj | ||
) |
int FreeLevels | ( | const int | nlevels, |
PointerStruct * | pp | ||
) |
Frees the memory allocated for the multigrid hierarchy.
[in] | nlevels | number of multigrid levels |
[out] | *pp | pointer to the structure performing the grid management |
int GlobalCoarse | ( | const int | neigh[], |
const int | color, | ||
const int | myid, | ||
const MPI::Intracomm & | icomm, | ||
const int | nlevels, | ||
PointerStruct * | pp | ||
) |
Creates a global coarse grid system with an accumulated sparse matrix on this discretization.
[in] | neigh | vector of 4 elements containing the ranks of neighbouring processes, -1 indicates a boundary in this direction |
[in] | color | red/black coloring of subdomains (0/1) |
[in] | myid | my rank |
[in] | icomm | communicator |
[in] | nlevels | number of multigrid levels |
[out] | *pp | pointer to the structure performing the grid management |
int IniLevels | ( | const double | xl, |
const double | xr, | ||
const double | yb, | ||
const double | yt, | ||
const int | neigh[], | ||
const int | color, | ||
const int | myid, | ||
const MPI::Intracomm & | icomm, | ||
const int | nlevels, | ||
const PointerStruct * | pp | ||
) |
Inializes the stiffness matrix, right hand side, and boundary conditions for the discretization on level nlevels
in the domain [xl
, xr
] x [yb
, yt
].
memory for nlevels
levels for a rectangle discretized into nx
x ny
equidistant intervals on the coarsest grid at level 0. The geometric multigrid hierarchy assume bisection of intervals as refinement strategy.
[in] | xl | x-coordinate of left boundary |
[in] | xr | x-coordinate of right boundary |
[in] | yb | y-coordinate of lower boundary |
[in] | yt | y-coordinate of upper boundary |
[in] | neigh | vector of 4 elements containing the ranks of neighbouring processes, -1 indicates a boundary in this direction |
[in] | color | red/black coloring of subdomains (0/1) |
[in] | myid | my rank |
[in] | icomm | communicator |
[in] | nlevels | number of multigrid levels |
[in] | *pp | pointer to the structure performing the grid management |
void MergePatterns | ( | const int | numprocs, |
const int | nsk, | ||
const int | id1, | ||
const int | id2, | ||
const int | hh[], | ||
int | cik[], | ||
int | kk[], | ||
const int | |||
) |