Skip to content

Commit

Permalink
JM: fix scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Sep 27, 2024
1 parent ed707e3 commit ec68c9f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions FIAT/johnson_mercier.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self, ref_complex, degree, variant=None):
nodes = []

# Face dofs: bidirectional (nn and nt) Legendre moments
R = numpy.array([[0, 1], [-1, 0]])
dim = sd - 1
ref_facet = ref_el.construct_subelement(dim)
Qref = create_quadrature(ref_facet, 2*degree)
Expand All @@ -26,12 +27,11 @@ def __init__(self, ref_complex, degree, variant=None):
for facet in sorted(top[dim]):
cur = len(nodes)
Q = FacetQuadratureRule(ref_el, dim, facet, Qref)
Jdet = Q.jacobian_determinant()
tangents = ref_el.compute_tangents(dim, facet)
normal = ref_el.compute_normal(facet)
normal /= numpy.linalg.norm(normal)
scaled_normal = normal * Jdet
uvecs = (scaled_normal, *tangents)
thats = ref_el.compute_tangents(dim, facet)
nhat = numpy.dot(R, *thats) if sd == 2 else numpy.cross(*thats)
normal = nhat / numpy.linalg.norm(nhat)

uvecs = (nhat, *thats)
comps = [numpy.outer(normal, uvec) for uvec in uvecs]
nodes.extend(FrobeniusIntegralMoment(ref_el, Q, comp[:, :, None] * phi[None, None, :])
for phi in phis for comp in comps)
Expand Down

0 comments on commit ec68c9f

Please sign in to comment.