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
Assuming that CUDA’s atomicMin
is found at all (and there is not some weird namespace issue due to CUDA placing this stuff in the root namespace) the issue is that CELL::getFieldPointer
returns a OpenLB (and platform) specific wrapper to resolve the underlying Structure of Arrays (preventing us from returning a raw pointer to some field value, see e.g. ColumnVector::ptr
on the CPU side).
I would like to discourage again this usage of CUDA specifics in OpenLB Per-Cell operators. It very likely won’t do what you expect, definitely won’t work across blocks (without additional custom communication work on your side), only work on GPUs and may break at any time in future OpenLB releases (as the entire point of this abstract operator style is to be platform agnostic).
The intended way of implementing such custom logic is in OperatorScope::PerBlock
operators. E.g. this is how the statistics aggregation is implemented for the different block platforms.
If you still want to go ahead with this: Yes, if you provide the correct arguments to atomicMin
this will be executed when calling this operator on GPU in OpenLB.