Hello, I want to solve PF solidification+Navier stokes using Finite different method, and I have a strange problem. My code runs fine for some system sizes and fails for some of the system sizes. When I run with the following options: mpirun -np 2 ./one.out -ts_monitor -snes_fd_color -ts_max_snes_failures -1 -ts_type bdf -ts_bdf_adapt -pc_type bjacobi -snes_linesearch_type l2 -snes_type ksponly -ksp_type gmres -ksp_gmres_restart 1001 -sub_pc_type ilu -sub_ksp_type preonly -snes_monitor -ksp_monitor -snes_linesearch_monitor -ksp_monitor_true_residual -ksp_converged_reason -log_view
0 SNES Function norm 1.465357113711e+01 0 SNES Function norm 1.465357113711e+01 Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0 PC_FAILED due to SUBPC_ERROR Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0 PC_FAILED due to SUBPC_ERROR 0 SNES Function norm 1.465357113711e+01 0 SNES Function norm 1.465357113711e+01 Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0 PC_FAILED due to SUBPC_ERROR Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0 PC_FAILED due to SUBPC_ERROR 0 SNES Function norm 1.465357113711e+01 0 SNES Function norm 1.465357113711e+01 ^C Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0 PC_FAILED due to SUBPC_ERROR 0 SNES Function norm 1.465357113711e+01 Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0 PC_FAILED due to SUBPC_ERROR 0 SNES Function norm 1.465357113711e+01 Even setting pc_type to LU does not solve the problem. 0 TS dt 0.0001 time 0. copy! copy! Write output at step= 0! Write output at step= 0! 0 SNES Function norm 1.465357113711e+01 0 SNES Function norm 1.465357113711e+01 Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0 PC_FAILED due to FACTOR_NUMERIC_ZEROPIVOT Linear solve did not converge due to DIVERGED_PC_FAILED iterations 0 PC_FAILED due to FACTOR_NUMERIC_ZEROPIVOT I guess the problem is that in mass conservation I used forward discretization for u (velocity in x) and for the moment in x , I used forward discretization for p (pressure) to ensure non-zero terms on the diagonal of matrix. I tried to run it with valgrind but it did not output anything. Does anyone have suggestions on how to solve this issue? Best, Sepideh