Skip to content

Commit

Permalink
Added temp dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Mar 5, 2025
1 parent 28d4404 commit 921a96c
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 39 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.8'
- '1.10'
os:
- ubuntu-latest
arch:
Expand All @@ -33,7 +33,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.8'
- '1.10'
os:
- ubuntu-latest
arch:
Expand All @@ -59,7 +59,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.8'
- '1.10'
os:
- ubuntu-latest
arch:
Expand All @@ -85,7 +85,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1.8'
version: '1.10'
- run: |
julia --project=docs -e '
using Pkg
Expand Down
3 changes: 2 additions & 1 deletion test/AgFEMTests/PeriodicAgFEMSpacesTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ U = TrialFESpace(Vagg)
v(x) = (x[1]-0.5)^2 + (x[2]-0.5)^2
vhagg = interpolate(v,Vagg)

writevtk(Ω_ac,"test",cellfields=["v"=>vhagg])
path = mktempdir()
writevtk(Ω_ac,joinpath(path,"test"),cellfields=["v"=>vhagg])

tol = 10e-7
@test sum( (abs2(v-vhagg))dΩ ) < tol
Expand Down
5 changes: 3 additions & 2 deletions test/AlgoimUtilsTests/VisualizationTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ module VisualizationTests
vquad = Quadrature(algoim,phi,degree,phase=IN)
_,dΩ = TriangulationAndMeasure(Ω,vquad)

writevtk(dΓ,"res_sur",cellfields=["f"=>fₕ],qhulltype=convexhull)
writevtk([dΩ,dΓ],"res_vol",cellfields=["f"=>fₕ])
path = mktempdir()
writevtk(dΓ,joinpath(path,"res_sur"),cellfields=["f"=>fₕ],qhulltype=convexhull)
writevtk([dΩ,dΓ],joinpath("res_vol"),cellfields=["f"=>fₕ])

end # module
9 changes: 4 additions & 5 deletions test/DistributedTests/AggregationTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ bgf_to_ioc = compute_bgfacet_to_inoutcut(bgmodel,geo)

Ω = Triangulation(cutgeo)

writevtk(Ω,"trian")

strategy = AggregateCutCellsByThreshold(1.0)
aggregates,aggregate_owner,aggregate_neig = distributed_aggregate(
strategy,cutgeo,geo,IN)
Expand Down Expand Up @@ -74,9 +72,10 @@ end
Ωin = Triangulation(cutgeo,IN)
Γ = EmbeddedBoundary(cutgeo)

writevtk(Ωin,"trian_in")
writevtk(Γ,"bnd")
writevtk(Ωbg,"bgtrian",celldata=
path = mktempdir()
writevtk(Ωin,joinpath(path,"trian_in"))
writevtk(Γ,joinpath(path,"bnd"))
writevtk(Ωbg,joinpath(path,"bgtrian"),celldata=
["aggregate"=>oaggregates,
"aggregate_owner"=>oaggregate_owner])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,16 @@ function main(distribute,parts;
map(Reindex(col),oid)
end

writevtk(Ω_bg,"trian",
path = mktempdir()
writevtk(Ω_bg,joinpath(path,"trian"),
celldata=[
"aggregate"=>own_aggregates,
"color"=>own_colors,
"gid"=>own_to_global(gids)])#,
# cellfields=["uh"=>uh])

writevtk(Ω,"trian_O",cellfields=["uh"=>uh])
writevtk(Γ,"trian_G")
writevtk(Ω,joinpath(path,"trian_O"),cellfields=["uh"=>uh])
writevtk(Γ,joinpath(path,"trian_G"))
@test el2/ul2 < 1.e-8
@test eh1/uh1 < 1.e-7

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,16 @@ function main(distribute,parts;
map(Reindex(col),oid)
end

writevtk(Ω_bg,"trian",
path = mktempdir()
writevtk(Ω_bg,joinpath(path,"trian"),
celldata=[
"aggregate"=>own_aggregates,
"color"=>own_colors,
"gid"=>own_to_global(gids)])#,
# cellfields=["uh"=>uh])

writevtk(Ω,"trian_O",cellfields=["uh"=>uh])
writevtk(Γ,"trian_G")
writevtk(Ω,joinpath(path,"trian_O"),cellfields=["uh"=>uh])
writevtk(Γ,joinpath(path,"trian_G"))
@test el2/ul2 < 1.e-8
@test eh1/uh1 < 1.e-7

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,16 @@ function main(distribute,parts;
map(Reindex(col),oid)
end

writevtk(Ω_bg,"trian",
path = mktempdir()
writevtk(Ω_bg,joinpath(path,"trian"),
celldata=[
"aggregate"=>own_aggregates,
"color"=>own_colors,
"gid"=>own_to_global(gids)])#,
# cellfields=["uh"=>uh])

writevtk(Ω,"trian_O",cellfields=["uh"=>uh])
writevtk(Γ,"trian_G")
writevtk(Ω,joinpath(path,"trian_O"),cellfields=["uh"=>uh])
writevtk(Γ,joinpath(path,"trian_G"))
@test el2/ul2 < 1.e-8
@test eh1/uh1 < 1.e-7

Expand Down
7 changes: 4 additions & 3 deletions test/DistributedTests/PoissonTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@ function main(distribute,parts;
map(Reindex(col),oid)
end

writevtk(Ω_bg,"trian",
path = mktempdir()
writevtk(Ω_bg,joinpath(path,"trian"),
celldata=[
"aggregate"=>own_aggregates,
"color"=>own_colors,
"gid"=>own_to_global(gids)])#,
# cellfields=["uh"=>uh])

writevtk(Ω,"trian_O",cellfields=["uh"=>uh,"eh"=>e])
writevtk(Γ,"trian_G")
writevtk(Ω,joinpath(path,"trian_O"),cellfields=["uh"=>uh,"eh"=>e])
writevtk(Γ,joinpath(path,"trian_G"))
@test el2/ul2 < 1.e-8
@test eh1/uh1 < 1.e-7

Expand Down
10 changes: 5 additions & 5 deletions test/DistributedTests/mpi/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ using MPI
#Sysimage
sysimage=nothing
if length(ARGS)==1
@assert isfile(ARGS[1]) "$(ARGS[1]) must be a valid Julia sysimage file"
sysimage=ARGS[1]
@assert isfile(ARGS[1]) "$(ARGS[1]) must be a valid Julia sysimage file"
sysimage=ARGS[1]
end

mpidir = @__DIR__
Expand All @@ -17,10 +17,10 @@ repodir = joinpath(testdir,"..","..")
function run_driver(procs,file,sysimage)
mpiexec() do cmd
if sysimage!=nothing
extra_args="-J$(sysimage)"
run(`$cmd -n $procs $(Base.julia_cmd()) $(extra_args) --project=$repodir $(joinpath(mpidir,file))`)
extra_args="-J$(sysimage)"
run(`$cmd -n $procs $(Base.julia_cmd()) $(extra_args) --project=$repodir $(joinpath(mpidir,file))`)
else
run(`$cmd -n $procs $(Base.julia_cmd()) --project=$repodir $(joinpath(mpidir,file))`)
run(`$cmd -n $procs $(Base.julia_cmd()) --project=$repodir $(joinpath(mpidir,file))`)
end
@test true
end
Expand Down
13 changes: 7 additions & 6 deletions test/DistributedTests/testing_remote_no_aggs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,19 @@ uh1 = h1(uh)
Γ = EmbeddedBoundary(cutgeo)
Ωbg = Triangulation(bgmodel)

writevtk(Ω,"trian");
writevtk(Γ,"bnd");
writevtk(Ωbg,"bg_trian");
writevtk(Ω_act,"act_trian");
path = mktempdir()
writevtk(Ω,joinpath(path,"trian"));
writevtk(Γ,joinpath(path,"bnd"));
writevtk(Ωbg,joinpath(path,"bg_trian"));
writevtk(Ω_act,joinpath(path,"act_trian"));

writevtk(Ω,"trian",
writevtk(Ω,joinpath(path,"trian"),
cellfields=["uh"=>uh,"u"=>u,"e"=>e],);


map(local_views(uh),local_views(bgmodel),ranks) do uh,m,p
trian = Triangulation(m)
writevtk(trian,"ltrian_$p",cellfields=["uh"=>uh])
writevtk(trian,joinpath(path,"ltrian_$p"),cellfields=["uh"=>uh])
end

end # module
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ uh1, uh2 = solve(op)
uh = (uh1,uh2)

# Postprocess
path = mktempdir()
qh1 = α1*(uh1)
qh2 = α2*(uh2)
writevtk(Ω1,"results1",cellfields=["uh"=>uh1,"qh"=>qh1])
writevtk(Ω2,"results2",cellfields=["uh"=>uh2,"qh"=>qh2])
writevtk(Ω1,joinpath(path,"results1"),cellfields=["uh"=>uh1,"qh"=>qh1])
writevtk(Ω2,joinpath(path,"results2"),cellfields=["uh"=>uh2,"qh"=>qh2])

#writevtk(model1,"model1")
#writevtk(model2,"model2")
Expand Down
2 changes: 0 additions & 2 deletions test/GridapEmbeddedTests/TraceFEMTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ cutgeom = cut(bgmodel,geom)
Γ = EmbeddedBoundary(cutgeom,geom)
Γg = GhostSkeleton(cutgeom,CUT,geom)

writevtk(Γg,"Γg")

order=1
V = TestFESpace(Ωc,ReferenceFE(lagrangian,Float64,order),conformity=:H1)
U = TrialFESpace(V)
Expand Down

0 comments on commit 921a96c

Please sign in to comment.