A practical grid-based method for tracking multiple refraction and reflection phases in three-dimensional heterogeneous media | Synapse