Skip to content

Commit 1c4ea09

Browse files
committed
make sure initial conditions gets typed appropriately
1 parent bc337bb commit 1c4ea09

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/diffusion.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ updatevars!(prob) = updatevars!(prob.vars, prob.grid, prob.sol)
114114
115115
Set the solution as the transform of `c`.
116116
"""
117-
function set_c!(prob::FourierFlows.Problem{T, A}, c) where {T, A}
118-
prob.vars.c .= A(c) # this converts c to the ArrayType used in prob.vars.c (e.g., convert to CuArray if user gives c as Arrray)
117+
function set_c!(prob, c)
118+
T = typeof(prob.vars.c)
119+
prob.vars.c .= T(c) # this makes sure that c is converted to the ArrayType used in prob.vars.c (e.g., convert to CuArray if user gives c as Arrray)
119120
mul!(prob.sol, prob.grid.rfftplan, prob.vars.c)
120121
updatevars!(prob)
121122
end

0 commit comments

Comments
 (0)