pumi-pic icon indicating copy to clipboard operation
pumi-pic copied to clipboard

Pass Tolerance to `trace_particle_through_mesh` Instead of Computing it Everytime

Open Fuad-HH opened this issue 1 year ago • 2 comments

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.

Fuad-HH avatar Jan 27 '25 19:01 Fuad-HH

@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.

Fuad-HH avatar Jan 27 '25 19:01 Fuad-HH

Yes, passing the tolerance in makes sense to me. Since the triangles aren't changing each iteration, you should only compute this once.

jacobmerson avatar Jan 29 '25 07:01 jacobmerson