In getLocalQuantities.f, we fix the problem of integrating through an adjacent empty space cell by taking the physical values at the integrator's location to be the smoothed central values of the last particle entered so long as its kernel is still overlapping at that point. Unfortunately, if there exists an SPH particle with a small enough kernel such that it fits inside another particle's kernel, the integrator will think the last particle entered is that small particle. Thus, once the integrator leaves the small particle, but is still within the larger particle, and it finds an empty space cell, it will think that its current position is empty space instead of taking the smoothed central values of the larger particle that it is inside of.
To fix this, we're going to need to track the last particle exited. We can do this in prepareIntegration.f probably in a similar way to how we track the last particle entered.
In getLocalQuantities.f, we fix the problem of integrating through an adjacent empty space cell by taking the physical values at the integrator's location to be the smoothed central values of the last particle entered so long as its kernel is still overlapping at that point. Unfortunately, if there exists an SPH particle with a small enough kernel such that it fits inside another particle's kernel, the integrator will think the last particle entered is that small particle. Thus, once the integrator leaves the small particle, but is still within the larger particle, and it finds an empty space cell, it will think that its current position is empty space instead of taking the smoothed central values of the larger particle that it is inside of.
To fix this, we're going to need to track the last particle exited. We can do this in prepareIntegration.f probably in a similar way to how we track the last particle entered.