You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2023. It is now read-only.
#q is given by bc*u , u being the unknown function
33
36
#p is given as some function of q , p being the diffusion coefficient
34
37
35
38
@assert approx_order>1"approximation_order must be greater than 1."
36
39
if first_differential_order >0
37
-
du .= (CenteredDifference(first_differential_order,approx_order,dx,nknots)*q).*(CenteredDifference(second_differential_order,approx_order,dx,nknots)*p)
40
+
du .= (CenteredDifference{N}(first_differential_order,approx_order,dx,nknots)*q).*(CenteredDifference{N}(second_differential_order,approx_order,dx,nknots)*p)
38
41
else
39
-
du .= q[2:(nknots +1)].*(CenteredDifference(second_differential_order,approx_order,dx,nknots)*p)
42
+
du .= q[2:(nknots +1)].*(CenteredDifference{N}(second_differential_order,approx_order,dx,nknots)*p)
40
43
end
41
44
42
45
for l =1:(second_differential_order -1)
43
-
du .= du .+binomial(second_differential_order,l)*(CenteredDifference(l + first_differential_order,approx_order,dx,nknots)*q).*(CenteredDifference(second_differential_order - l,approx_order,dx,nknots)*p)
46
+
du .= du .+binomial(second_differential_order,l)*(CenteredDifference{N}(l + first_differential_order,approx_order,dx,nknots)*q).*(CenteredDifference{N}(second_differential_order - l,approx_order,dx,nknots)*p)
44
47
end
45
48
46
-
du .= du .+ (CenteredDifference(first_differential_order + second_differential_order,approx_order,dx,nknots)*q).*p[2:(nknots +1)]
49
+
du .= du .+ (CenteredDifference{N}(first_differential_order + second_differential_order,approx_order,dx,nknots)*q).*p[2:(nknots +1)]
47
50
48
51
end
49
52
50
53
# An out of place workaround for the mutating version
0 commit comments