MPI_mgparc
|
Functions | |
void | JacobiSolve (const int nx, const int ny, const int neigh[], const int color, const MPI::Intracomm &icomm, const double sk[], const int id[], const int ik[], const double f[], double u[]) |
void | JacobiSolve2 (const int nx, const int ny, const int neigh[], const int color, const MPI::Intracomm &icomm, const double sk[], const int id[], const int ik[], const double f[], double u[], const double dd[], double aux[]) |
void JacobiSolve | ( | const int | nx, |
const int | ny, | ||
const int | neigh[], | ||
const int | color, | ||
const MPI::Intracomm & | icomm, | ||
const double | sk[], | ||
const int | id[], | ||
const int | ik[], | ||
const double | f[], | ||
double | u[] | ||
) |
Solves linear system of equations K u
= f
via the Jacobi iteration. We use a distributed symmetric CSR matrix K(sk
,id
, ik
) and initial guess of the solution is set to 0.
[in] | nx | number of discretization intervals in x-direction |
[in] | ny | number of discretization intervals in y-direction |
[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] | icomm | communicator |
[in] | sk | vector non-zero entries of CSR matrix |
[in] | id | index vector containing the last entry in a CSR row |
[in] | ik | column index vector of CSR matrix |
[in] | f | distributed local vector storing the right hand side |
[out] | u | accumulated local vector storing the solution. |
void JacobiSolve2 | ( | const int | nx, |
const int | ny, | ||
const int | neigh[], | ||
const int | color, | ||
const MPI::Intracomm & | icomm, | ||
const double | sk[], | ||
const int | id[], | ||
const int | ik[], | ||
const double | f[], | ||
double | u[], | ||
const double | dd[], | ||
double | aux[] | ||
) |
Solves the global parallel system with Jacobi iterations until a predefined accuracy is reached. We use a distributed symmetric CSR matrix K(sk
,id
, ik
).
[in] | nx | number of discretization intervals in x-direction |
[in] | ny | number of discretization intervals in y-direction |
[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] | icomm | communicator |
[in] | sk | vector non-zero entries of CSR matrix |
[in] | id | index vector containing the last entry in a CSR row |
[in] | ik | column index vector of CSR matrix |
[in] | f | distributed local vector storing the right hand side |
[in,out] | u | accumulated local vector storing the solution. |
[in] | dd | accumualted diagonal of striffness matrix |
[out] | aux | auxilliary vector used for the intermediate residuum in the iteration |