Skip to content

Commit

Permalink
WIP: think about adding a distance_to_point_c function
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenHill committed Jan 23, 2023
1 parent d8c5632 commit 344e01b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion FIAT/reference_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def contains_point(self, point, epsilon=0):
Whilst this could use `distance_to_point` in this function,
`distance_to_point` cannot be used to return a symbolic expression so
we have to reimplement the logic here. If this function is changed, be
sure to update `distance_to_point` as well.
sure to update `distance_to_point` and `distance_to_point_c` as well.
"""
result = (sum(point) - epsilon <= 1)
for c in point:
Expand Down Expand Up @@ -694,6 +694,23 @@ def __init__(self):
1: edges}
super(UFCInterval, self).__init__(LINE, verts, topology)

def distance_to_point_c(self, point):
"""Return a C expression which is equivalent to `distance_to_point`.
Assumes that one has imported `PetscRealPart`.
Parameters
----------
point : str
The C expression for the point.
Returns
-------
str
The C expression for the distance to the point.
"""
NotImplemented


class DefaultTriangle(Simplex):
"""This is the reference triangle with vertices (-1.0,-1.0),
Expand Down

0 comments on commit 344e01b

Please sign in to comment.