xref: /petsc/src/snes/tutorials/makefile (revision c4762a1b19cd2af06abeed90e8f9d34fb975dd94)
1*c4762a1bSJed Brown
2*c4762a1bSJed Brown# This directory contains SNES example programs for solving systems of
3*c4762a1bSJed Brown# nonlinear equations.
4*c4762a1bSJed Brown
5*c4762a1bSJed BrownCFLAGS           =
6*c4762a1bSJed BrownFFLAGS		 =
7*c4762a1bSJed BrownCPPFLAGS         =
8*c4762a1bSJed BrownFPPFLAGS         =
9*c4762a1bSJed BrownLOCDIR		 = src/snes/tutorials/
10*c4762a1bSJed BrownMANSEC           = SNES
11*c4762a1bSJed BrownEXAMPLESC	 = ex1.c ex2.c ex3.c  ex5.c ex9.c \
12*c4762a1bSJed Brown                ex12.c ex14.c ex15.c ex18.c ex19.c ex20.c ex21.c ex22.c \
13*c4762a1bSJed Brown                ex25.c ex28.c ex30.c ex33.c \
14*c4762a1bSJed Brown                ex35.c ex42.c ex46.c ex48.c \
15*c4762a1bSJed Brown                ex56.c ex58.c ex59.c \
16*c4762a1bSJed Brown                ex62.c ex70.c ex77.c ex78.c \
17*c4762a1bSJed Brown                ex47cu.cu
18*c4762a1bSJed BrownEXAMPLESF	 = ex1f.F90 ex5f.F90 ex5f90.F90 ex5f90t.F90 ex40f90.F90 ex73f90t.F90
19*c4762a1bSJed BrownEXAMPLESCH	 =
20*c4762a1bSJed BrownEXAMPLESFH       = ex5f.h
21*c4762a1bSJed BrownEXAMPLESMATLAB   = ex5m.m  ex61genm.m ex61m.m
22*c4762a1bSJed BrownDIRS		 = ex10d network
23*c4762a1bSJed Brown
24*c4762a1bSJed Browninclude ${PETSC_DIR}/lib/petsc/conf/variables
25*c4762a1bSJed Browninclude ${PETSC_DIR}/lib/petsc/conf/rules
26*c4762a1bSJed Brown
27*c4762a1bSJed Brown#-------------------------------------------------------------------------
28*c4762a1bSJed Brown
29*c4762a1bSJed Brown#  these tests are used by the makefile in PETSC_DIR for basic tests of the install and should not be removed
30*c4762a1bSJed Browntestex5f: ex5f.PETSc
31*c4762a1bSJed Brown	@if [ "${PETSC_WITH_BATCH}" != "" ]; then \
32*c4762a1bSJed Brown           echo "Running with batch filesystem; to test run src/snes/tutorials/ex5f with" ; \
33*c4762a1bSJed Brown           echo "your systems batch system"; \
34*c4762a1bSJed Brown        elif [ "${MPIEXEC}" = "/bin/false" ]; then \
35*c4762a1bSJed Brown           echo "*mpiexec not found*. Please run src/snes/tutorials/ex5f manually"; \
36*c4762a1bSJed Brown        elif [ -f ex5f ]; then \
37*c4762a1bSJed Brown	   ${MPIEXEC} -n 1 ./ex5f > ex5f_1.tmp 2>&1; \
38*c4762a1bSJed Brown	   if (${DIFF} output/ex5f_1.testout ex5f_1.tmp > /dev/null 2>&1) then \
39*c4762a1bSJed Brown           echo "Fortran example src/snes/tutorials/ex5f run successfully with 1 MPI process"; \
40*c4762a1bSJed Brown	   else echo "Possible error running Fortran example src/snes/tutorials/ex5f with 1 MPI process"; \
41*c4762a1bSJed Brown           echo "See http://www.mcs.anl.gov/petsc/documentation/faq.html";\
42*c4762a1bSJed Brown           cat ex5f_1.tmp; fi;  \
43*c4762a1bSJed Brown         ${RM} -f ex5f_1.tmp ;\
44*c4762a1bSJed Brown         ${MAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ex5f.rm; fi
45*c4762a1bSJed Brown
46*c4762a1bSJed Browntestex19: ex19.PETSc
47*c4762a1bSJed Brown	-@if [ "${PETSC_WITH_BATCH}" != "" ]; then \
48*c4762a1bSJed Brown           echo "Running with batch filesystem; to test run src/snes/tutorials/ex19 with" ; \
49*c4762a1bSJed Brown           echo "your systems batch system"; \
50*c4762a1bSJed Brown        elif [ "${MPIEXEC}" = "/bin/false" ]; then \
51*c4762a1bSJed Brown           echo "*mpiexec not found*. Please run src/snes/tutorials/ex19 manually"; \
52*c4762a1bSJed Brown	elif [ -f ex19 ]; then \
53*c4762a1bSJed Brown           ${MPIEXEC} -n 1 ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres  > ex19_1.tmp 2>&1; \
54*c4762a1bSJed Brown	   if (${DIFF} output/ex19_1.testout ex19_1.tmp > /dev/null 2>&1) then \
55*c4762a1bSJed Brown           echo "C/C++ example src/snes/tutorials/ex19 run successfully with 1 MPI process"; \
56*c4762a1bSJed Brown	   else echo "Possible error running C/C++ src/snes/tutorials/ex19 with 1 MPI process"; \
57*c4762a1bSJed Brown           echo "See http://www.mcs.anl.gov/petsc/documentation/faq.html";\
58*c4762a1bSJed Brown           cat ex19_1.tmp; fi; \
59*c4762a1bSJed Brown	if [ ! "${MPI_IS_MPIUNI}" ]; then \
60*c4762a1bSJed Brown           ${MPIEXEC} -n 2 ./ex19 -da_refine 3 -pc_type mg -ksp_type fgmres  > ex19_1.tmp 2>&1; \
61*c4762a1bSJed Brown	   if (${DIFF} output/ex19_1.testout ex19_1.tmp > /dev/null 2>&1) then \
62*c4762a1bSJed Brown           echo "C/C++ example src/snes/tutorials/ex19 run successfully with 2 MPI processes"; \
63*c4762a1bSJed Brown	   else echo "Possible error running C/C++ src/snes/tutorials/ex19 with 2 MPI processes"; \
64*c4762a1bSJed Brown           echo "See http://www.mcs.anl.gov/petsc/documentation/faq.html";\
65*c4762a1bSJed Brown           cat ex19_1.tmp; fi; fi; \
66*c4762a1bSJed Brown        ${RM} -f ex19_1.tmp; fi
67*c4762a1bSJed Brownrunex19_hypre:
68*c4762a1bSJed Brown	-@${MPIEXEC} -n 2 ./ex19 -da_refine 3 -snes_monitor_short -pc_type hypre > ex19_1.tmp 2>&1; \
69*c4762a1bSJed Brown	   if (${DIFF} output/ex19_hypre.out ex19_1.tmp) then \
70*c4762a1bSJed Brown           echo "C/C++ example src/snes/tutorials/ex19 run successfully with hypre"; \
71*c4762a1bSJed Brown           else  printf "${PWD}\nPossible problem with ex19 running with hypre, diffs above\n=========================================\n"; fi; \
72*c4762a1bSJed Brown	   ${RM} -f ex19_1.tmp
73*c4762a1bSJed Brownrunex19_ml:
74*c4762a1bSJed Brown	-@${MPIEXEC} -n 2 ./ex19 -da_refine 3 -snes_monitor_short -pc_type ml > ex19_1.tmp 2>&1; \
75*c4762a1bSJed Brown	   if (${DIFF} output/ex19_ml.out ex19_1.tmp) then  \
76*c4762a1bSJed Brown           echo "C/C++ example src/snes/tutorials/ex19 run successfully with ml"; \
77*c4762a1bSJed Brown           else  printf "${PWD}\nPossible problem with ex19 running with ml, diffs above\n=========================================\n"; fi; \
78*c4762a1bSJed Brown           ${RM} -f ex19_1.tmp
79*c4762a1bSJed Brownrunex19_fieldsplit_mumps:
80*c4762a1bSJed Brown	-@${MPIEXEC} -n 2 ./ex19 -pc_type fieldsplit -pc_fieldsplit_block_size 4 -pc_fieldsplit_type SCHUR -pc_fieldsplit_0_fields 0,1,2 -pc_fieldsplit_1_fields 3 -fieldsplit_0_pc_type lu -fieldsplit_1_pc_type lu -snes_monitor_short -ksp_monitor_short  -fieldsplit_0_pc_factor_mat_solver_type mumps -fieldsplit_1_pc_factor_mat_solver_type mumps > ex19_6.tmp 2>&1; \
81*c4762a1bSJed Brown	   if (${DIFF} output/ex19_fieldsplit_5.out ex19_6.tmp) then  \
82*c4762a1bSJed Brown           echo "C/C++ example src/snes/tutorials/ex19 run successfully with mumps"; \
83*c4762a1bSJed Brown           else  printf "${PWD}\nPossible problem with ex19 running with mumps, diffs above\n=========================================\n"; fi; \
84*c4762a1bSJed Brown           ${RM} -f ex19_6.tmp
85*c4762a1bSJed Brownrunex19_superlu_dist:
86*c4762a1bSJed Brown	-@${MPIEXEC} -n 1 ./ex19 -da_grid_x 20 -da_grid_y 20 -pc_type lu -pc_factor_mat_solver_type superlu_dist > ex19.tmp 2>&1; \
87*c4762a1bSJed Brown	   if (${DIFF} output/ex19_superlu.out ex19.tmp) then \
88*c4762a1bSJed Brown           echo "C/C++ example src/snes/tutorials/ex19 run successfully with superlu_dist"; \
89*c4762a1bSJed Brown           else  printf "${PWD}\nPossible problem with ex19 running with superlu_dist, diffs above\n=========================================\n"; fi; \
90*c4762a1bSJed Brown	   ${RM} -f ex19.tmp
91*c4762a1bSJed Brownrunex19_suitesparse:
92*c4762a1bSJed Brown	-@${MPIEXEC} -n 1 ./ex19 -da_refine 3 -snes_monitor_short -pc_type lu -pc_factor_mat_solver_type umfpack > ex19_1.tmp 2>&1; \
93*c4762a1bSJed Brown	   if (${DIFF} output/ex19_suitesparse.out ex19_1.tmp) then \
94*c4762a1bSJed Brown           echo "C/C++ example src/snes/tutorials/ex19 run successfully with suitesparse"; \
95*c4762a1bSJed Brown           else  printf "${PWD}\nPossible problem with ex19 running with suitesparse, diffs above\n=========================================\n"; fi; \
96*c4762a1bSJed Brown	   ${RM} -f ex19_1.tmp
97*c4762a1bSJed Brown
98*c4762a1bSJed Browninclude ${PETSC_DIR}/lib/petsc/conf/test
99