Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions finat/finiteelementbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,28 @@ def mapping(self):
'''Appropriate mapping from the reference cell to a physical cell for
all basis functions of the finite element.'''

def is_lagrange(self):
Comment thread
pbrubeck marked this conversation as resolved.
Outdated
Comment thread
pbrubeck marked this conversation as resolved.
Outdated
'''Returns whether finat_element.dual_basis consists only of point
evaluation dofs.'''
try:
Q, ps = self.dual_basis
except NotImplementedError:
return False
# Inspect the weight matrix
# Lagrange elements have gem.Delta as the only terminal nodes
children = [Q]
while children:
nodes = []
for c in children:
if isinstance(c, gem.Delta):
pass
elif isinstance(c, gem.gem.Terminal):
return False
else:
nodes.extend(c.children)
children = nodes
return True


def entity_support_dofs(elem, entity_dim):
'''Return the map of entity id to the degrees of freedom for which
Expand Down