Skip to content

Commit a49af3f

Browse files
committed
Laplacian of trace kernel for internal dofs TNT quadrilateral
According to https://github.com/mscroggs/symfem/blob/main/symfem/elements/tnt.py, we need to multiply by the primary bubble function, and take the laplacian. To this end tabulation which also generates the derivatives is used.
1 parent 9ee46f0 commit a49af3f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

python/demo/demo_tnt-elements.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,18 @@ def create_tnt_quad(degree):
218218
x[2].append(np.zeros([0, 2]))
219219
M[2].append(np.zeros([0, 1, 0, 1]))
220220
else:
221-
pts, wts = basix.make_quadrature(basix.CellType.quadrilateral, 2 * degree - 1)
222-
poly = basix.tabulate_polynomials(
223-
basix.PolynomialType.legendre, basix.CellType.quadrilateral, degree - 2, pts
221+
pts, wts = basix.make_quadrature(basix.CellType.quadrilateral, 2 * degree)
222+
u = pts[:, 0]
223+
v = pts[:, 1]
224+
pol_set = basix.polynomials.tabulate_polynomial_set(
225+
basix.CellType.quadrilateral, basix.PolynomialType.legendre, degree-2, 2, pts
224226
)
227+
# this assumes the conventional [0 to 1][0 to 1] domain of the reference element,
228+
# and takes the Laplacian of (1-u)*u*(1-v)*v*poly,
229+
# cf https://github.com/mscroggs/symfem/blob/main/symfem/elements/tnt.py
230+
poly = (pol_set[5]+pol_set[3])*(u-1)*u*(v-1)*v+ \
231+
2*(pol_set[2]*(u-1)*u*(2*v-1)+pol_set[1]*(v-1)*v*(2*u-1)+ \
232+
pol_set[0]*((u-1)*u+(v-1)*v))
225233
face_ndofs = poly.shape[0]
226234
x[2].append(pts)
227235
mat = np.zeros((face_ndofs, 1, len(pts), 1))

0 commit comments

Comments
 (0)