Skip to content

Commit 5b82674

Browse files
authored
Merge pull request #21 from WIAS-PDELib/bugfixes
version bump to 1.0, several bugfixes and improvements: -kwargs in RTK and BDM2 interpolators -regions in integrate methods are recognized + proper dosctrings -TangentFlux operator for H1 functions -CellDofsParents for broken spaces should construct correctly now -FEEvaluator can use dofgrid (default) instead of xgrid now -get_coefficients and get_basissubset now have an additional xgrid argument (the assembly grid, which might be FE.dofgrid or FE.xgrid)
2 parents f2e167e + b797c77 commit 5b82674

19 files changed

+214
-141
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# CHANGES
22

3-
## next version
3+
## v1.0.0
44
- doc improvements
5+
- several bugfixes regarding finite elements defined on subgrids
6+
- integrate now reacts on regions parameter and has proper docstrings
57

68
## v0.8.1 November 5, 2024
79
- fixed dimension in nodevals output (xdim was determined wrongly and caused huge arrays)

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ExtendableFEMBase"
22
uuid = "12fb9182-3d4c-4424-8fd1-727a0899810c"
33
authors = ["Christian Merdon <[email protected]>"]
4-
version = "0.8.1"
4+
version = "1.0.0"
55

66
[deps]
77
DiffResults = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"

src/dofmaps.jl

+62-62
Original file line numberDiff line numberDiff line change
@@ -476,59 +476,86 @@ function init_dofmap_from_pattern!(FES::FESpace{Tv, Ti, FEType, APT}, DM::Type{<
476476
colstarts[end] = dofmap_totallength + 1
477477

478478
if FES.broken
479-
FES[DM] = SerialVariableTargetAdjacency(colstarts)
480-
return FES[DM]
481-
end
482-
483-
colentries = zeros(Ti, dofmap_totallength)
484-
xItemDofs = VariableTargetAdjacency{Ti}(colentries, colstarts)
479+
xItemDofs = SerialVariableTargetAdjacency(colstarts)
480+
else
485481

486-
cpattern::Array{DofMapPatternSegment, 1} = dofmap4EG[1].segments
487-
l::Int = 0
488-
offset::Int = 0
489-
pos::Int = 0
490-
q::Int = 0
491-
item_with_interiordofs::Int = 0
492-
for subitem in 1:nsubitems
493-
itemEG = xItemGeometries[subitem]
494-
item = sub2sup(subitem)
495-
if length(EG) > 1
496-
iEG = findfirst(isequal(itemEG), EG)
497-
end
498-
cpattern = dofmap4EG[iEG].segments
499-
l = length(cpattern)
500-
if has_interiordofs[iEG]
501-
item_with_interiordofs += 1
502-
end
503-
for c in 1:ncomponents
504-
offset = (c - 1) * offset4component
505-
for k in 1:l
506-
q = cpattern[k].ndofs
507-
if cpattern[k].type <: DofTypeNode && cpattern[k].each_component
508-
for n in 1:nnodes4EG[iEG]
482+
colentries = zeros(Ti, dofmap_totallength)
483+
xItemDofs = VariableTargetAdjacency{Ti}(colentries, colstarts)
484+
485+
cpattern::Array{DofMapPatternSegment, 1} = dofmap4EG[1].segments
486+
l::Int = 0
487+
offset::Int = 0
488+
pos::Int = 0
489+
q::Int = 0
490+
item_with_interiordofs::Int = 0
491+
for subitem in 1:nsubitems
492+
itemEG = xItemGeometries[subitem]
493+
item = sub2sup(subitem)
494+
if length(EG) > 1
495+
iEG = findfirst(isequal(itemEG), EG)
496+
end
497+
cpattern = dofmap4EG[iEG].segments
498+
l = length(cpattern)
499+
if has_interiordofs[iEG]
500+
item_with_interiordofs += 1
501+
end
502+
for c in 1:ncomponents
503+
offset = (c - 1) * offset4component
504+
for k in 1:l
505+
q = cpattern[k].ndofs
506+
if cpattern[k].type <: DofTypeNode && cpattern[k].each_component
507+
for n in 1:nnodes4EG[iEG]
508+
for m in 1:q
509+
pos += 1
510+
xItemDofs.colentries[pos] = xItemNodes[n, item] + offset + (m - 1) * nnodes
511+
end
512+
end
513+
offset += nnodes * q
514+
elseif cpattern[k].type <: DofTypeFace && cpattern[k].each_component
515+
for n in 1:nfaces4EG[iEG]
516+
for m in 1:q
517+
pos += 1
518+
xItemDofs.colentries[pos] = xItemFaces[n, item] + offset + (m - 1) * nfaces
519+
end
520+
end
521+
offset += nfaces * q
522+
elseif cpattern[k].type <: DofTypeEdge && cpattern[k].each_component
523+
for n in 1:nedges4EG[iEG]
524+
for m in 1:q
525+
pos += 1
526+
xItemDofs.colentries[pos] = xItemEdges[n, item] + offset + (m - 1) * nedges
527+
end
528+
end
529+
offset += nedges * q
530+
elseif cpattern[k].type <: DofTypeInterior && cpattern[k].each_component
509531
for m in 1:q
510532
pos += 1
511-
xItemDofs.colentries[pos] = xItemNodes[n, item] + offset + (m - 1) * nnodes
533+
xItemDofs.colentries[pos] = sub2sup(item_with_interiordofs) + offset
534+
offset += nitems
512535
end
513536
end
514-
offset += nnodes * q
515-
elseif cpattern[k].type <: DofTypeFace && cpattern[k].each_component
537+
end
538+
end
539+
offset = ncomponents * offset4component
540+
for k in 1:l
541+
q = cpattern[k].ndofs
542+
if cpattern[k].type <: DofTypeFace && !cpattern[k].each_component
516543
for n in 1:nfaces4EG[iEG]
517544
for m in 1:q
518545
pos += 1
519546
xItemDofs.colentries[pos] = xItemFaces[n, item] + offset + (m - 1) * nfaces
520547
end
521548
end
522549
offset += nfaces * q
523-
elseif cpattern[k].type <: DofTypeEdge && cpattern[k].each_component
550+
elseif cpattern[k].type <: DofTypeEdge && !cpattern[k].each_component
524551
for n in 1:nedges4EG[iEG]
525552
for m in 1:q
526553
pos += 1
527554
xItemDofs.colentries[pos] = xItemEdges[n, item] + offset + (m - 1) * nedges
528555
end
529556
end
530557
offset += nedges * q
531-
elseif cpattern[k].type <: DofTypeInterior && cpattern[k].each_component
558+
elseif cpattern[k].type <: DofTypeInterior && !cpattern[k].each_component
532559
for m in 1:q
533560
pos += 1
534561
xItemDofs.colentries[pos] = sub2sup(item_with_interiordofs) + offset
@@ -537,37 +564,10 @@ function init_dofmap_from_pattern!(FES::FESpace{Tv, Ti, FEType, APT}, DM::Type{<
537564
end
538565
end
539566
end
540-
offset = ncomponents * offset4component
541-
for k in 1:l
542-
q = cpattern[k].ndofs
543-
if cpattern[k].type <: DofTypeFace && !cpattern[k].each_component
544-
for n in 1:nfaces4EG[iEG]
545-
for m in 1:q
546-
pos += 1
547-
xItemDofs.colentries[pos] = xItemFaces[n, item] + offset + (m - 1) * nfaces
548-
end
549-
end
550-
offset += nfaces * q
551-
elseif cpattern[k].type <: DofTypeEdge && !cpattern[k].each_component
552-
for n in 1:nedges4EG[iEG]
553-
for m in 1:q
554-
pos += 1
555-
xItemDofs.colentries[pos] = xItemEdges[n, item] + offset + (m - 1) * nedges
556-
end
557-
end
558-
offset += nedges * q
559-
elseif cpattern[k].type <: DofTypeInterior && !cpattern[k].each_component
560-
for m in 1:q
561-
pos += 1
562-
xItemDofs.colentries[pos] = sub2sup(item_with_interiordofs) + offset
563-
offset += nitems
564-
end
565-
end
566-
end
567567
end
568-
569568
FES[DM] = xItemDofs
570569

570+
571571
if FES.dofgrid !== FES.xgrid
572572
## assume parent relation between xgrid and dofgrid
573573
@assert FES.dofgrid[ParentGrid] == FES.xgrid "xgrid is not the parent grid of dofgrid !!!"

src/fedefs/h1_p3.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ function get_basis(::Type{<:AssemblyType}, ::Type{H1P3{ncomponents, edim}}, ::Ty
201201
end
202202

203203
# we need to change the ordering of the face dofs on faces that have a negative orientation sign
204-
function get_basissubset(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1P3{ncomponents, edim}, APT}, EG::Type{<:Triangle2D}) where {ncomponents, edim, Tv, Ti, APT}
205-
xCellFaceSigns = FE.dofgrid[CellFaceSigns]
204+
function get_basissubset(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1P3{ncomponents, edim}, APT}, EG::Type{<:Triangle2D}, xgrid) where {ncomponents, edim, Tv, Ti, APT}
205+
xCellFaceSigns = xgrid[CellFaceSigns]
206206
nfaces::Int = num_faces(EG)
207207
return function closure(subset_ids::Array{Int, 1}, cell)
208208
for j in 1:nfaces
@@ -223,8 +223,8 @@ function get_basissubset(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1P3{ncomponents,
223223
end
224224

225225
# we need to change the ordering of the face dofs on faces that have a negative orientation sign
226-
function get_basissubset(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1P3{ncomponents, edim}, APT}, EG::Type{<:Tetrahedron3D}) where {ncomponents, edim, Tv, Ti, APT}
227-
xCellEdgeSigns = FE.dofgrid[CellEdgeSigns]
226+
function get_basissubset(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1P3{ncomponents, edim}, APT}, EG::Type{<:Tetrahedron3D}, xgrid) where {ncomponents, edim, Tv, Ti, APT}
227+
xCellEdgeSigns = xgrid[CellEdgeSigns]
228228
nedges::Int = num_edges(EG)
229229
return function closure(subset_ids::Array{Int, 1}, cell)
230230
for j in 1:nedges

src/fedefs/h1_pk.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ end
290290

291291

292292
## if order > 2 on Triangl2D we need to change the ordering of the face dofs on faces that have a negative orientation sign
293-
function get_basissubset(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1Pk{ncomponents, edim, order}, APT}, EG::Type{<:Triangle2D}) where {ncomponents, edim, order, Tv, Ti, APT}
293+
function get_basissubset(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1Pk{ncomponents, edim, order}, APT}, EG::Type{<:Triangle2D}, xgrid) where {ncomponents, edim, order, Tv, Ti, APT}
294294
if order < 3
295295
return NothingFunction # no reordering needed
296296
end
297-
xCellFaceSigns = FE.dofgrid[CellFaceSigns]
297+
xCellFaceSigns = xgrid[CellFaceSigns]
298298
nfaces::Int = num_faces(EG)
299299
ndofs_for_f::Int = order - 1
300300
ndofs_for_c = get_ndofs(ON_CELLS, H1Pk{1, edim, order}, EG)

src/fedefs/h1v_br.jl

+18-18
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ function get_basis(AT::Type{ON_CELLS}, FEType::Type{H1BR{2}}, EG::Type{<:Quadril
148148
end
149149
end
150150

151-
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{2}, APT}, ::Type{<:Triangle2D}) where {Tv, Ti, APT}
152-
xFaceNormals::Array{Tv, 2} = FE.dofgrid[FaceNormals]
153-
xCellFaces = FE.dofgrid[CellFaces]
151+
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{2}, APT}, ::Type{<:Triangle2D}, xgrid) where {Tv, Ti, APT}
152+
xFaceNormals::Array{Tv, 2} = xgrid[FaceNormals]
153+
xCellFaces = xgrid[CellFaces]
154154
return function closure(coefficients::Array{<:Real, 2}, cell)
155155
fill!(coefficients, 1.0)
156156
coefficients[1, 7] = xFaceNormals[1, xCellFaces[1, cell]]
@@ -162,9 +162,9 @@ function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{2}, APT}, :
162162
end
163163
end
164164

165-
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{2}, APT}, ::Type{<:Quadrilateral2D}) where {Tv, Ti, APT}
166-
xFaceNormals::Array{Tv, 2} = FE.dofgrid[FaceNormals]
167-
xCellFaces = FE.dofgrid[CellFaces]
165+
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{2}, APT}, ::Type{<:Quadrilateral2D}, xgrid) where {Tv, Ti, APT}
166+
xFaceNormals::Array{Tv, 2} = xgrid[FaceNormals]
167+
xCellFaces = xgrid[CellFaces]
168168
return function closure(coefficients::Array{<:Real, 2}, cell)
169169
fill!(coefficients, 1.0)
170170
coefficients[1, 9] = xFaceNormals[1, xCellFaces[1, cell]]
@@ -178,8 +178,8 @@ function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{2}, APT}, :
178178
end
179179
end
180180

181-
function get_coefficients(::Type{<:ON_FACES}, FE::FESpace{Tv, Ti, H1BR{2}, APT}, ::Type{<:Edge1D}) where {Tv, Ti, APT}
182-
xFaceNormals::Array{Tv, 2} = FE.dofgrid[FaceNormals]
181+
function get_coefficients(::Type{<:ON_FACES}, FE::FESpace{Tv, Ti, H1BR{2}, APT}, ::Type{<:Edge1D}, xgrid) where {Tv, Ti, APT}
182+
xFaceNormals::Array{Tv, 2} = xgrid[FaceNormals]
183183
return function closure(coefficients::Array{<:Real, 2}, face)
184184
# multiplication of face bubble with normal vector of face
185185
fill!(coefficients, 1.0)
@@ -253,9 +253,9 @@ function get_basis(AT::Type{ON_CELLS}, ::Type{H1BR{3}}, EG::Type{<:Hexahedron3D}
253253
end
254254

255255

256-
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{3}, APT}, ::Type{<:Tetrahedron3D}) where {Tv, Ti, APT}
257-
xFaceNormals::Array{Tv, 2} = FE.dofgrid[FaceNormals]
258-
xCellFaces::Adjacency{Ti} = FE.dofgrid[CellFaces]
256+
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{3}, APT}, ::Type{<:Tetrahedron3D}, xgrid) where {Tv, Ti, APT}
257+
xFaceNormals::Array{Tv, 2} = xgrid[FaceNormals]
258+
xCellFaces::Adjacency{Ti} = xgrid[CellFaces]
259259
return function closure(coefficients::Array{<:Real, 2}, cell)
260260
# multiplication with normal vectors
261261
fill!(coefficients, 1.0)
@@ -276,8 +276,8 @@ function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{3}, APT}, :
276276
end
277277

278278

279-
function get_coefficients(::Type{<:ON_FACES}, FE::FESpace{Tv, Ti, H1BR{3}, APT}, ::Type{<:Triangle2D}) where {Tv, Ti, APT}
280-
xFaceNormals::Array{Tv, 2} = FE.dofgrid[FaceNormals]
279+
function get_coefficients(::Type{<:ON_FACES}, FE::FESpace{Tv, Ti, H1BR{3}, APT}, ::Type{<:Triangle2D}, xgrid) where {Tv, Ti, APT}
280+
xFaceNormals::Array{Tv, 2} = xgrid[FaceNormals]
281281
return function closure(coefficients::Array{<:Real, 2}, face)
282282
# multiplication of face bubble with normal vector of face
283283
fill!(coefficients, 1.0)
@@ -287,9 +287,9 @@ function get_coefficients(::Type{<:ON_FACES}, FE::FESpace{Tv, Ti, H1BR{3}, APT},
287287
end
288288
end
289289

290-
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{3}, APT}, ::Type{<:Hexahedron3D}) where {Tv, Ti, APT}
291-
xFaceNormals::Array{Tv, 2} = FE.dofgrid[FaceNormals]
292-
xCellFaces::Adjacency{Ti} = FE.dofgrid[CellFaces]
290+
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{3}, APT}, ::Type{<:Hexahedron3D}, xgrid) where {Tv, Ti, APT}
291+
xFaceNormals::Array{Tv, 2} = xgrid[FaceNormals]
292+
xCellFaces::Adjacency{Ti} = xgrid[CellFaces]
293293
return function closure(coefficients::Array{<:Real, 2}, cell)
294294
# multiplication with normal vectors
295295
fill!(coefficients, 1.0)
@@ -316,8 +316,8 @@ function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1BR{3}, APT}, :
316316
end
317317

318318

319-
function get_coefficients(::Type{<:ON_FACES}, FE::FESpace{Tv, Ti, H1BR{3}, APT}, ::Type{<:Quadrilateral2D}) where {Tv, Ti, APT}
320-
xFaceNormals::Array{Tv, 2} = FE.dofgrid[FaceNormals]
319+
function get_coefficients(::Type{<:ON_FACES}, FE::FESpace{Tv, Ti, H1BR{3}, APT}, ::Type{<:Quadrilateral2D}, xgrid) where {Tv, Ti, APT}
320+
xFaceNormals::Array{Tv, 2} = xgrid[FaceNormals]
321321
return function closure(coefficients::Array{<:Real, 2}, face)
322322
# multiplication of face bubble with normal vector of face
323323
fill!(coefficients, 1.0)

src/fedefs/h1v_p1teb.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ function get_basis(AT::Type{ON_CELLS}, ::Type{H1P1TEB{3}}, EG::Type{<:Tetrahedro
253253
end
254254
end
255255

256-
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1P1TEB{3}, APT}, ::Type{<:Tetrahedron3D}) where {Tv, Ti, APT}
257-
xEdgeTangents::Array{Tv, 2} = FE.dofgrid[EdgeTangents]
258-
xCellEdges = FE.dofgrid[CellEdges]
256+
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1P1TEB{3}, APT}, ::Type{<:Tetrahedron3D}, xgrid) where {Tv, Ti, APT}
257+
xEdgeTangents::Array{Tv, 2} = xgrid[EdgeTangents]
258+
xCellEdges = xgrid[CellEdges]
259259
return function closure(coefficients::Array{<:Real, 2}, cell)
260260
fill!(coefficients, 1.0)
261261
for e in 1:6, k in 1:2
@@ -265,9 +265,9 @@ function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, H1P1TEB{3}, APT}
265265
end
266266
end
267267

268-
function get_coefficients(::Type{<:ON_FACES}, FE::FESpace{Tv, Ti, H1P1TEB{3}, APT}, ::Type{<:Triangle2D}) where {Tv, Ti, APT}
269-
xEdgeTangents::Array{Tv, 2} = FE.dofgrid[EdgeTangents]
270-
xFaceEdges = FE.dofgrid[FaceEdges]
268+
function get_coefficients(::Type{<:ON_FACES}, FE::FESpace{Tv, Ti, H1P1TEB{3}, APT}, ::Type{<:Triangle2D}, xgrid) where {Tv, Ti, APT}
269+
xEdgeTangents::Array{Tv, 2} = xgrid[EdgeTangents]
270+
xFaceEdges = xgrid[FaceEdges]
271271
return function closure(coefficients::Array{<:Real, 2}, face)
272272
fill!(coefficients, 1.0)
273273
for e in 1:3, k in 1:2

src/fedefs/hcurl_n0.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ function get_basis(::Type{ON_CELLS}, ::Type{HCURLN0{3}}, ::Type{<:Tetrahedron3D}
144144
end
145145
end
146146

147-
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HCURLN0, APT}, EG::Type{<:AbstractElementGeometry2D}) where {Tv, Ti, APT}
148-
xCellFaceSigns = FE.dofgrid[CellFaceSigns]
147+
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HCURLN0, APT}, EG::Type{<:AbstractElementGeometry2D}, xgrid) where {Tv, Ti, APT}
148+
xCellFaceSigns = xgrid[CellFaceSigns]
149149
nfaces = num_faces(EG)
150150
return function closure(coefficients, cell)
151151
# multiplication with normal vector signs
@@ -156,8 +156,8 @@ function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HCURLN0, APT},
156156
end
157157
end
158158

159-
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HCURLN0, APT}, EG::Type{<:AbstractElementGeometry3D}) where {Tv, Ti, APT}
160-
xCellEdgeSigns = FE.dofgrid[CellEdgeSigns]
159+
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HCURLN0, APT}, EG::Type{<:AbstractElementGeometry3D}, xgrid) where {Tv, Ti, APT}
160+
xCellEdgeSigns = xgrid[CellEdgeSigns]
161161
nedges = num_edges(EG)
162162
return function closure(coefficients, cell)
163163
# multiplication with normal vector signs

src/fedefs/hcurl_n1.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ function get_basis(::Type{ON_CELLS}, ::Type{HCURLN1{2}}, ::Type{<:Triangle2D})
104104
end
105105
end
106106

107-
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HCURLN1, APT}, EG::Type{<:AbstractElementGeometry2D}) where {Tv, Ti, APT}
108-
xCellFaceSigns = FE.dofgrid[CellFaceSigns]
107+
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HCURLN1, APT}, EG::Type{<:AbstractElementGeometry2D}, xgrid) where {Tv, Ti, APT}
108+
xCellFaceSigns = xgrid[CellFaceSigns]
109109
nfaces = num_faces(EG)
110110
return function closure(coefficients, cell)
111111
# multiplication with normal vector signs (only RT0)

src/fedefs/hdiv_bdm1.jl

+6-7
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ function get_basis(::Type{ON_CELLS}, ::Type{HDIVBDM1{3}}, ::Type{<:Tetrahedron3D
203203
end
204204

205205

206-
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HDIVBDM1, APT}, EG::Type{<:AbstractElementGeometry2D}) where {Tv, Ti, APT}
207-
xCellFaceSigns::Union{VariableTargetAdjacency{Int32}, Array{Int32, 2}} = FE.dofgrid[CellFaceSigns]
206+
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HDIVBDM1, APT}, EG::Type{<:AbstractElementGeometry2D}, xgrid) where {Tv, Ti, APT}
207+
xCellFaceSigns::Union{VariableTargetAdjacency{Int32}, Array{Int32, 2}} = xgrid[CellFaceSigns]
208208
nfaces::Int = num_faces(EG)
209209
dim::Int = dim_element(EG)
210210
return function closure(coefficients::Array{<:Real, 2}, cell::Int)
@@ -218,9 +218,8 @@ function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HDIVBDM1, APT}
218218
end
219219

220220

221-
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HDIVBDM1, APT}, EG::Type{<:AbstractElementGeometry3D}) where {Tv, Ti, APT}
222-
xCellFaceSigns::Union{VariableTargetAdjacency{Int32}, Array{Int32, 2}} = FE.dofgrid[CellFaceSigns]
223-
xCellFaceOrientations::Union{VariableTargetAdjacency{Int32}, Array{Int32, 2}} = FE.dofgrid[CellFaceOrientations]
221+
function get_coefficients(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HDIVBDM1, APT}, EG::Type{<:AbstractElementGeometry3D}, xgrid) where {Tv, Ti, APT}
222+
xCellFaceSigns::Union{VariableTargetAdjacency{Int32}, Array{Int32, 2}} = xgrid[CellFaceSigns]
224223
nfaces::Int = num_faces(EG)
225224
dim::Int = dim_element(EG)
226225
return function closure(coefficients::Array{<:Real, 2}, cell::Int)
@@ -238,8 +237,8 @@ end
238237
# the RT0 and those two BDM1 face functions are chosen
239238
# such that they reflect the two moments with respect to the second and third node
240239
# of the global face enumeration
241-
function get_basissubset(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HDIVBDM1, APT}, EG::Type{<:AbstractElementGeometry3D}) where {Tv, Ti, APT}
242-
xCellFaceOrientations = FE.dofgrid[CellFaceOrientations]
240+
function get_basissubset(::Type{ON_CELLS}, FE::FESpace{Tv, Ti, <:HDIVBDM1, APT}, EG::Type{<:AbstractElementGeometry3D}, xgrid) where {Tv, Ti, APT}
241+
xCellFaceOrientations = xgrid[CellFaceOrientations]
243242
nfaces::Int = num_faces(EG)
244243
orientation = xCellFaceOrientations[1, 1]
245244
shift4orientation1::Array{Int, 1} = [1, 0, 1, 2]

0 commit comments

Comments
 (0)