Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit 13df580

Browse files
add test for current MOL
1 parent 5d926a4 commit 13df580

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

test/MOLtest.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using ModelingToolkit, DiffEqOperators, DiffEqBase, LinearAlgebra
2+
3+
# Define some variables
4+
@parameters t x
5+
@variables u(..)
6+
@derivatives Dt'~t
7+
@derivatives Dxx''~x
8+
eq = Dt(u(t,x)) ~ Dxx(u(t,x))
9+
bcs = [u(0,x) ~ - x * (x-1) * sin(x),
10+
u(t,0) ~ 0, u(t,1) ~ 0]
11+
12+
domains = [t IntervalDomain(0.0,1.0),
13+
x IntervalDomain(0.0,1.0)]
14+
15+
pdesys = PDESystem(eq,bcs,domains,[t,x],[u])
16+
discretization = MOLFiniteDifference(0.1)
17+
prob = discretize(pdesys,discretization) # This gives an ODEProblem since it's time-dependent
18+
19+
using OrdinaryDiffEq
20+
sol = solve(prob,Tsit5(),saveat=0.1)

test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ import Base: isapprox
1717
@time @safetestset "Differentiation Dimension" begin include("differentiation_dimension.jl") end
1818
@time @safetestset "2D and 3D fast multiplication" begin include("2D_3D_fast_multiplication.jl") end
1919
@time @safetestset "Higher Dimensional Concretization" begin include("concretization.jl") end
20-
@time @safetestset "Upwind Operator Interface" begin include("upwind_operators_interface.jl") end
20+
@time @safetestset "Upwind Operator Interface" begin include("upwind_operators_interface.jl") end
21+
@time @safetestset "MOLFiniteDifference Interface" begin include("MOLtest.jl") end

0 commit comments

Comments
 (0)