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.