Skip to content

Commit 8c55457

Browse files
committed
check type with x,t not only t
1 parent 9a7753d commit 8c55457

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/WaterLily.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ mutable struct Simulation <: AbstractSimulation
7070
@assert !(isa(u_BC,Function) && isa(uλ,Function)) "`u_BC` will be used to generate `uλ=u_BC(t=0)` do not provide both"
7171
@assert !(isnothing(U) && isa(u_BC,Function)) "`U` must be specified if `u_BC` is a Function"
7272
isa(g,Function) && @assert first(methods(g)).nargs==4 "g::Function needs to be defined as g(i,x,t)"
73-
isa(g,Function) && @assert all(typeof.(ntuple(i->g(i,zeros(SVector{N}),zero(T)),N)).==T) "`g` is not type stable"
73+
isa(g,Function) && @assert all(typeof.(ntuple(i->g(i,zeros(SVector{N,T}),zero(T)),N)).==T) "`g` is not type stable"
7474
isa(u_BC,Function) && @assert first(methods(u_BC)).nargs==4 "u_BC::Function needs to be defined as u_BC(i,x,t)"
75-
isa(u_BC,Function) && @assert all(typeof.(ntuple(i->u_BC(i,zeros(SVector{N}),zero(T)),N)).==T) "`u_BC` is not type stable"
75+
isa(u_BC,Function) && @assert all(typeof.(ntuple(i->u_BC(i,zeros(SVector{N,T}),zero(T)),N)).==T) "`u_BC` is not type stable"
7676
isnothing(uλ) && (uλ = isa(u_BC, Function) ?= (i,x)->u_BC(i,x,0) := (i,_)->u_BC[i])
7777
isnothing(U) && (U = sum(abs2,u_BC))
7878
flow = Flow(dims,u_BC;uλ,Δt,ν,g,T,f=mem,perdir,exitBC)

0 commit comments

Comments
 (0)