GridapEmbedded.jl icon indicating copy to clipboard operation
GridapEmbedded.jl copied to clipboard

Bounds Error when no cut cells are present

Open diliphridya opened this issue 5 years ago • 2 comments

@fverdugo @santiagobadia If we consider the following code

using Gridap
using GridapEmbedded
using Gridap.ReferenceFEs

u(x) = x[1] + x[2]
f(x) = 0.0

bgdomain = (0,1,0,1)
n = 10
partition = (n,n)
bgmodel = CartesianDiscreteModel(bgdomain,partition)

geo = square(L=0.8,x0=Point(0.5,0.5))
cutgeo = cut(bgmodel,geo)
model = DiscreteModel(cutgeo)

strategy = AggregateCutCellsByThreshold(1.0)
aggregates = aggregate(strategy,cutgeo) 

T = Float64
order = 1
reffe = LagrangianRefFE(T,QUAD,order)
V0 = TestFESpace(reffe=reffe, model=model,dof_space=:physical)
V = AgFEMSpace(V0,aggregates)
U = TrialFESpace(V)

Here, all cells are well-posed (no cut cells). image

We can see an error BoundsError: attempt to access 81-element Array{Int32,1} at index [0] in the line V = AgFEMSpace(V0,aggregates).

diliphridya avatar Nov 25 '20 08:11 diliphridya

Hi @diliphridya it seems a bug that shows up for the degenerated case of 0-cut cells. Since in this case, you don't need aggregation at all, it should be easy to fix.

fverdugo avatar Nov 25 '20 08:11 fverdugo

Thanks @fverdugo . I will have a look at it.

diliphridya avatar Nov 25 '20 08:11 diliphridya