diff --git a/src/schwarz.jl b/src/schwarz.jl index bfd2240..4ed1b92 100644 --- a/src/schwarz.jl +++ b/src/schwarz.jl @@ -12,6 +12,10 @@ function SolidSchwarzController(params::Dict{String,Any}) initial_time = params["initial time"] final_time = params["final time"] time_step = params["time step"] + println("Requested time step is ", time_step) + num_stops = ceil(Int64, (final_time - initial_time) / time_step) + 1 + time_step = (final_time - initial_time) / (num_stops - 1) + println("Adjusted time step is ", time_step, " with ", num_stops, " stops") absolute_error = relative_error = 0.0 time = prev_time = initial_time same_step = get(params, "same time step for domains", false) @@ -60,6 +64,7 @@ function SolidSchwarzController(params::Dict{String,Any}) time, prev_time, same_step, + num_stops, stop, converged, iteration_number, diff --git a/src/schwarz_def.jl b/src/schwarz_def.jl index 435f6b5..1bcca7d 100644 --- a/src/schwarz_def.jl +++ b/src/schwarz_def.jl @@ -19,6 +19,7 @@ mutable struct SolidSchwarzController <: SchwarzController time::Float64 prev_time::Float64 same_step::Bool + num_stops::Int64 stop::Int64 converged::Bool iteration_number::Int64 diff --git a/test/opinf-schwarz-overlap-cuboid-hex8.jl b/test/opinf-schwarz-overlap-cuboid-hex8.jl index 493e5d8..3616c6f 100644 --- a/test/opinf-schwarz-overlap-cuboid-hex8.jl +++ b/test/opinf-schwarz-overlap-cuboid-hex8.jl @@ -3,7 +3,7 @@ # the U.S. Government retains certain rights in this software. This software # is released under the BSD license detailed in the file license.txt in the # top-level Norma.jl directory. -@testset "schwarz-overlap-static-cuboid-hex8-same-step" begin +@testset "opinf-schwarz-overlap-static-cuboid-hex8-same-step" begin cp("../examples/ahead/overlap/cuboid/dynamic-opinf-rom/cuboid-1.yaml", "cuboid-1.yaml", force=true) cp("../examples/ahead/overlap/cuboid/dynamic-opinf-rom/cuboid-2.yaml", "cuboid-2.yaml", force=true) cp("../examples/ahead/overlap/cuboid/dynamic-opinf-rom/cuboids.yaml", "cuboids.yaml", force=true) @@ -22,7 +22,6 @@ rm("cuboid-1.e") rm("cuboid-2.e") rm("opinf-operator.npz") - print(model_coarse.reduced_state[1]) @test model_coarse.reduced_state[1] ≈ 0.04508462384388636 rtol = 1.0e-06 @test model_coarse.reduced_state[2] ≈ 0.0450846238438998 rtol = 1.0e-06 @test model_coarse.reduced_state[3] ≈ 0.21766337487648266 rtol = 1.0e-06