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