Skip to content

Commit

Permalink
Adding test to reproduce issue #142
Browse files Browse the repository at this point in the history
  • Loading branch information
amartinhuertas committed Jan 27, 2024
1 parent b30c808 commit ca90f96
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/issue_142.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Gridap
using PartitionedArrays
using GridapDistributed
using Test

function main(distribute,rank_partition)
DX = 1000.0
DY = 1000.0
order = 0
n_els_x = 4
n_els_y = 4
dx = DX/n_els_x
domain = (0,DX,0,DY)
cell_partition = (n_els_x,n_els_y)
ranks = distribute(LinearIndices((prod(rank_partition),)))

model = CartesianDiscreteModel(ranks,rank_partition,domain,cell_partition; isperiodic=(false,false))
Ω = Triangulation(model)
= Measure(Ω, 5*(order+1))
Γ = SkeletonTriangulation(model)
= Measure(Γ, 5*(order+1))

Q = FESpace(model, ReferenceFE(lagrangian, Float64, order), conformity=:L2)
P = TrialFESpace(Q)

# initial conditions
ph=FEFunction(P,prand(partition(Q.gids)))

b(q) = (jump(ph)*mean(q))dΓ
m(p,q) = (p*q)dΩ
op = AffineFEOperator(m, b, P, Q)
b=assemble_vector(b(get_fe_basis(Q)),P)
tol=1.0e-12
@test norm(op.op.vector-b)/norm(b) < tol
end
4 changes: 4 additions & 0 deletions test/sequential/issue_142.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include("../issue_142.jl")
with_debug() do distribute
main(distribute,(2,1))
end
2 changes: 2 additions & 0 deletions test/sequential/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ using Test

@time @testset "MultiField" begin include("MultiFieldTests.jl") end

@time @testset "issue_142" begin include("issue_142.jl") end

@time @testset "Poisson" begin include("PoissonTests.jl") end

@time @testset "PLaplacian" begin include("PLaplacianTests.jl") end
Expand Down

0 comments on commit ca90f96

Please sign in to comment.