Next: Comments
Up: Technical Details
Previous: LinConfMetric
Contents
The main task when interfacing PETSc consists of transferring data
from the Cactus parallel data structures (gridfunctions) to the
parallel structures provided by PETSc.
Here we explain the main steps, to be read with the code at hands.
- The indices imin,imax ... are calculated and describe
the starting/ending points in 3D local index space: ghostzones
are not included here.
- A linear global index is calculated describing the starting/ending
points in linear global index space. Ghostzone are not included
here.
- A lookup gridfunction wsp is loaded identifying the 3D local
index with the linear global index. Values of zero indicate boundaries.
- PETSc matrices/vectors are created specifying the linear size: global
endpoint - global startpoint.
- For the elliptic class LinFlat the stencil functions are
initialized with the standard 7-point stencil, the class LinMetric and LinConfMetric require a more sophisticated
treatment described later.
- Looping over the processor local grid points (in 3D local
index space) the PETSc vectors and coefficient matrix is loaded if no
boundary is present (wsp[i,j,k] not equal zero.);
- Starting the PETSc vector and matrix assembly, nested for
performance as recommended by PETSc.
- Creation of the elliptic solver context and setting of
options, followed by the call to the PETSc solver.
- Upon completion of the solve, the PETSc solution has to
transferred to the Cactus data structures.
Next: Comments
Up: Technical Details
Previous: LinConfMetric
Contents
|