Skip to content

Commit 0a5776b

Browse files
committed
Minor fixes in Project.toml and FESpacesTests.jl
1 parent 862af4a commit 0a5776b

File tree

2 files changed

+18
-32
lines changed

2 files changed

+18
-32
lines changed

Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9"
1212
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1313

1414
[compat]
15+
FillArrays = "0.8.4, 0.9, 0.10, 0.11, 0.12"
1516
Gridap = "0.17"
17+
MPI = "0.16, 0.17, 0.18, 0.19"
18+
PartitionedArrays = "0.2"
1619
julia = "1.3"
1720

1821
[extras]

test/FESpacesTests.jl

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ using GridapDistributed
77
using PartitionedArrays
88
using Test
99

10-
function test_fe_spaces(parts,das)
10+
function main(parts)
11+
main(parts,SubAssembledRows())
12+
main(parts,FullyAssembledRows())
13+
end
14+
15+
function main(parts,das)
1116
output = mkpath(joinpath(@__DIR__,"output"))
1217

1318
domain = (0,4,0,4)
1419
cells = (4,4)
1520
model = CartesianDiscreteModel(parts,domain,cells)
16-
Ω = Boundary(model)
21+
Ω = Triangulation(model)
1722
Γ = Boundary(model)
1823

1924
u((x,y)) = x+y
@@ -29,9 +34,8 @@ function test_fe_spaces(parts,das)
2934
uh = interpolate(u,U)
3035
eh = u - uh
3136

32-
Ωint = Triangulation(no_ghost,model)
33-
dΩint = Measure(Ωint,3)
34-
cont = ( abs2(eh) )dΩint
37+
= Measure(Ω,3)
38+
cont = ( abs2(eh) )dΩ
3539
@test sqrt(sum(cont)) < 1.0e-9
3640

3741
# Assembly
@@ -49,10 +53,10 @@ function test_fe_spaces(parts,das)
4953
r1 = A1*x1 -b1
5054
uh1 = FEFunction(U,x1)
5155
eh1 = u - uh1
52-
@test sqrt(sum(( abs2(eh1) )dΩint)) < 1.0e-9
56+
@test sqrt(sum(( abs2(eh1) ))) < 1.0e-9
5357

5458
writevtk(Ω,joinpath(output,"Ω"), nsubcells=10,
55-
celldata=["err"=>cont[Ωint]],
59+
celldata=["err"=>cont[Ω]],
5660
cellfields=["uh"=>uh,"zh"=>zh,"eh"=>eh])
5761

5862
writevtk(Γ,joinpath(output,"Γ"),cellfields=["uh"=>uh])
@@ -63,43 +67,27 @@ function test_fe_spaces(parts,das)
6367
r2 = A2*x2 -b2
6468
uh = FEFunction(U,x2)
6569
eh2 = u - uh
66-
sqrt(sum(( abs2(eh2) )dΩint)) < 1.0e-9
70+
sqrt(sum(( abs2(eh2) ))) < 1.0e-9
6771

6872
op = AffineFEOperator(a,l,U,V,das)
6973
solver = LinearFESolver(BackslashSolver())
7074
uh = solve(solver,op)
7175
eh = u - uh
72-
@test sqrt(sum(( abs2(eh) )dΩint)) < 1.0e-9
76+
@test sqrt(sum(( abs2(eh) ))) < 1.0e-9
7377

7478
data = collect_cell_matrix(U,V,a(du,dv))
7579
A3 = assemble_matrix(assem,data)
7680
x3 = A3\op.op.vector
7781
uh = FEFunction(U,x3)
7882
eh3 = u - uh
79-
sqrt(sum(( abs2(eh3) )dΩint)) < 1.0e-9
83+
sqrt(sum(( abs2(eh3) ))) < 1.0e-9
8084

8185
A4 = allocate_matrix(assem,data)
8286
assemble_matrix!(A4,assem,data)
8387
x4 = A4\op.op.vector
8488
uh = FEFunction(U,x4)
8589
eh4 = u - uh
86-
sqrt(sum(( abs2(eh4) )dΩint)) < 1.0e-9
87-
88-
al(u,v) = ( (v)(u) )dΩass
89-
ll(v) = ( 0*v )dΩass
90-
91-
data = collect_cell_matrix_and_vector(U,V,al(du,dv),ll(dv),zh)
92-
A,b = assemble_matrix_and_vector(assem,data)
93-
x = A\b
94-
r = A*x -b
95-
uh = FEFunction(U,x)
96-
eh = u - uh
97-
@test sqrt(sum(( abs2(eh) )dΩint)) < 1.0e-9
98-
99-
op = AffineFEOperator(al,ll,U,V,das)
100-
uh = solve(solver,op)
101-
eh = u - uh
102-
@test sqrt(sum(( abs2(eh) )dΩint)) < 1.0e-9
90+
sqrt(sum(( abs2(eh4) )dΩ)) < 1.0e-9
10391

10492
dv = get_fe_basis(V)
10593
l=(1*dv)dΩass
@@ -114,9 +102,4 @@ function test_fe_spaces(parts,das)
114102

115103
end
116104

117-
function main(parts)
118-
test_fe_spaces(parts,SubAssembledRows())
119-
test_fe_spaces(parts,FullyAssembledRows())
120-
end
121-
122105
end # module

0 commit comments

Comments
 (0)