pumi-pic
pumi-pic copied to clipboard
Pass Tolerance to `trace_particle_through_mesh` Instead of Computing it Everytime
In the following segment of the trace_particle_through_mesh function, the tolerance for search algorithms is computed based on the "minimum area" and it can be expensive.
const auto elmArea = measure_elements_real(&mesh);
o::Real tol = compute_tolerance_from_area(elmArea);
But it should also get the tolerance as a parameter (taking it as a reference) and if the tolerance is not passed (default to 0.0), it can calculate its own.
@jacobmerson, could you please take a look and let me know if it makes sense? Then I can create a pull request with the changes.
Yes, passing the tolerance in makes sense to me. Since the triangles aren't changing each iteration, you should only compute this once.