Intersection of domains
Due to numerical precision, the concept of grid intersection is not trivial to implement. Here are few thoughts about how it could be done.
Range
When is an intersection valid? 1 - Same step 2 - Points coincide (with a certain tolerance, fraction of the step)
Range get_intersection(r1, r2, tol=def_val)
{
if have_same_step(r1,r2)
if points_coincide(r1,r2,tol)
r_inter = compute_intersection
return r_inter
}
Domain
Same condition as range, on every dimension
Edited by LEGRAND Simon