Skip to content

Commit fe55b74

Browse files
committed
Cleanup
1 parent 381fbbb commit fe55b74

8 files changed

Lines changed: 68 additions & 245 deletions

src/DivAndCurlConformingFESpaces.jl

Lines changed: 0 additions & 177 deletions
This file was deleted.

src/GridapDistributed.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ include("Visualization.jl")
5858

5959
include("FESpaces.jl")
6060

61-
#include("DivAndCurlConformingFESpaces.jl") # superseded by Pullbacks.jl
6261
include("Pullbacks.jl")
6362

6463
include("MultiField.jl")

test/HcurlProjectionTests.jl

Lines changed: 55 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -20,78 +20,77 @@ function get_analytical_functions(Dc)
2020
end
2121

2222
function solve_hcurl_projection(model::GridapDistributed.DistributedDiscreteModel{Dc},order) where {Dc}
23-
u_ex, f_ex=get_analytical_functions(Dc)
23+
u_ex, f_ex=get_analytical_functions(Dc)
2424

25-
V = FESpace(model,
26-
ReferenceFE(nedelec,order),
27-
conformity=:Hcurl,
28-
dirichlet_tags="boundary")
29-
30-
U = TrialFESpace(V,u_ex)
31-
32-
trian = Triangulation(model)
33-
degree = 2*(order+1)
34-
= Measure(trian,degree)
35-
36-
a(u,v) = ( (∇×u)(∇×v) + uv )dΩ
37-
l(v) = (f_exv)dΩ
25+
V = FESpace(
26+
model, ReferenceFE(nedelec,order), conformity=:Hcurl, dirichlet_tags="boundary"
27+
)
28+
29+
U = TrialFESpace(V,u_ex)
30+
31+
trian = Triangulation(model)
32+
degree = 2*(order+1)
33+
= Measure(trian,degree)
34+
35+
a(u,v) = ( (∇×u)(∇×v) + uv )dΩ
36+
l(v) = (f_exv)dΩ
3837

39-
op = AffineFEOperator(a,l,U,V)
40-
if (num_free_dofs(U)==0)
41-
# UMFPACK cannot handle empty linear systems
42-
uh = zero(U)
43-
else
44-
uh = solve(op)
45-
end
46-
uh,U
47-
end
38+
op = AffineFEOperator(a,l,U,V)
39+
if (num_free_dofs(U)==0)
40+
# UMFPACK cannot handle empty linear systems
41+
uh = zero(U)
42+
else
43+
uh = solve(op)
44+
end
45+
uh,U
46+
end
4847

49-
function check_error_hcurl_projection(model::GridapDistributed.DistributedDiscreteModel{Dc},order,uh) where {Dc}
50-
trian = Triangulation(model)
51-
degree = 2*(order+1)
52-
= Measure(trian,degree)
48+
function check_error_hcurl_projection(model::GridapDistributed.DistributedDiscreteModel{Dc},order,uh) where {Dc}
49+
trian = Triangulation(model)
50+
degree = 2*(order+1)
51+
= Measure(trian,degree)
5352

54-
u_ex, f_ex = get_analytical_functions(Dc)
55-
56-
eu = u_ex - uh
53+
u_ex, f_ex = get_analytical_functions(Dc)
54+
55+
eu = u_ex - uh
5756

58-
l2(v) = sqrt(sum((vv)*dΩ))
59-
hcurl(v) = sqrt(sum((vv + (∇×v)(∇×v))*dΩ))
60-
61-
eu_l2 = l2(eu)
62-
eu_hcurl = hcurl(eu)
63-
64-
tol = 1.0e-6
65-
@test eu_l2 < tol
66-
@test eu_hcurl < tol
57+
l2(v) = sqrt(sum((vv)*dΩ))
58+
hcurl(v) = sqrt(sum((vv + (∇×v)(∇×v))*dΩ))
59+
60+
eu_l2 = l2(eu)
61+
eu_hcurl = hcurl(eu)
62+
63+
tol = 1.0e-6
64+
@test eu_l2 < tol
65+
@test eu_hcurl < tol
6766
end
6867

69-
function test_2d(ranks,parts,order)
70-
domain = (0,1,0,1)
71-
model = CartesianDiscreteModel(ranks,parts,domain,(4,4))
72-
solve_hcurl_projection(model,order) |> x -> check_error_hcurl_projection(model,order,x[1])
73-
end
68+
function test_2d(ranks,parts,order)
69+
domain = (0,1,0,1)
70+
model = CartesianDiscreteModel(ranks,parts,domain,(4,4))
71+
solve_hcurl_projection(model,order) |> x -> check_error_hcurl_projection(model,order,x[1])
72+
end
7473

75-
function test_3d(ranks,parts,order)
76-
domain = (0,1,0,1,0,1)
77-
model = CartesianDiscreteModel(ranks,parts,domain,(4,4,4))
78-
solve_hcurl_projection(model,order) |> x -> check_error_hcurl_projection(model,order,x[1])
79-
end
74+
function test_3d(ranks,parts,order)
75+
domain = (0,1,0,1,0,1)
76+
model = CartesianDiscreteModel(ranks,parts,domain,(4,4,4))
77+
solve_hcurl_projection(model,order) |> x -> check_error_hcurl_projection(model,order,x[1])
78+
end
8079

8180
function main(distribute,parts)
8281
ranks = distribute(LinearIndices((prod(parts),)))
8382

8483
if length(parts)==2
85-
for order=0:2
86-
test_2d(ranks,parts,order)
87-
end
84+
for order=0:2
85+
test_2d(ranks,parts,order)
86+
end
8887
elseif length(parts)==3
89-
for order=0:2
90-
test_3d(ranks,parts,order)
91-
end
88+
for order=0:2
89+
test_3d(ranks,parts,order)
90+
end
9291
else
9392
@assert false
9493
end
9594
end
96-
95+
9796
end #module
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module DivAndCurlConformingTests
1+
module PullbackTests
22
using SparseMatricesCSR
33

44
using Gridap

test/sequential/DivAndCurlConformingTests.jl

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/sequential/FESpacesTests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
module FESpacesTestsSeq
22
using PartitionedArrays
3+
34
include("../FESpacesTests.jl")
45
with_debug() do distribute
56
FESpacesTests.main(distribute,(2,2))
67
end
8+
79
end # module

test/sequential/PullbackTests.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module PullbackTestsSeq
2+
using PartitionedArrays
3+
4+
include("../PullbackTests.jl")
5+
with_debug() do distribute
6+
PullbackTests.main(distribute,2)
7+
end
8+
9+
end # module

test/sequential/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ end
1111

1212
if TESTCASE ("all", "seq-fespaces")
1313
@time @testset "FESpaces" begin include("FESpacesTests.jl") end
14+
@time @testset "Pullbacks" begin include("PullbackTests.jl") end
1415
@time @testset "MultiField" begin include("MultiFieldTests.jl") end
1516
@time @testset "issue_142" begin include("issue_142.jl") end
1617
@time @testset "ZeroMeanFESpaces" begin include("ZeroMeanFESpacesTests.jl") end
@@ -20,7 +21,6 @@ end
2021
if TESTCASE ("all", "seq-physics")
2122
@time @testset "Poisson" begin include("PoissonTests.jl") end
2223
@time @testset "PLaplacian" begin include("PLaplacianTests.jl") end
23-
@time @testset "DivAndCurlConformingTests" begin include("DivAndCurlConformingTests.jl") end
2424
@time @testset "SurfaceCouplingTests" begin include("SurfaceCouplingTests.jl") end
2525
@time @testset "StokesHdivDGTests" begin include("StokesHdivDGTests.jl") end
2626
@time @testset "StokesOpenBoundary" begin include("StokesOpenBoundaryTests.jl") end

0 commit comments

Comments
 (0)