1: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2: ! Include file for program ex5f.F
3: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4: !
5: ! This program uses CPP for preprocessing, as indicated by the use of
6: ! PETSc include files in the directory petsc/include/finclude. This
7: ! convention enables use of the CPP preprocessor, which allows the use
8: ! of the #include statements that define PETSc objects and variables.
9: !
10: ! Use of the conventional Fortran include statements is also supported
11: ! In this case, the PETsc include files are located in the directory
12: ! petsc/include/foldinclude.
13: !
14: ! Since one must be very careful to include each file no more than once
15: ! in a Fortran routine, application programmers must explicitly list
16: ! each file needed for the various PETSc components within their
17: ! program (unlike the C/C++ interface).
18: !
19: ! See the Fortran section of the PETSc users manual for details.
20: !
21: ! The following include statements are generally used in SNES Fortran
22: ! programs:
23: ! petscsys.h - base PETSc routines
24: ! petscvec.h - vectors
25: ! petscmat.h - matrices
26: ! petscksp.h - Krylov subspace methods
27: ! petscpc.h - preconditioners
28: ! petscsnes.h - SNES interface
29: ! In addition, we need the following for use of distributed arrays
30: ! petscdm.h - boundary specification for DM
31: ! petscdmda.h - distributed arrays (DMDAs)
33: #include <finclude/petscsys.h>
34: #include <finclude/petscvec.h>
35: #include <finclude/petscdm.h>
36: #include <finclude/petscdmda.h>
37: #include <finclude/petscis.h>
38: #include <finclude/petscmat.h>
39: #include <finclude/petscksp.h>
40: #include <finclude/petscpc.h>
41: #include <finclude/petscsnes.h>
43: ! Common blocks:
44: ! In this example we use common blocks to store data needed by the
45: ! application-provided call-back routines, FormJacobian() and
46: ! FormFunction(). Note that we can store (pointers to)
47: ! PETSc objects within these common blocks.
48: !
49: ! common /params/ - contains parameters for the global application
50: ! mx, my - global discretization in x- and y-directions
51: ! lambda - nonlinearity parameter
52: !
53: ! common /pdata/ - contains some parallel data
54: ! da - distributed array
55: ! rank - processor rank within communicator
56: ! size - number of processors
57: ! xs, ys - local starting grid indices (no ghost points)
58: ! xm, ym - widths of local grid (no ghost points)
59: ! gxs, gys - local starting grid indices (including ghost points)
60: ! gxm, gym - widths of local grid (including ghost points)
62: DM da
63: PetscInt xs,xe,xm,gxs,gxe,gxm
64: PetscInt ys,ye,ym,gys,gye,gym
65: PetscInt mx,my
66: PetscMPIInt rank,size
67: PetscReal lambda
69: common /params/ lambda,mx,my
70: common /pdata/ xs,xe,xm,gxs,gxe,gxm
71: common /pdata/ ys,ye,ym,gys,gye,gym
72: common /pdata/ da,rank,size
74: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -