I am working on something that involves solving an advection equation $\partial{x}/\partial{t}+\vec{u}\cdot\nabla{x}=0$ in 3D. I discretized the space into 3d cartesian grid and used the Semi-Lagrangian method to solve the equation.
By 'Semi-Lagrangian method' I mean the method that Jos Stam proposed in his paper 'Stable Fluids'(People in the computer graphics community might be familiar with him). The method states that to get the new value of $x$ at current position, we trace back in time and use the value of $x$ at the 'traced-back' position. It is based on 'the method of characteristic'.
Imagine I am advecting some objects with a velocity field and $x$ is some attribute of the objects. I update $x$ according to the advection equation.
I have one question: What if I get the value of $x$ outside the boundary of the object while tracing back? I can't use this value to update the value of $x$ inside the object since it's undefined. Is there any method to solve this problem?