MPI_mgparc
Functions
jacsmooth.cpp File Reference
#include <malloc.h>
#include <mpi.h>
#include "header.h"

Functions

void JacobiSmooth (const int nx, const int ny, const int neigh[], const int color, const int myid, const MPI::Intracomm &icomm, const double sk[], const int id[], const int ik[], const double f[], double u[], const double dd[], double aux[], const int maxiter)
 
void JacobiSolveGlob (const int myid, const MPI::Intracomm &icomm, const int nloc, const int nglob, const double csk[], const int cid[], const int cik[], const int l2g[], const double f[], double u[])
 

Function Documentation

void JacobiSmooth ( const int  nx,
const int  ny,
const int  neigh[],
const int  color,
const int  myid,
const MPI::Intracomm &  icomm,
const double  sk[],
const int  id[],
const int  ik[],
const double  f[],
double  u[],
const double  dd[],
double  aux[],
const int  maxiter 
)

Iterates maxiter with the linear system of equations K u = f via the Jacobi iteration. We use a distributed symmetric CSR matrix K(sk,id, ik).

Parameters
[in]nxnumber of discretization intervals in x-direction
[in]nynumber of discretization intervals in y-direction
[in]neighvector of 4 elements containing the ranks of neighbouring processes, -1 indicates a boundary in this direction
[in]colorred/black coloring of subdomains (0/1)
[in]myidrank of my process
[in]icommcommunicator
[in]skvector non-zero entries of CSR matrix
[in]idindex vector containing the last entry in a CSR row
[in]ikcolumn index vector of CSR matrix
[in]fdistributed local vector storing the right hand side
[in,out]uaccumulated local vector storing the solution.
[in]ddaccumualted diagonal of striffness matrix
[out]auxauxilliary vector used for the intermediate residuum in the iteration
[in]maxiternumber of iterations / smoothing weeps
void JacobiSolveGlob ( const int  myid,
const MPI::Intracomm &  icomm,
const int  nnode,
const int  nglob,
const double  sk[],
const int  id[],
const int  ik[],
const int  l2g[],
const double  f[],
double  u[] 
)

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).

Parameters
[in]myidrank of my process
[in]icommcommunicator
[in]nloclocal number of unknowns
[in]nglobglobal number of unknowns
[in]skvector non-zero entries of CSR matrix
[in]idindex vector containing the last entry in a CSR row
[in]ikcolumn index vector of CSR matrix
[in]l2gindex vector containing global indices of local degrees of freedom
[in]fdistributed local vector storing the right hand side
[out]uaccumulated local vector storing the solution.