From 716dd649ea5639e0ecc4f820d61c670cc6fddc28 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 22 Sep 2023 19:42:08 -0400 Subject: [PATCH] remove sdc_newton_use_analytic_jac (#2573) We will rely on integrator.jacobian now --- Docs/source/sdc.rst | 6 +++--- Exec/science/Detonation/inputs-det-x.sdc.test | 2 +- Exec/science/Detonation/nse_runs/inputs.template.true_sdc | 2 -- Exec/science/flame/inputs.1d.sdc | 3 +-- Source/driver/_cpp_parameters | 4 ---- Source/sdc/sdc_react_util.H | 2 +- 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Docs/source/sdc.rst b/Docs/source/sdc.rst index 90b528fe93..478120f656 100644 --- a/Docs/source/sdc.rst +++ b/Docs/source/sdc.rst @@ -42,6 +42,9 @@ The options that affect the nonlinear solve are: * 3 : use VODE for the first iteration and then Newton for the subsequent iterations. + In all cases, the type of Jacobian (analytic or numerical) is determined by + ``integrator.jacobian``. + * ``sdc_solver_tol_dens`` : the relative error on the density in solving the nonlinear system. * ``sdc_solver_tol_spec`` : the relative error on the partial densities, :math:`(\rho X_k)` @@ -57,9 +60,6 @@ The options that affect the nonlinear solve are: * ``sdc_solve_for_rhoe`` : whether we solve the system in terms of :math:`(\rho e)` or :math:`(\rho E)`. -* ``sdc_newton_use_analytic_jac`` : whether we use the analytic Jacobian when doing Newton iterations for - the reaction part of the system or compute it numerically. - diff --git a/Exec/science/Detonation/inputs-det-x.sdc.test b/Exec/science/Detonation/inputs-det-x.sdc.test index ec6b72dac1..887b077e96 100644 --- a/Exec/science/Detonation/inputs-det-x.sdc.test +++ b/Exec/science/Detonation/inputs-det-x.sdc.test @@ -32,7 +32,6 @@ castro.sdc_solver_tol_dens = 1.e-5 castro.sdc_solver_tol_spec = 1.e-5 castro.sdc_solver_tol_ener = 1.e-5 castro.sdc_solver_atol = 1.e-10 -castro.sdc_newton_use_analytic_jac = 1 castro.ppm_type = 0 @@ -102,3 +101,4 @@ amr.refine.tempgrad.field_name = Temp # Microphysics integrator.call_eos_in_rhs = 1 +integrator.jacobian = 1 diff --git a/Exec/science/Detonation/nse_runs/inputs.template.true_sdc b/Exec/science/Detonation/nse_runs/inputs.template.true_sdc index 2077f694ec..663b54178e 100644 --- a/Exec/science/Detonation/nse_runs/inputs.template.true_sdc +++ b/Exec/science/Detonation/nse_runs/inputs.template.true_sdc @@ -44,8 +44,6 @@ castro.sdc_solver_tol_spec=1.e-8 castro.sdc_solver_tol_ener=1.e-8 castro.sdc_solver_atol = 1.e-8 castro.sdc_solver=2 -castro.sdc_newton_use_analytic_jac = 1 - # TIME STEP CONTROL diff --git a/Exec/science/flame/inputs.1d.sdc b/Exec/science/flame/inputs.1d.sdc index e20436e736..cd9220e75f 100644 --- a/Exec/science/flame/inputs.1d.sdc +++ b/Exec/science/flame/inputs.1d.sdc @@ -31,7 +31,6 @@ castro.sdc_solver_tol_spec = 1.e-10 castro.sdc_solver_tol_ener = 1.e-6 castro.sdc_solver_atol = 1.e-10 castro.sdc_solver = 1 -castro.sdc_newton_use_analytic_jac = 1 castro.sdc_solver_relax_factor = 1 castro.use_reconstructed_gamma1 = 1 @@ -113,4 +112,4 @@ integrator.atol_spec = 1.e-8 network.small_x = 1.e-10 -integrator.jacobian = 2 +integrator.jacobian = 1 diff --git a/Source/driver/_cpp_parameters b/Source/driver/_cpp_parameters index ec98042eb0..41d18d1788 100644 --- a/Source/driver/_cpp_parameters +++ b/Source/driver/_cpp_parameters @@ -286,10 +286,6 @@ sdc_solver_relax_factor Real 1.0 # do we solve for (rho e) or (rho E) in the SDC nonlinear solve? sdc_solve_for_rhoe int 1 -# do we use the analytic or numerical Jacobian for the Newton-Raphson solver? -# for the VODE solver, we use integrator.jacobian instead -sdc_newton_use_analytic_jac int 1 - # for 2-d axisymmetry, do we include the geometry source terms from Bernand-Champmartin? use_axisymmetric_geom_source int 1 diff --git a/Source/sdc/sdc_react_util.H b/Source/sdc/sdc_react_util.H index 47c4734d5c..9d29c24271 100644 --- a/Source/sdc/sdc_react_util.H +++ b/Source/sdc/sdc_react_util.H @@ -95,7 +95,7 @@ single_zone_jac(GpuArray const& state, // Jac has the derivatives with respect to the native // network variables, X, e. Note: the e derivative - if (sdc_newton_use_analytic_jac == 0) { + if (integrator_rp::jacobian == 2) { // note the numerical Jacobian will be returned in terms of X // and will already have the corrections to convert into d/de // instead of d/dT