diff --git a/python/stokes-dolfin-snes.py b/python/stokes-dolfin-snes.py index 1db6ad4..849c2d0 100644 --- a/python/stokes-dolfin-snes.py +++ b/python/stokes-dolfin-snes.py @@ -11,6 +11,10 @@ import sys +parameters["form_compiler"]["quadrature_degree"] = 6 +parameters["form_compiler"]["cpp_optimize"] = True +parameters["form_compiler"]["cpp_optimize_flags"] = "-O3 -ffast-math -march=native" + def usage(): print sys.argv[0]+""" [options] dolfin_mesh.xml options: @@ -81,20 +85,21 @@ def usage(): --petsc.se_snes_atol 1.0e-7 --petsc.se_ksp_converged_reason - --petsc.se_ksp_type bcgs + --petsc.se_ksp_type gcr --petsc.se_ksp_monitor_true_residual - --petsc.se_ksp_rtol 1.0e-6 - --petsc.se_ksp_atol 1.0e-6 + --petsc.se_ksp_rtol 1.0e-7 + --petsc.se_ksp_atol 1.0e-7 --petsc.se_pc_type fieldsplit --petsc.se_pc_fieldsplit_type schur --petsc.se_pc_fieldsplit_schur_factorization_type upper - --petsc.se_pc_fieldsplit_schur_Rpreconditioner user --petsc.se_fieldsplit_0_ksp_type preonly - --petsc.se_fieldsplit_0_pc_type gamg + --petsc.se_fieldsplit_0_ksp_max_it 1 + --petsc.se_fieldsplit_0_pc_type ml --petsc.se_fieldsplit_1_ksp_type preonly + --petsc.se_fieldsplit_1_ksp_max_it 2 --petsc.se_fieldsplit_1_pc_type jacobi """.split() @@ -235,12 +240,12 @@ def extract_sub_vector(V, subspace): (v, q) = TestFunctions(Z) schur_D = assemble(inner(p, q)*dx) - [bc.apply(schur_D) for bc in bcs] + #[bc.apply(schur_D) for bc in bcs] schur = extract_sub_matrix(schur_D, 1, 1) def monitor(snes, its, norm): pc = snes.ksp.pc - pc.setFieldSplitSchurPrecondition(PETSc.PC.SchurPreType.USER, schur) + pc.setFieldSplitSchurPreType(PETSc.PC.SchurPreType.USER, schur) snes.setMonitor(monitor)