Skip to content

Commit

Permalink
Merge pull request FEniCS#43 from firedrakeproject/pefarrell/quadratu…
Browse files Browse the repository at this point in the history
…re-element-weights

Allow a QuadratureElement to take in the weights.
  • Loading branch information
wence- authored Apr 29, 2020
2 parents 29bdfbf + c1fac33 commit 4ca7e9a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions FIAT/quadrature_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class QuadratureElement(FiniteElement):
"""A set of quadrature points pretending to be a finite element."""

def __init__(self, ref_el, points):
def __init__(self, ref_el, points, weights=None):
# Create entity dofs.
entity_dofs = {dim: {entity: [] for entity in entities}
for dim, entities in ref_el.get_topology().items()}
Expand All @@ -33,7 +33,8 @@ def __init__(self, ref_el, points):
dual = DualSet(nodes, ref_el, entity_dofs)

super(QuadratureElement, self).__init__(ref_el, dual, order=None)
self._points = points # save the quadrature points
self._points = points # save the quadrature points & weights
self._weights = weights

def value_shape(self):
"The QuadratureElement is scalar valued"
Expand Down

0 comments on commit 4ca7e9a

Please sign in to comment.