Skip to content

Commit

Permalink
update BPINN_PDE_tests.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
AstitvaAggarwal committed Oct 31, 2024
1 parent 6b03ea1 commit 9dbea52
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions test/BPINN_PDE_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -352,25 +352,6 @@ end
# @test sum(abs, pmean(p_[2]) - (8 / 3)) < 0.3 * idealp[2]
end

function recur_expression(exp, Dict_differentials)
for in_exp in exp.args
if !(in_exp isa Expr)
# skip +,== symbols, characters etc
continue

elseif in_exp.args[1] isa ModelingToolkit.Differential
# first symbol of differential term
# Dict_differentials for masking differential terms
# and resubstituting differentials in equations after putting in interpolations
# temp = in_exp.args[end]
Dict_differentials[eval(in_exp)] = Symbolics.variable("diff_$(length(Dict_differentials) + 1)")
return
else
recur_expression(in_exp, Dict_differentials)
end
end
end

@testitem "BPINN PDE Inv III: Improved Parametric Kuromo-Sivashinsky Equation solve" tags=[:pdebpinn] begin
using MCMCChains, Lux, ModelingToolkit, Distributions, OrdinaryDiffEq,
AdvancedHMC, Statistics, Random, Functors, NeuralPDE, MonteCarloMeasurements,
Expand All @@ -379,6 +360,25 @@ end

Random.seed!(100)

function recur_expression(exp, Dict_differentials)
for in_exp in exp.args
if !(in_exp isa Expr)
# skip +,== symbols, characters etc
continue

elseif in_exp.args[1] isa ModelingToolkit.Differential
# first symbol of differential term
# Dict_differentials for masking differential terms
# and resubstituting differentials in equations after putting in interpolations
# temp = in_exp.args[end]
Dict_differentials[eval(in_exp)] = Symbolics.variable("diff_$(length(Dict_differentials) + 1)")
return
else
recur_expression(in_exp, Dict_differentials)
end
end
end

@parameters x, t, α
@variables u(..)
Dt = Differential(t)
Expand Down

0 comments on commit 9dbea52

Please sign in to comment.