Replies: 2 comments
-
Draft PR: #832 |
Beta Was this translation helpful? Give feedback.
0 replies
-
A little script to document my working, showing where that import numpy as np
from numpy.polynomial import Polynomial
import skfem as fe
x = fe.Basis(fe.MeshQuad(), fe.ElementQuadRT0() * fe.ElementQuad0()).elem.elems[0].doflocs
unnormalized_normals = x - x.mean(axis=0)
normals = unnormalized_normals / np.linalg.norm(unnormalized_normals, axis=1)[:, None]
monomials = np.hstack([np.ones((x.shape[0], 1)), x, np.prod(x, axis=1)[:, None]])
A = normals @ np.tile(np.eye(2), (1, 2)) # [[1, 0, x, 0], [0, 1, 0, y]], with (x, y) to be put in next
A[:, 2:] *= x
Ainv = np.linalg.inv(A)
phi_polys = np.array([[Polynomial(c) for c in coeffs] for coeffs in [[[1], [0], [0, 1], [0]], [[0], [1], [0], [0, 1]]]] @ Ainv).T
phi = [[list(p.coef) for p in pp] for pp in phi_polys]
print(phi.shape) The output is
which is interpreted as a list of pairs of polynomials (in x, and y, respectively), i.e.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Implementing the lowest order Raviart–Thomas quadrilateral was raised in #824 , which had begun by using
to_meshtri
onex17.mesh
. Reference there was made to Brezzi & Fortin, but this element was already described in §5 of the original paper (1977).The basis functions on the canonical unit square are such that their normal components at the midpoints are the Kronecker delta. R & T didn't give them explicitly but by handcalculation, I think this means
with the divergence
dphi
being unity for each.Beta Was this translation helpful? Give feedback.
All reactions