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