From a906cb80b80dff83d2cfbdcf858bb6eac36b4aba Mon Sep 17 00:00:00 2001 From: prkkumar Date: Wed, 17 Jul 2024 12:23:42 -0700 Subject: [PATCH] remove set_slow_fast_timestep_ratio and add input file --- .../Exec/inputs_forward_euler | 14 ----------- .../Reaction-Diffusion/Exec/inputs_rk3 | 24 ------------------- .../{inputs_sundials => inputs_sundials_mri} | 14 ++++++----- .../Reaction-Diffusion/Source/main.cpp | 4 ---- 4 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_forward_euler delete mode 100644 ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_rk3 rename ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/{inputs_sundials => inputs_sundials_mri} (79%) diff --git a/ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_forward_euler b/ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_forward_euler deleted file mode 100644 index 39b09830..00000000 --- a/ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_forward_euler +++ /dev/null @@ -1,14 +0,0 @@ -n_cell = 32 -max_grid_size = 16 - -nsteps = 1000 -plot_int = 100 - -dt = 1.e-5 - -# INTEGRATION -## integration.type can take on the following values: -## 0 or "ForwardEuler" => Native AMReX Forward Euler integrator -## 1 or "RungeKutta" => Native AMReX Explicit Runge Kutta controlled by integration.rk.type -## 2 or "SUNDIALS" => SUNDIALS backend controlled by integration.sundials.strategy -integration.type = ForwardEuler diff --git a/ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_rk3 b/ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_rk3 deleted file mode 100644 index 6eb60137..00000000 --- a/ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_rk3 +++ /dev/null @@ -1,24 +0,0 @@ -n_cell = 32 -max_grid_size = 16 - -nsteps = 1000 -plot_int = 100 - -dt = 1.e-5 - -# INTEGRATION -## integration.type can take on the following values: -## 0 or "ForwardEuler" => Native AMReX Forward Euler integrator -## 1 or "RungeKutta" => Native AMReX Explicit Runge Kutta controlled by integration.rk.type -## 2 or "SUNDIALS" => SUNDIALS backend controlled by integration.sundials.strategy -integration.type = RungeKutta - -## Native AMReX Explicit Runge-Kutta parameters -# -## integration.rk.type can take the following values: -### 0 = User-specified Butcher Tableau -### 1 = Forward Euler -### 2 = Trapezoid Method -### 3 = SSPRK3 Method -### 4 = RK4 Method -integration.rk.type = 3 diff --git a/ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_sundials b/ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_sundials_mri similarity index 79% rename from ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_sundials rename to ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_sundials_mri index bbdf2c69..fed23dc7 100644 --- a/ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_sundials +++ b/ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/inputs_sundials_mri @@ -1,3 +1,4 @@ +## n_cell = 32 max_grid_size = 16 @@ -6,6 +7,10 @@ plot_int = 100 dt = 1.e-5 +# To replicate heat equation +diffusion_coef = 1.0 +reaction_coef = 1.0 + # Use adaptive time stepping and set integrator relative and absolute tolerances # adapt_dt = true # reltol = 1.0e-4 @@ -33,12 +38,9 @@ integration.type = SUNDIALS # documentation for the supported method names # Use the SUNDIALS default method for the chosen type (fixed or adaptive step sizes) -integration.sundials.type = ERK +integration.sundials.type = EX-MRI # all the types listed above work with respective default methods -# Use forward Euler (fixed step sizes only) +# The following combination of type and method works as well # integration.sundials.type = ERK -# integration.sundials.method = ARKODE_FORWARD_EULER_1_1 +#integration.sundials.method = ARKODE_MRI_GARK_FORWARD_EULER #ARKODE_FORWARD_EULER_1_1 -# Use backward Euler (fixed step sizes only) -# integration.sundials.type = DIRK -# integration.sundials.method = ARKODE_BACKWARD_EULER_1_1 diff --git a/ExampleCodes/SUNDIALS/Reaction-Diffusion/Source/main.cpp b/ExampleCodes/SUNDIALS/Reaction-Diffusion/Source/main.cpp index 4add8ebd..cda2385e 100644 --- a/ExampleCodes/SUNDIALS/Reaction-Diffusion/Source/main.cpp +++ b/ExampleCodes/SUNDIALS/Reaction-Diffusion/Source/main.cpp @@ -246,10 +246,6 @@ void main_main () integrator.set_time_step(dt); } - // This sets the ratio of slow timestep size to fast timestep size as an integer, - // or equivalently, the number of fast timesteps per slow timestep. - integrator.set_slow_fast_timestep_ratio(10); - for (int step = 1; step <= nsteps; ++step) { // Set time to evolve to