Skip to content

Commit

Permalink
Correct functional for internal dofs TNT quadrilateral
Browse files Browse the repository at this point in the history
  • Loading branch information
jmv2009 authored Dec 14, 2024
1 parent b434058 commit 482317e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions python/demo/demo_tnt-elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,14 @@ def create_tnt_quad(degree):
pts, wts = basix.make_quadrature(basix.CellType.quadrilateral, 2 * degree)
u = pts[:, 0]
v = pts[:, 1]
poly = basix.polynomials.tabulate_polynomial_set(basix.CellType.quadrilateral, basix.PolynomialType.legendre, degree-2, 2, pts)
# this assumes the conventional [0 to 1][0 to 1] domain of the reference element, and takes the Laplacian of (1-u)*u*(1-v)*v*poly, cf https://github.com/mscroggs/symfem/blob/main/symfem/elements/tnt.py
poly = (poly[5]+poly[3])*(u-1)*u*(v-1)*v+2*(poly[2]*(u-1)*u*(2*v-1)+poly[1]*(v-1)*v*(2*u-1)+poly[0]*((u-1)*u+(v-1)*v))
pol0 = basix.polynomials.tabulate_polynomial_set(
basix.CellType.quadrilateral, basix.PolynomialType.legendre, degree-2, 2, pts
)
# this assumes the conventional [0 to 1][0 to 1] domain of the reference element,
# and takes the Laplacian of (1-u)*u*(1-v)*v*poly,
# cf https://github.com/mscroggs/symfem/blob/main/symfem/elements/tnt.py
poly = (pol0[5]+pol0[3])*(u-1)*u*(v-1)*v+ \
2*(pol0[2]*(u-1)*u*(2*v-1)+pol0[1]*(v-1)*v*(2*u-1)+pol0[0]*((u-1)*u+(v-1)*v))
face_ndofs = poly.shape[0]
x[2].append(pts)
mat = np.zeros((face_ndofs, 1, len(pts), 1))
Expand Down

0 comments on commit 482317e

Please sign in to comment.