Skip to content

Commit

Permalink
absorb norm of constant basis function
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Dec 12, 2023
1 parent 503bc15 commit b22f0b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions FIAT/expansions.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def dubiner_recurrence(dim, n, order, ref_pts, jacobian, variant=None):

pad_dim = dim + 2
dX = pad_jacobian(jacobian, pad_dim)
phi[0] = sum((ref_pts[i] - ref_pts[i] for i in range(dim)), 1.)
phi[0] = sum((ref_pts[i] - ref_pts[i] for i in range(dim)), math.sqrt(0.5)**dim)
if dphi is not None:
dphi[0] = (phi[0] - phi[0]) * dX[0]
if ddphi is not None:
Expand Down Expand Up @@ -138,7 +138,7 @@ def dubiner_recurrence(dim, n, order, ref_pts, jacobian, variant=None):
n1 = sum(index) - 1
alpha = 3*n1*(n1*alpha + len(index)) / (n1+1)**2

scale = math.sqrt(0.5 * alpha)
scale = math.sqrt(alpha)
icur = idx(*index)
for result in results:
result[icur] *= scale
Expand Down
3 changes: 1 addition & 2 deletions test/unit/test_fiat.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@ def eval_basis(f, pt):

@pytest.mark.parametrize('cell', [I, T, S])
def test_make_bubbles(cell):
from FIAT.reference_element import make_lattice
from FIAT.quadrature_schemes import create_quadrature
from FIAT.expansions import polynomial_dimension
from FIAT.polynomial_set import make_bubbles, PolynomialSet, ONPolynomialSet
Expand All @@ -627,7 +626,7 @@ def test_make_bubbles(cell):

# test linear independence
m = B.get_num_members()
points = make_lattice(cell.get_vertices(), degree, interior=1)
points = cell.make_points(sd, 0, degree + 1)
values = B.tabulate(points)[(0,) * sd]
assert values.shape == (m, m)
assert np.linalg.matrix_rank(values.T) == m
Expand Down

0 comments on commit b22f0b8

Please sign in to comment.