Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.43 KB

README.md

File metadata and controls

37 lines (24 loc) · 1.43 KB

p4pdes/c/

This directory contains the C programs which support the book PETSc for PDEs.

  • I will maintain and support these examples in the long term and update and tag them with PETSc versions.

install PETSc

Please follow the instructions at petsc.org/release/install/.

Notes:

  • My book does not contain PETSc installation instructions, though it has minimal advice. Maintaining installation information is the job of PETSc developers, not me. (Thank goodness.)
  • CONFIGS.md contains some of the configure commands which work on the author's machines. These are minimal installation suggestions.
  • My book does not help the reader with debugging C programs.
  • Make sure to download the latest release compatible with your PETSc version. Package managers (such as apt) may only contain older versions of PETSc that are incompatible with newer releases of p4pdes.

compile and run one example

Do this to build and run the program fish.c from Chapter 6, which solves the Poisson equation. This solves in parallel on a 1025 x 1025 grid in a couple of seconds:

$ cd ch6
$ make fish
$ mpiexec -n 4 ./fish -pc_type mg -da_refine 9 -ksp_monitor

software (regression) testing

$ make test           # in either c/ or c/ch*/

cleaning up

$ make clean          # in either c/ or c/ch*/