idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.77k stars 1.05k forks source link

PETSc options contamination between multiple preconditioners in multi-system #29063

Open GiudGiud opened 2 days ago

GiudGiud commented 2 days ago

Bug Description

-ksp_type -snes_test_jacobian when passed to the second PC object get passed to the first one as well.

Same for solve_type but that's likely a different cause. It would be nice though

Steps to Reproduce

petsc_options_iname_prec = '-pc_type -ksp_type'
petsc_options_value_prec = 'lu preonly'

[Preconditioning]
  [flow]
    type = SMP
    #  solve_type = NEWTON
    trust_my_coupling = true
    full = true
    nl_sys = "nl0"
    petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_package'
    petsc_options_value = 'lu NONZERO superlu_dist'
  []
  [scalar1]
    type = SMP
    # solve_type = LINEAR
    nl_sys = "prec1"
    petsc_options = '-snes_test_jacobian'
    petsc_options_iname = ${petsc_options_iname_prec}
    petsc_options_value = ${petsc_options_value_prec}
  []

Impact

Makes debugging multi-system problems difficult

[Optional] Diagnostics

No response

lindsayad commented 2 days ago

we will need to add options prefixes for the different systems

lindsayad commented 2 days ago

Are you going to work on this or should I assign myself?

GiudGiud commented 2 days ago

if you already know what to do please go ahead

lindsayad commented 2 days ago

Related to #24690