#! /bin/csh
#
#  Tests many of the preconditioners/Krylov subspace methods
#
setenv MATRIXDIR /home/bsmith/petsc/src/mat/examples/matrices/
#
echo "Matrix    Its Res  --------Time-------     KSP   PC      PC options     "
echo "             Norm  Total   Setup   Solve"
echo "------------------------------------------------------------------------"
foreach matrix (arco1)
  
#  LU on entire matrix
#
  foreach order (nd rcm qmd 1wd)
    mpiexec ex10 -f0 $MATRIXDIR/$matrix -pc_type lu -ksp_type preonly \
               -mat_order $order -table
  end
  echo " "

#  ILU on entire matrix
#
  foreach levels (0 1 2)
    foreach order (nd rcm qmd 1wd)
       foreach ksp (gmres bcgs)
          mpiexec ex10 -f0 $MATRIXDIR/$matrix -pc_type ilu -mat_order $order \
                     -pc_ilu_levels $levels -table -ksp_type $ksp
       end
    end
  end
  echo " "

#  Block jacobi with LU on blocks
#
  foreach blocks (2 4 8)
    foreach order (nd rcm qmd 1wd)
       foreach ksp (gmres bcgs)
          mpiexec ex10 -f0 $MATRIXDIR/$matrix -pc_type bjacobi -sub_mat_order $order \
                     -sub_pc_type lu -table -ksp_type $ksp -sub_ksp_type $ksp \
                     -pc_bjacobi_blocks $blocks
       end
    end
  end
  echo " "

#  Block jacobi with ILU on blocks
#
  foreach blocks (2 4 8)
    foreach order (nd rcm qmd 1wd)
      foreach levels (0 1 2)
        foreach ksp (gmres bcgs)
          mpiexec ex10 -f0 $MATRIXDIR/$matrix -pc_type bjacobi -sub_mat_order $order \
                     -sub_pc_type ilu -table -ksp_type $ksp -sub_ksp_type $ksp \
                     -sub_pc_ilu_levels $levels -pc_bjacobi_blocks $blocks
      end
    end
  end
  echo " "


#  ASM with LU on blocks
#
  foreach blocks (2 4 8)
    foreach overlap (0 1)
      foreach order (nd rcm qmd 1wd)
        foreach ksp (gmres bcgs)
          mpiexec ex10 -f0 $MATRIXDIR/$matrix -pc_type bjacobi -sub_mat_order $order \
                     -sub_pc_type lu -table -ksp_type $ksp -sub_ksp_type $ksp \
                     -pc_asm_overlap $overlap -pc_asm_blocks $blocks
        end
      end
    end
  end
  echo " "

#  ASM with ILU on blocks
#
  foreach blocks (2 4 8)
    foreach overlap (0 1)
      foreach levels (0 1 2)
        foreach order (nd rcm qmd 1wd)
          foreach ksp (gmres bcgs)
            mpiexec ex10 -f0 $MATRIXDIR/$matrix -pc_type bjacobi -sub_mat_order $order \
                       -sub_pc_type ilu -table -ksp_type $ksp -sub_ksp_type $ksp \
                       -sub_pc_ilu_levels $levels -pc_asm_overlap $overlap \
                       -pc_asm_blocks $blocks
          end
      end
    end
  end
  echo " "

end
