-
Notifications
You must be signed in to change notification settings - Fork 169
introduce PointEvaluator
object
#4516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
fix fix fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome.
Could you amend the manual to recommend doing this instead of the full VoM ritual?
This is just a suggestion that I think might align better with the rest of firedrake. How about something like this?
|
Personally I really dislike the functions masquerading as classes approach. But otherwise this seems elegant. We could have something like DG_vom = FunctionSpace.at_points(mesh, points) |
Problem with this is if you want to points in order (which is what users expect) then you'd still need to create a |
Seems like you want a |
self.vom = VertexOnlyMesh( | ||
mesh, points, missing_points_behaviour=missing_points_behaviour, | ||
redundant=redundant, tolerance=tolerance | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to record coordinate dat version and reimmerse the VOM when needed.
Also need a moving coordinate test.
fix comment
PointEvaluator
is a convenience object for evaluating aFunction
at a set of points. The idea is for the user to avoid the boilerplate when point evaluating using a VertexOnlyMesh. Now that #4484 is merged we should be able to deprecate.at()
in favour of this API.The basic usage is:
The kwargs you can pass to
PointEvaluator
aretolerance
andmissing_points_behaviour
which are self-explanatory, andredundant
. Ifredundant=True
(the default) then only the points on rank 0 are evaluated, and we broadcast the result to all other ranks. Ifredundant=False
then each rank evaluates the points it has been given and returns the results on that rank. This is useful for e.g. external data input.