Closed cgcgcg closed 2 years ago
@hymanjd Can you point me to where it is used?
It's used in every function in TrackingParticle.c. void SearchNeighborCells, int InsideCell (unsigned int numc), void PredictorStep(), void NeighborCells (int k), int CheckDistance(), double InOutFlowCell(int indcell, int int1, double nposx, double nposy), etc. In principle, you should be able to add np as an argument to all of these functions.
We had a postdoc fix this for an openMP version of the code, which is still in testing, and it took him a while to get it working as a local variable, which was necessary for openMP to work.
However, a better approach is to make the particle an object with np (particle number) as an attribute and many of these functions being attached to the class, which is the direction we're heading with the C++ version.
Ok, so it really should be a global variable then if I want to avoid a major refactor. I updated the PR accordingly, this compiles and should be equivalent.
Thanks. I'll run this through some tests to confirm and then merge.