forked from FEniCS/fiat
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from firedrakeproject/ksagiyam/hex_interior_facet
hex: enable interior facet integration
- Loading branch information
Showing
3 changed files
with
227 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,12 @@ | |
# Modified by David A. Ham ([email protected]), 2015 | ||
|
||
import itertools | ||
from math import factorial | ||
import numpy | ||
from recursivenodes.quadrature import gaussjacobi, lobattogaussjacobi, simplexgausslegendre | ||
|
||
from FIAT import reference_element | ||
from FIAT.orientation_utils import make_entity_permutations_simplex | ||
|
||
|
||
def pseudo_determinant(A): | ||
|
@@ -51,6 +53,7 @@ def __init__(self, ref_el, pts, wts): | |
self.ref_el = ref_el | ||
self.pts = pts | ||
self.wts = wts | ||
self._intrinsic_orientation_permutation_map_tuple = (None, ) | ||
|
||
def get_points(self): | ||
return numpy.array(self.pts) | ||
|
@@ -61,6 +64,32 @@ def get_weights(self): | |
def integrate(self, f): | ||
return sum(w * f(x) for x, w in zip(self.pts, self.wts)) | ||
|
||
@property | ||
def extrinsic_orientation_permutation_map(self): | ||
"""A map from extrinsic orientations to corresponding axis permutation matrices. | ||
Notes | ||
----- | ||
result[eo] gives the physical axis-reference axis permutation matrix corresponding to | ||
eo (extrinsic orientation). | ||
""" | ||
return self.ref_el.extrinsic_orientation_permutation_map | ||
|
||
@property | ||
def intrinsic_orientation_permutation_map_tuple(self): | ||
"""A tuple of maps from intrinsic orientations to corresponding point permutations for each reference cell axis. | ||
Notes | ||
----- | ||
result[axis][io] gives the physical point-reference point permutation array corresponding to | ||
io (intrinsic orientation) on ``axis``. | ||
""" | ||
if any(m is None for m in self._intrinsic_orientation_permutation_map_tuple): | ||
raise ValueError("Must set _intrinsic_orientation_permutation_map_tuple") | ||
return self._intrinsic_orientation_permutation_map_tuple | ||
|
||
|
||
class GaussJacobiQuadratureLineRule(QuadratureRule): | ||
"""Gauss-Jacobi quadature rule determined by Jacobi weights a and b | ||
|
@@ -71,6 +100,12 @@ def __init__(self, ref_el, m, a=0, b=0): | |
pts_ref, wts_ref = gaussjacobi(m, a, b) | ||
pts, wts = map_quadrature(pts_ref, wts_ref, Ref1, ref_el) | ||
QuadratureRule.__init__(self, ref_el, pts, wts) | ||
# Set _intrinsic_orientation_permutation_map_tuple. | ||
dim = 1 | ||
a = numpy.zeros((factorial(dim + 1), m), dtype=int) | ||
for io, perm in make_entity_permutations_simplex(dim, m).items(): | ||
a[io, perm] = range(m) | ||
self._intrinsic_orientation_permutation_map_tuple = (a, ) | ||
|
||
|
||
class GaussLobattoLegendreQuadratureLineRule(QuadratureRule): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters