#include <BoxCellDensityMixIn.hpp>

Public Member Functions | |
| double | numberDensity (int h, int m) const override |
| Public Member Functions inherited from DensityInCellInterface | |
| virtual | ~DensityInCellInterface () |
Protected Member Functions | |
| BoxCellDensityMixIn () | |
| virtual Box | cellBox (int m) const =0 |
| bool | offersInterface () const |
| void | setup (SimulationItem *item) |
| Protected Member Functions inherited from DensityInCellInterface | |
| DensityInCellInterface () | |
Private Attributes | |
| bool | _enabled |
| vector< MassInBoxInterface * > | _mibv |
The BoxCellDensityMixIn class implements the DensityInCellInterface for spatial grids that have spatial cells in the form of axes-aligned bounding boxes, and that reside in a simulation where all medium components offer the MassInBoxInterface (e.g., imported smoothed particles).
Eligible spatial grid classes should inherit ("mix-in") this class so that the medium density in a cell can be calculated directly without the need for random sampling.
|
protected |
The default constructor initializes the data members to indicate that the DensityInCellInterface is disabled.
|
protectedpure virtual |
This function must be implemented in the inheriting class. It returns the axis-aligned bounding box defining the cell with index \(m\),
Implemented in CartesianSpatialGrid, and TreeSpatialGrid.
|
overridevirtual |
This function implements the DensityInCellInterface. It returns the number density for medium component h in the spatial grid cell with index m.
Implements DensityInCellInterface.
|
protected |
This function must be called from the inheriting class to implement its offersInterface() function. It returns true if the DensityInCellInterface is enabled, and false if not. The function assumes that setup() has properly been called.
|
protected |
This function must be called from the inheriting class during setup. It verifies whether the DensityInCellInterface can actually be enabled and if so, caches some information to accelerate the operation later on. Specifically, the interface can be enabled only if all medium components in the simulation offer the MassInBoxInterface.
The argument is used to locate the medium components in the simulation; it should point to the inheriting class.