Skip to content

Commit

Permalink
Merge pull request WIAS-PDELib#147 from WIAS-PDELib/jf/fix-output-of-…
Browse files Browse the repository at this point in the history
…initial-timestep

Fix output of initial timestep
  • Loading branch information
j-fu authored Nov 18, 2024
2 parents 026f99c + bf48be2 commit 087b95d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "VoronoiFVM"
uuid = "82b139dc-5afc-11e9-35da-9b9bdfd336f3"
authors = ["Jürgen Fuhrmann <[email protected]>", "Patrick Jaap", "Daniel Runge", "Dilara Abdel", "Jan Weidner", "Alexander Seiler", "Patricio Farrell", "Matthias Liero"]
version = "2.5.0"
version = "2.5.1"

[deps]
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
Expand Down
38 changes: 21 additions & 17 deletions src/vfvm_solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -256,34 +256,38 @@ function solve_transient!(state,
solution = copy(inival)
oldsolution = copy(inival) # we need a copy as it is later overwritten

# Initialize Dirichlet boundary values
_initialize_dirichlet!(solution, state.system; time, λ = Float64(lambdas[1]), params)

# If not transient, solve for first embedding lambdas[1]
t0 = @elapsed if !transient
t0 = 0.0
if transient
# Initialize transient solution struct
tsol = TransientSolution(Float64(lambdas[1]), copy(solution); in_memory = control.in_memory)
# Initialize Dirichlet boundary values
_initialize_dirichlet!(solution, state.system; time, λ = Float64(lambdas[1]), params)
else
# If not transient, solve for first embedding lambdas[1]
_initialize_dirichlet!(solution, state.system; time, λ = Float64(lambdas[1]), params)
control.pre(solution, Float64(lambdas[1]))
solution = solve_step!(state,
solution,
oldsolution,
control,
time,
Inf,
Float64(lambdas[1]),
params)

t0 = @elapsed solution = solve_step!(state,
solution,
oldsolution,
control,
time,
Inf,
Float64(lambdas[1]),
params)
control.post(solution, oldsolution, lambdas[1], 0)

if control.log
push!(allhistory, solution.history)
push!(allhistory.times, lambdas[1])
Δu = control.delta(state.system, solution, oldsolution, lambdas[1], 0)
push!(allhistory.updates, Δu)
end
oldsolution .= solution

tsol = TransientSolution(Float64(lambdas[1]), copy(solution); in_memory = control.in_memory)
end

# Initialize transient solution struct
tsol = TransientSolution(Float64(lambdas[1]), copy(solution); in_memory = control.in_memory)

if doprint(control, 'e')
println("[e]volution: start in $(extrema(lambdas))")
Expand Down

0 comments on commit 087b95d

Please sign in to comment.