Skip to content

Commit

Permalink
different normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Dec 11, 2023
1 parent cc97e81 commit 503bc15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions FIAT/expansions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,11 @@ def jrc(a, b, n):
def integrated_jrc(a, b, n):
"""Integrated Jacobi recurrence coefficients"""
if n == 1:
an = (a + b + 2) / 4
bn = (a - 3*b - 2) / 4
an = (a + b + 2) / 2
bn = (a - 3*b - 2) / 2
cn = 0.0
else:
an, bn, cn = jrc(a-1, b+1, n-1)
an *= n / (n+1)
bn *= n / (n+1)
cn *= (n-1) / (n+1)
return an, bn, cn


Expand Down Expand Up @@ -137,10 +134,9 @@ def dubiner_recurrence(dim, n, order, ref_pts, jacobian, variant=None):
# normalize
for index in reference_element.lattice_iter(0, n+1, codim+1):
alpha = 2 * sum(index) + len(index)

if variant == "integral" and index[-1] > 1:
n1 = index[-1] - 1
alpha = 3*n1 * (n1 * alpha + 1)
if variant == "integral" and sum(index) > 1:
n1 = sum(index) - 1
alpha = 3*n1*(n1*alpha + len(index)) / (n1+1)**2

scale = math.sqrt(0.5 * alpha)
icur = idx(*index)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_fiat.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def test_make_bubbles(cell):
for entity in range(len(top[dim])):
points.extend(cell.make_points(dim, entity, degree + 1))
values = B.tabulate(points)[(0,) * sd]
assert np.allclose(values, 0, atol=1E-14)
assert np.allclose(values, 0, atol=1E-12)

# test linear independence
m = B.get_num_members()
Expand Down

0 comments on commit 503bc15

Please sign in to comment.