Skip to content

Commit

Permalink
bc: postpone raising exception for zany elements (#3726)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam authored Aug 7, 2024
1 parent c397fd2 commit 57e21cc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions firedrake/bcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ class BCBase(object):
@PETSc.Log.EventDecorator()
def __init__(self, V, sub_domain):

# First, we bail out on zany elements. We don't know how to do BC's for them.
if isinstance(V.finat_element, (finat.Argyris, finat.Morley, finat.Bell)) or \
(isinstance(V.finat_element, finat.Hermite) and V.mesh().topological_dimension() > 1):
raise NotImplementedError("Strong BCs not implemented for element %r, use Nitsche-type methods until we figure this out" % V.finat_element)
self._function_space = V
self.sub_domain = sub_domain
# If this BC is defined on a subspace (IndexedFunctionSpace or
Expand Down Expand Up @@ -131,6 +127,12 @@ def domain_args(self):
def nodes(self):
'''The list of nodes at which this boundary condition applies.'''

# First, we bail out on zany elements. We don't know how to do BC's for them.
V = self._function_space
if isinstance(V.finat_element, (finat.Argyris, finat.Morley, finat.Bell)) or \
(isinstance(V.finat_element, finat.Hermite) and V.mesh().topological_dimension() > 1):
raise NotImplementedError("Strong BCs not implemented for element %r, use Nitsche-type methods until we figure this out" % V.finat_element)

def hermite_stride(bcnodes):
if isinstance(self._function_space.finat_element, finat.Hermite) and \
self._function_space.mesh().topological_dimension() == 1:
Expand Down

0 comments on commit 57e21cc

Please sign in to comment.