Skip to content

Issue with DG-SIP and FullyAssembledRows #186

Description

@amartinhuertas

When activating FullyAssembledRows assembly strategy in the DG-SIP method, e.g., in PoissonTests.jl, the code breaks during FE assembly (i.e., AffineFEOperator constructor)

The code below reproduces the issue:

module PoissonTests
using SparseMatricesCSR
using Gridap
using Gridap.Algebra
using Gridap.FESpaces
using GridapDistributed
using PartitionedArrays
using Test

function main(distribute, parts)
  ranks = distribute(LinearIndices((prod(parts),)))
  output = mkpath(joinpath(@__DIR__,"output"))

  domain = (0,4,0,4)
  cells = (4,4)
  model = CartesianDiscreteModel(ranks, parts,domain,cells)

  labels = get_face_labeling(model)
  add_tag_from_tags!(labels,"dirichlet",[1,2,3,5,7])
  add_tag_from_tags!(labels,"neumann",[4,6,8])

  Ω = Triangulation(with_ghost,model)
  Γn = Boundary(with_ghost,model,tags="neumann")
  n_Γn = get_normal_vector(Γn)

  k = 2
  u((x,y)) = (x+y)^k
  f(x) = -Δ(u,x)
  g = n_Γn(u)

  reffe = ReferenceFE(lagrangian,Float64,k)
  V = TestFESpace(model,reffe,dirichlet_tags="dirichlet")
  U = TrialFESpace(u,V)

  dΩ = Measure(Ω,2*k)
  dΓn = Measure(Γn,2*k)

  a(u,v) = ( (v)(u) )dΩ
  l(v) = ( v*f )dΩ + ( v*g )dΓn
  assem=SparseMatrixAssembler(SparseMatrixCSR{0,Float64,Int},Vector{Float64},U,V,FullyAssembledRows())
  op = AffineFEOperator(a,l,U,V,assem)

  uh = solve(op)
  eh = u - uh
  @test sqrt(sum( (abs2(eh))dΩ )) < 1.0e-9

  # Now with DG
  h = 2
  γ = 10

  V_dg = FESpace(model,reffe,conformity=:L2)
  U_dg = TrialFESpace(V_dg)

  Λ = Skeleton(with_ghost,model)
  Γd = Boundary(with_ghost,model,tags="dirichlet")

  dΛ = Measure(Λ,2*k)
  dΓd = Measure(Γd,2*k)

  n_Γd = get_normal_vector(Γd)
  n_Λ = get_normal_vector(Λ)

  a_dg(u,v) =
    ( (v)(u) )*+
    ( (γ/h)*v*u  - v*(n_Γd(u)) - (n_Γd(v))*u )*dΓd +
    ( (γ/h)*jump(v*n_Λ)jump(u*n_Λ) -
       jump(v*n_Λ)mean((u)) -
       mean((v))jump(u*n_Λ) )*l_dg(v) =
    ( v*f )*+
    ( v*g )dΓn +
    ( (γ/h)*v*u - (n_Γd(v))*u )*dΓd


  assem=SparseMatrixAssembler(U_dg,V_dg, FullyAssembledRows())
  op = AffineFEOperator(a_dg,l_dg,U_dg,V_dg,assem)
  uh = solve(op)
  eh = u - uh
  @test sqrt(sum( (abs2(eh))dΩ )) < 1.0e-9

end
end # module

when executed, e.g., as:

module PoissonTestsSeq
using PartitionedArrays
include("../PoissonTests.jl")
with_debug() do distribute
    PoissonTests.main(distribute,(2,2))
end 
end # module

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions