Skip to content

Commit

Permalink
fix switch
Browse files Browse the repository at this point in the history
  • Loading branch information
xtalax committed Jan 4, 2024
1 parent 1cd8076 commit 1299565
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/loss_function_generation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ function parse_equation(pinnrep::PINNRepresentation, term, ivs; is_integral = fa
sym_coords = DestructuredArgs(ivs)
ps = DestructuredArgs(varmap.ps)


args = [sym_coords, θ_SYMBOL, phi, ps]

ex = Func(args, [], expr) |> toexpr |> _dot_
Expand All @@ -137,12 +136,13 @@ function generate_derivative_rules(term, eqdata, eltypeθ, dummyvars, derivative
end

dvs = get_depvars(term, varmap.depvar_ops)
ivs = get_indvars(term, v)
@show eltypeθ
@show methods(derivative)
# Orthodox derivatives
n(w) = length(arguments(w))
rs = reduce(vcat, [reduce(vcat, [[@rule $((Differential(x)^d)(w)) =>
derivative(ufunc(w, phi, varmap), reducevcat(arguments(w), eltypeθ),
derivative(ufunc(w, phi, varmap), reducevcat(arguments(w), eltypeθ, switch),
[get_ε(n(w),
j, eltypeθ, i) for i in 1:d],
d, θ)
Expand All @@ -159,7 +159,7 @@ function generate_derivative_rules(term, eqdata, eltypeθ, dummyvars, derivative
ε1 = [get_ε(n(w), j, eltypeθ, i) for i in 1:2]
ε2 = [get_ε(n(w), k, eltypeθ, i) for i in 1:2]
[@rule $((Differential(x))((Differential(y))(w))) =>
derivative((coord_, θ_) -> derivative(ufunc(w, phi, varmap), reducevcat(arguments(w), eltypeθ),
derivative((coord_, θ_) -> derivative(ufunc(w, phi, varmap), reducevcat(arguments(w), eltypeθ, switch),
ε2, 1, θ_),
reducevcat(arguments(w), eltypeθ), ε1, 1, θ)]
end
Expand Down

0 comments on commit 1299565

Please sign in to comment.