Skip to content

Commit

Permalink
test: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 17, 2024
1 parent 3a15a59 commit 4dcf272
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions test/IDE_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ end
res = solve(prob, BFGS(); callback, maxiters = 100)
xs = [infimum(d.domain):0.01:supremum(d.domain) for d in domains][1]
phi = discretization.phi
analytic_sol_func(x) = @. cospi(5x) * x

u_real = [analytic_sol_func(x) for x in xs]
u_real = [x^2 / cos(x) for x in xs]
u_predict = [first(phi([x], res.u)) for x in xs]
@test mean(abs2, u_real .- u_predict) < 0.01
end
Expand Down Expand Up @@ -94,6 +93,7 @@ end
@named pde_system = PDESystem(eq, bcs, domains, [x, y], [u(x, y)])
prob = discretize(pde_system, discretization)
res = solve(prob, BFGS(); callback, maxiters = 100)
phi = discretization.phi

xs = 0.0:0.01:1.0
ys = 0.0:0.01:1.0
Expand Down Expand Up @@ -126,6 +126,7 @@ end
@named pde_system = PDESystem(eq, bcs, domains, [x, y], [u(x, y)])
prob = discretize(pde_system, discretization)
res = solve(prob, BFGS(); callback, maxiters = 100)
phi = discretization.phi

xs = 0.0:0.01:1.0
ys = 0.0:0.01:1.0
Expand Down
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using ReTestItems, InteractiveUtils, Hwloc

@info sprint(versioninfo)

const GROUP = get(ENV, "GROUP", "all")
const GROUP = lowercase(get(ENV, "GROUP", "all"))

const RETESTITEMS_NWORKERS = parse(
Int, get(ENV, "RETESTITEMS_NWORKERS", string(min(Hwloc.num_physical_cores(), 4))))
Expand All @@ -12,6 +12,9 @@ const RETESTITEMS_NWORKER_THREADS = parse(Int,

using NeuralPDE

@info "Running tests with $(RETESTITEMS_NWORKERS) workers and \
$(RETESTITEMS_NWORKER_THREADS) threads for group $(GROUP)"

ReTestItems.runtests(NeuralPDE; tags = (GROUP == "all" ? nothing : [Symbol(GROUP)]),
nworkers = RETESTITEMS_NWORKERS,
nworker_threads = RETESTITEMS_NWORKER_THREADS, testitem_timeout = 3600)

0 comments on commit 4dcf272

Please sign in to comment.