Skip to content

Commit 86bce48

Browse files
.& v0.6
1 parent 138c102 commit 86bce48

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/fem_premade_problems.jl

+8-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ prob_femheat_diffuse = HeatProblem(analytic_diffuse,Du,f,mesh)
7070

7171

7272
f = (t,x) -> zeros(size(x,1))
73-
u0_func = (x) -> float((abs.(x[:,1]-.5) .< 1e-6) & (abs.(x[:,2]-.5) .< 1e-6)) #Only mass at middle of (0.0,1.0)^2
73+
if VERSION < v"0.6-"
74+
u0_func = (x) -> float((abs.(x[:,1]-.5) .< 1e-6) & (abs.(x[:,2]-.5) .< 1e-6)) #Only mass at middle of (0.0,1.0)^2
75+
else
76+
u0_func = (x) -> float((abs.(x[:,1]-.5) .< 1e-6) .& (abs.(x[:,2]-.5) .< 1e-6)) #Only mass at middle of (0.0,1.0)^2
77+
end
7478
tspan = (0.0,1/2^(5))
7579
dx = 1//2^(3)
7680
dt = 1//2^(9)
@@ -131,7 +135,7 @@ prob_femheat_birthdeathinteractingsystem = HeatProblem(u0,f,mesh)
131135

132136
#=
133137
f = (t,x,u) -> [zeros(size(x,1)) zeros(size(x,1))]
134-
u0 = (x) -> [float((abs.(x[:,1]-.5) .< 1e-6) & (abs.(x[:,2]-.5) .< 1e-6)) float((abs.(x[:,1]-.5) .< 1e-6) & (abs.(x[:,2]-.5) .< 1e-6))] # size (x,2), 2 meaning 2 variables
138+
u0 = (x) -> [float((abs.(x[:,1]-.5) .< 1e-6) .& (abs.(x[:,2]-.5) .< 1e-6)) float((abs.(x[:,1]-.5) .< 1e-6) .& (abs.(x[:,2]-.5) .< 1e-6))] # size (x,2), 2 meaning 2 variables
135139
"""
136140
Example problem which solves the homogeneous Heat equation with all mass starting at (1/2,1/2) with two different diffusion constants,
137141
``D₁=0.01`` and ``D₂=0.001``. Good animation test.
@@ -157,8 +161,8 @@ function heatProblemExample_grayscott(;ρ=.03,k=.062,D=[1e-3 .5e-3])
157161
f₁(t,x,u) = u[:,1].*u[:,2].*u[:,2] + ρ*(1-u[:,2])
158162
f₂(t,x,u) = u[:,1].*u[:,2].*u[:,2] -(ρ+k).*u[:,2]
159163
f(t,x,u) = [f₁(t,x,u) f₂(t,x,u)]
160-
u0(x) = [ones(size(x,1))+rand(size(x,1)) .25.*float(((.2.<x[:,1].<.6) &
161-
(.2.<x[:,2].<.6)) | ((.85.<x[:,1]) & (.85.<x[:,2])))] # size (x,2), 2 meaning 2 variables
164+
u0(x) = [ones(size(x,1))+rand(size(x,1)) .25.*float(((.2.<x[:,1].<.6) .&
165+
(.2.<x[:,2].<.6)) | ((.85.<x[:,1]) .& (.85.<x[:,2])))] # size (x,2), 2 meaning 2 variables
162166
return(HeatProblem(u0,f,D=D))
163167
end
164168

0 commit comments

Comments
 (0)