forked from WIAS-PDELib/VoronoiFVM.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging 'master' into feature/extendablefembaseext
- Loading branch information
Showing
6 changed files
with
107 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", "Dilara Abdel", "Jan Weidner", "Alexander Seiler", "Patricio Farrell", "Matthias Liero"] | ||
version = "2.0.0" | ||
version = "2.0.1" | ||
|
||
[deps] | ||
BandedMatrices = "aae01518-5342-5314-be14-df237901396f" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
module test_state | ||
using VoronoiFVM | ||
using VoronoiFVM: SystemState | ||
using ExtendableGrids | ||
using LinearAlgebra | ||
using Test | ||
|
||
flux(y,u,edge, data)= y[1]=u[1,1]-u[1,2] | ||
|
||
function bcondition(y,u,bnode,data) | ||
boundary_robin!(y,u,bnode,region=1, value=0.0, factor=0.1) | ||
boundary_robin!(y,u,bnode,region=2, value=1.0, factor=0.1) | ||
end | ||
|
||
function main(; unknown_storage=:dense) | ||
g=simplexgrid(0:0.1:1) | ||
sys=VoronoiFVM.System(g; flux, bcondition, species=[1], unknown_storage) | ||
sol1=solve(sys) | ||
|
||
# Solution and solution with state shall be the same | ||
state=VoronoiFVM.SystemState(sys) | ||
sol2=solve!(state) | ||
@test sol1≈sol2 | ||
|
||
control=SolverControl() | ||
fixed_timesteps!(control,0.025) | ||
|
||
|
||
# Allow initial values as result of previous time evolution | ||
tsol1=solve(sys; inival=0.0, times=(0,0.1), control) | ||
tsol2=solve(sys; inival=tsol1.u[end], times=(0.1,0.2), control) | ||
tsol3=solve(sys; inival=0.0, times=[0.0,0.1,0.2], control) | ||
@test tsol3.u[end]≈tsol2.u[end] | ||
|
||
# Solution and solution with state shall be the same | ||
xsol1=solve!(state; inival=0.0, times=(0,0.1), control) | ||
xsol2=solve!(state; inival=tsol1.u[end], times=(0.1,0.2), control) | ||
xsol3=solve!(state; inival=0.0, times=[0.0,0.1,0.2], control) | ||
@test xsol3.u[end]≈xsol2.u[end] | ||
@test xsol3.u[end]≈tsol3.u[end] | ||
|
||
|
||
|
||
end | ||
|
||
function runtests() | ||
main(;unknown_storage=:dense) | ||
main(;unknown_storage=:sparse) | ||
|
||
end | ||
end | ||
|