Skip to content

Commit ae36820

Browse files
authored
Fix GN modified bubble space (#97)
1 parent 49e6bdc commit ae36820

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

FIAT/guzman_neilan.py

+8-13
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from FIAT.quadrature_schemes import create_quadrature
1818
from FIAT.restricted import RestrictedElement
1919
from FIAT.nodal_enriched import NodalEnrichedElement
20-
from itertools import chain
2120

2221
import numpy
2322
import math
@@ -168,21 +167,17 @@ def modified_bubble_subspace(B):
168167
hat = B.take([0])
169168
hat_at_qpts = hat.tabulate(qpts)[(0,)*sd][0, 0]
170169

171-
# tabulate the BDM facet functions
172-
ref_el = ref_complex.get_parent()
173-
BDM = BrezziDouglasMarini(ref_el, degree-1)
174-
entity_dofs = BDM.entity_dofs()
175-
facet_dofs = list(range(BDM.space_dimension() - len(entity_dofs[sd][0])))
176-
BDM_facet = BDM.get_nodal_basis().take(facet_dofs)
177-
phis = BDM_facet.tabulate(qpts)[(0,)*sd]
178-
179170
# tabulate the bubbles = hat ** (degree - k) * BDMk_facet
171+
ref_el = ref_complex.get_parent()
180172
bubbles = [numpy.eye(sd)[:, :, None] * hat_at_qpts[None, None, :] ** degree]
181173
for k in range(1, degree):
182-
dimPk = math.comb(k + sd-1, sd-1)
183-
idsPk = list(chain.from_iterable(entity_dofs[sd-1][f][:dimPk]
184-
for f in entity_dofs[sd-1]))
185-
bubbles.append(numpy.multiply(phis[idsPk], hat_at_qpts ** (degree-k)))
174+
# tabulate the BDM facet functions
175+
BDM = BrezziDouglasMarini(ref_el, k)
176+
BDM_facet = BDM.get_nodal_basis().take(BDM.dual.get_indices("facet"))
177+
phis = BDM_facet.tabulate(qpts)[(0,)*sd]
178+
179+
bubbles.append(numpy.multiply(phis, hat_at_qpts ** (degree-k)))
180+
186181
bubbles = numpy.concatenate(bubbles, axis=0)
187182

188183
# store the bubbles into a PolynomialSet via L2 projection

0 commit comments

Comments
 (0)