Skip to content

Reply To: Modifying field values for neighboring cells inside a postprocessor

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Modifying field values for neighboring cells inside a postprocessor Reply To: Modifying field values for neighboring cells inside a postprocessor

#9287
Danial.Khazaeipoul
Participant

FYI, I have modified getComponentPointer to be a public member rather than protected in the (1) core/columnVector.h, (2) core/vector.h, (3) core/fieldArrayD.h, and (4) core/platform/gpu/cuda/context.hh. With these modifications, the atomicMin function can now be used as below:

auto nextID = atomicMin(nextCell.template getFieldPointer<FreeSurface::TEST_ID>().getComponentPointer(0), nbrID);

With the mentioned modifications and the use of atomicMin operation, the code now compiles and runs correctly, just as it did with the non-atomic version. I can guess that you prefer not to modify the core/ in this way as it might introduce memory-safety issues with underlying data now exposed through public methods. However, I am not sure what would be a better alternative to be able to access raw pointers with in an apply operator without modifying the core/ as above.