SCOREC / pumi-pic

support libraries for unstructured mesh particle in cell simulations on GPUs and CPUs
BSD 3-Clause "New" or "Revised" License
36 stars 15 forks source link

Generalized search_mesh that takes a functor to execute at element boundary or destination #130

Closed Fuad-HH closed 1 week ago

Fuad-HH commented 2 weeks ago

This new particle_search method allows passing a functor that takes all the necessary objects it wants to handle. It is run every time the particle reaches an element boundary or its destination i.e. after every call of find_exit_face. It will allow various things including handling different boundary conditions, recording information, etc.

cwsmith commented 2 weeks ago

Thank you. Does this support 2d and/or 3d meshes? Are there any tests available?

Fuad-HH commented 2 weeks ago

Yes, as the original search_mesh function, it supports both 2D and 3D. Actually, this is exactly the original search_mesh method except what it did when particles reach element boundaries is encapsulated in the functor that is passed in the new particle_search method. There are two test cases (search_adj_2d and search_adj_3d) that use the search_mesh method for 2D and 3D searches. It tests the search_mesh method and it is passing.

jacobmerson commented 2 weeks ago

@Fuad-HH is #128 ready as well? That has the unit tests you put in place for all of the component functions of search_mesh correct?

Fuad-HH commented 1 week ago

I have added a brief description for renamed trace_particle_through_mesh. Does the description look good?

Fuad-HH commented 1 week ago

There shouldn't be any merge conflict, but it's showing an "empty" line coming from master.