diff --git a/Project.toml b/Project.toml index 6e4aa22..2307490 100644 --- a/Project.toml +++ b/Project.toml @@ -24,6 +24,7 @@ SciMLBase = "1.88" julia = "1.6" [extras] +NeuralPDE = "315f7962-48a3-4962-8226-d0f33b1235f0" Lux = "b2108857-7c20-44ae-9111-449ecde12c47" MethodOfLines = "94925ecb-adb7-4558-8ed8-f975c56a0bf4" NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" @@ -32,4 +33,4 @@ SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test", "MethodOfLines", "Lux", "NonlinearSolve", "OptimizationOptimJL", "SafeTestsets"] +test = ["Test", "MethodOfLines", "NeuralPDE", "Lux", "NonlinearSolve", "OptimizationOptimJL", "SafeTestsets"] diff --git a/test/neuralpde_test.jl b/test/neuralpde_test.jl index ffdb643..f9ee679 100644 --- a/test/neuralpde_test.jl +++ b/test/neuralpde_test.jl @@ -4,7 +4,7 @@ PSL = PDESystemLibrary using NeuralPDE, Lux, OptimizationOptimJL for ex in PSL.all_systems - @testset "Example with NeuralPDE.jl: $(ex.name)\n Equations: $(ex.eqs) \nBCs/ICs: $(ex.bcs)" begin + @testset "Example with NeuralPDE.jl: $(ex.name)" begin dim = length(ex.ivs) # number of dimensions N = 8 * dim chain = Lux.Chain(Dense(dim, N, Lux.σ), Dense(N, N, Lux.σ), Dense(N, 1)) @@ -13,8 +13,7 @@ for ex in PSL.all_systems dx = 0.05 discretization = PhysicsInformedNN(chain, GridTraining(dx)) - @named pde_system = PDESystem(eq, bcs, domains, [x, y], [u(x, y)]) - prob = discretize(pde_system, discretization) + prob = discretize(ex, discretization) #Optimizer opt = OptimizationOptimJL.BFGS() @@ -25,7 +24,7 @@ for ex in PSL.all_systems return false end - res = Optimization.solve(prob, opt, callback = callback, maxiters = 1000) + res = Optimization.solve(prob, opt, callback = callback, maxiters = 400) phi = discretization.phi end end diff --git a/test/runtests.jl b/test/runtests.jl index 2fa4b48..3389c19 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -11,6 +11,6 @@ end # TODO: fix this when NeuralPDE.jl can be added to the test environment. (compat with Symbolics.jl 5) -# if GROUP == "All" || GROUP == "NeuralPDE" -# @time @safetestset "Test against NeuralPDE.jl" begin include("neuralpde_test.jl") end -# end +if GROUP == "All" || GROUP == "NeuralPDE" + @time @safetestset "Test against NeuralPDE.jl" begin include("neuralpde_test.jl") end +end