Density/Velocity Calculation
These functors are called after the streaming step in order to calculate the density and velocity which are required for calculating the equilibrium distribution needed in the collision step. The density and velocity returned by these functors are passed to a density/velocity callback functor (see Density/Velocity Callback) prior to the collision step. These callback functors always work on block local cell coordinates.
The concept for a density/velocity calculation functor looks like as follows (class with two member functions):
- void operator()( IBlock & block ) -> called every time a new block is processed
- real_t operator()( Vector3<real_t> & velocity, const PdfField_T * const field, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z ) -> called every time a new cell is processed and the density and equilibrium velocity must be calculated for the following collision step. Must return the density via the return value of the function and the velocity via the reference parameter 'velocity'. The argument 'field' is the PDF field that is currently processed. Might be called in parallel, i.e, must be threat-safe!