reinit_solver_parameters = {
    "ksp_type": "cg",
    "ksp_rtol": 1e-6,
    "pc_type": "hypre",
    "pc_hypre_type": "boomeramg",
    "pc_hypre_boomeramg_max_iter": 5,
    "pc_hypre_boomeramg_coarsen_type": "PMIS",
    "pc_hypre_boomeramg_agg_nl": 2,
    "pc_hypre_boomeramg_strong_threshold": 0.95,
    "pc_hypre_boomeramg_interp_type": "ext+i",
    "pc_hypre_boomeramg_P_max": 2,
    "pc_hypre_boomeramg_relax_type_all": "sequential-Gauss-Seidel",
    "pc_hypre_boomeramg_grid_sweeps_all": 1,
    "pc_hypre_boomeramg_truncfactor": 0.3,
    "pc_hypre_boomeramg_max_levels": 6,
    "ksp_max_it": 200,
    "ksp_converged_maxits": None,
}

hj_solver_parameters = {
    "peclet_number": 1e-3,
    "ksp_type": "gmres",
    "ksp_converged_maxits": None,
    "snes_type": "ksponly",
    "snes_no_convergence_test": None,
    "snes_atol": 1e-5,
    "ksp_atol": 1e-5,
    "ksp_rtol": 1e-5,
    "ts_type": "beuler",
    "pc_type": "bjacobi",
    "sub_pc_type": "ilu",
    "sub_pc_factor_levels": 1,
    "ksp_max_it": 5000,
    "ksp_gmres_restart": 200,
    "ts_atol": 1e-5,
    "ts_rtol": 1e-5,
    "ts_max_steps": 400,
    # "ksp_monitor": None
    # "snes_monitor": None,
    # "ts_monitor": None,
    # "ksp_converged_reason": None,
}
regularization_solver_parameters = {
    "mat_type": "aij",
    "ksp_type": "cg",
    "pc_type": "hypre",
    "pc_hypre_type": "boomeramg",
    "pc_hypre_boomeramg_max_iter": 200,
    "pc_hypre_boomeramg_coarsen_type": "HMIS",
    "pc_hypre_boomeramg_agg_nl": 1,
    "pc_hypre_boomeramg_strong_threshold": 0.7,
    "pc_hypre_boomeramg_interp_type": "ext+i",
    "pc_hypre_boomeramg_P_max": 4,
    "pc_hypre_boomeramg_relax_type_all": "sequential-Gauss-Seidel",
    "pc_hypre_boomeramg_grid_sweeps_all": 1,
    "pc_hypre_boomeramg_max_levels": 15,
    "ksp_converged_reason": None,
}
temperature_solver_parameters = {
    "ksp_type": "fgmres",
    "snes_atol": 1e-6,
    "pc_type": "python",
    "pc_python_type": "firedrake.AssembledPC",
    "assembled_mat_type": "aij",
    "assembled_pc_type": "hypre",
    "assembled_pc_hypre_boomeramg_P_max": 4,
    "assembled_pc_hypre_boomeramg_agg_nl": 1,
    "assembled_pc_hypre_boomeramg_agg_num_paths": 2,
    "assembled_pc_hypre_boomeramg_coarsen_type": "HMIS",
    "assembled_pc_hypre_boomeramg_interp_type": "ext+i",
    "assembled_pc_hypre_boomeramg_no_CF": True,
    "ksp_max_it": 300,
}

ns_solver_tolerances = 1e-4
ns_solver_parameters = {
    "ksp_converged_maxits": None,
    "ksp_max_it": 1000,
    "ksp_atol": ns_solver_tolerances,
    "ksp_rtol": ns_solver_tolerances,
    # "ksp_monitor": None,
    "snes_atol": 1e-4,
    "snes_rtol": 1e-4,
    "snes_max_it": 10,
    "snes_no_convergence_test": None,
    "ksp_converged_reason": None,
}
