#include <VoronoiMeshSpatialGrid.hpp>
Public Types | |
enum class | Policy : int { Uniform , CentralPeak , DustDensity , ElectronDensity , GasDensity , File , ImportedSites , ImportedMesh } |
Public Member Functions | |
~VoronoiMeshSpatialGrid () | |
int | cellIndex (Position bfr) const override |
Position | centralPositionInCell (int m) const override |
std::unique_ptr< PathSegmentGenerator > | createPathSegmentGenerator () const override |
double | diagonal (int m) const override |
string | filename () const |
double | numberDensity (int h, int m) const override |
int | numCells () const override |
int | numSites () const |
Policy | policy () const |
Position | randomPositionInCell (int m) const override |
bool | relaxSites () const |
double | volume (int m) const override |
void | writeGridPlotFiles (const SimulationItem *probe) const override |
![]() | |
Box | boundingBox () const override |
int | dimension () const override |
double | maxX () const |
double | maxY () const |
double | maxZ () const |
double | minX () const |
double | minY () const |
double | minZ () const |
virtual Box | boundingBox () const =0 |
virtual int | cellIndex (Position bfr) const =0 |
virtual Position | centralPositionInCell (int m) const =0 |
virtual std::unique_ptr< PathSegmentGenerator > | createPathSegmentGenerator () const =0 |
virtual double | diagonal (int m) const =0 |
virtual int | dimension () const =0 |
virtual int | numCells () const =0 |
virtual Position | randomPositionInCell (int m) const =0 |
virtual double | volume (int m) const =0 |
virtual void | writeGridPlotFiles (const SimulationItem *probe) const |
![]() | |
template<class T > | |
T * | find (bool setup=true) const |
template<class T > | |
T * | interface (int levels=-999999, bool setup=true) const |
virtual string | itemName () const |
void | setup () |
string | typeAndName () const |
![]() | |
Item (const Item &)=delete | |
virtual | ~Item () |
void | addChild (Item *child) |
const vector< Item * > & | children () const |
virtual void | clearItemListProperty (const PropertyDef *property) |
void | destroyChild (Item *child) |
virtual bool | getBoolProperty (const PropertyDef *property) const |
virtual vector< double > | getDoubleListProperty (const PropertyDef *property) const |
virtual double | getDoubleProperty (const PropertyDef *property) const |
virtual string | getEnumProperty (const PropertyDef *property) const |
virtual int | getIntProperty (const PropertyDef *property) const |
virtual vector< Item * > | getItemListProperty (const PropertyDef *property) const |
virtual Item * | getItemProperty (const PropertyDef *property) const |
virtual string | getStringProperty (const PropertyDef *property) const |
int | getUtilityProperty (string name) const |
virtual void | insertIntoItemListProperty (const PropertyDef *property, int index, Item *item) |
Item & | operator= (const Item &)=delete |
Item * | parent () const |
virtual void | removeFromItemListProperty (const PropertyDef *property, int index) |
virtual void | setBoolProperty (const PropertyDef *property, bool value) |
virtual void | setDoubleListProperty (const PropertyDef *property, vector< double > value) |
virtual void | setDoubleProperty (const PropertyDef *property, double value) |
virtual void | setEnumProperty (const PropertyDef *property, string value) |
virtual void | setIntProperty (const PropertyDef *property, int value) |
virtual void | setItemProperty (const PropertyDef *property, Item *item) |
virtual void | setStringProperty (const PropertyDef *property, string value) |
void | setUtilityProperty (string name, int value) |
virtual string | type () const |
![]() | |
Box () | |
Box (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) | |
Box (Vec rmin, Vec rmax) | |
void | cellIndices (int &i, int &j, int &k, Vec r, int nx, int ny, int nz) const |
Vec | center () const |
bool | contains (const Box &box) const |
bool | contains (double x, double y, double z) const |
bool | contains (Vec r) const |
double | diagonal () const |
void | extend (const Box &box) |
const Box & | extent () const |
void | extent (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const |
Vec | fracPos (double xfrac, double yfrac, double zfrac) const |
Vec | fracPos (int xd, int yd, int zd, int xn, int yn, int zn) const |
bool | intersects (const Box &box) const |
bool | intersects (Vec r, const Vec k, double &smin, double &smax) const |
bool | intersects (Vec rc, double r) const |
Vec | rmax () const |
Vec | rmin () const |
double | volume () const |
Vec | widths () const |
double | xmax () const |
double | xmin () const |
double | xwidth () const |
double | ymax () const |
double | ymin () const |
double | ywidth () const |
double | zmax () const |
double | zmin () const |
double | zwidth () const |
![]() | |
virtual | ~DensityInCellInterface () |
virtual double | numberDensity (int h, int m) const =0 |
Protected Member Functions | |
VoronoiMeshSpatialGrid () | |
bool | offersInterface (const std::type_info &interfaceTypeInfo) const override |
void | setupSelfBefore () override |
![]() | |
BoxSpatialGrid () | |
void | setupSelfBefore () override |
![]() | |
SpatialGrid () | |
Random * | random () const |
void | setupSelfBefore () override |
virtual void | write_xy (SpatialGridPlotFile *outfile) const |
virtual void | write_xyz (SpatialGridPlotFile *outfile) const |
virtual void | write_xz (SpatialGridPlotFile *outfile) const |
virtual void | write_yz (SpatialGridPlotFile *outfile) const |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
![]() | |
void | setExtent (const Box &extent) |
void | setExtent (double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) |
![]() | |
DensityInCellInterface () | |
Private Types | |
using | BaseType = BoxSpatialGrid |
using | ItemType = VoronoiMeshSpatialGrid |
Private Attributes | |
string | _filename |
VoronoiMeshSnapshot * | _mesh |
double | _norm |
int | _numSites |
Policy | _policy |
bool | _relaxSites |
Friends | |
class | ItemRegistry |
VoronoiMeshSpatialGrid is a concrete subclass of the SpatialGrid class. It represents a three-dimensional grid based on a Voronoi tesselation of the cuboidal spatial domain of the simulation. See the VoronoiMeshSnapshot class for more information on Voronoi tesselations.
The class offers several options for determining the positions of the sites generating the Voronoi tesselation. A specified number of sites can be distributed randomly over the domain, either uniformly or with the same overall density distribution as the medium. Alternatively, the positions can be copied from the sites in the imported distribution(s).
Furthermore, the user can opt to perform a relaxation step on the site positions to avoid overly elongated cells.
This item type is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.
|
strong |
The enumeration type indicating the policy for determining the positions of the sites.
Uniform : "random from uniform distribution" .
CentralPeak : "random from distribution with a steep central peak" .
DustDensity : "random from dust density distribution" .
ElectronDensity : "random from electron density distribution" .
GasDensity : "random from gas density distribution" .
File : "loaded from text column data file" .
ImportedSites : "positions of particles, sites or cells in imported distribution" .
ImportedMesh : "employ imported Voronoi mesh in medium system" .
|
inlineprotected |
Default constructor for concrete Item subclass VoronoiMeshSpatialGrid : "a Voronoi tessellation-based spatial grid" .
VoronoiMeshSpatialGrid::~VoronoiMeshSpatialGrid | ( | ) |
The destructor releases the Voronoi mesh if this object owns it.
|
overridevirtual |
This function returns the index of the cell that contains the position
Implements SpatialGrid.
|
overridevirtual |
This function returns the central location of the cell with index
Implements SpatialGrid.
|
overridevirtual |
This function creates and hands over ownership of a path segment generator (an instance of a PathSegmentGenerator subclass) appropriate for this spatial grid type. For the Voronoi mesh grid, the path segment generator is actually implemented in the VoronoiMeshSnapshot class.
Implements SpatialGrid.
|
overridevirtual |
This function returns the approximate diagonal of the cell with index
Implements SpatialGrid.
|
inline |
This function returns the value of the discoverable string property filename : "the name of the file containing the site positions" .
This property is relevant only if the Boolean expression "policyFile" evaluates to true after replacing the names by true or false depending on their presence.
|
overridevirtual |
This function implements the DensityInCellInterface interface. It returns the number density for medium component
Implements DensityInCellInterface.
|
overridevirtual |
This function returns the number of cells in the grid.
Implements SpatialGrid.
|
inline |
This function returns the value of the discoverable integer property numSites : "the number of random sites (or cells in the grid)" .
The minimum value for this property is "5" .
The default value for this property is given by the conditional value expression "500" .
This property is relevant only if the Boolean expression "policyUniform|policyCentralPeak|policyDustDensity|" "policyElectronDensity|policyGasDensity" evaluates to true after replacing the names by true or false depending on their presence.
|
overrideprotectedvirtual |
This function is used by the interface() function to ensure that the receiving item can actually offer the specified interface. If the requested interface is the DensityInCellInterface, the implementation in this class returns true if the "ImportedMesh" policy has been configured and the medium system consists of a single component, and false otherwise. For other requested interfaces, the function invokes its counterpart in the base class.
Reimplemented from SimulationItem.
|
inline |
This function returns the value of the discoverable Policy enumeration property policy : "the policy for determining the positions of the sites" .
The default value for this property is given by the conditional value expression "DustDensity" .
|
overridevirtual |
This function returns a random location from the cell with index
Implements SpatialGrid.
|
inline |
This function returns the value of the discoverable Boolean property relaxSites : "perform site relaxation to avoid overly elongated cells" .
The default value for this property is given by the conditional value expression "false" .
This property is relevant only if the Boolean expression "!policyImportedMesh" evaluates to true after replacing the names by true or false depending on their presence.
|
overrideprotectedvirtual |
This function verifies that the attributes have been appropriately set, generates or retrieves the site positions for constructing the Voronoi tessellation according to the configured policy, and finally constructs the Voronoi tessellation through an instance of the VoronoiMeshSnapshot class.
Reimplemented from BoxSpatialGrid.
|
overridevirtual |
This function returns the volume of the cell with index
Implements SpatialGrid.
|
overridevirtual |
This function outputs the grid plot files; it is provided here because the regular mechanism does not apply. The function reconstructs the Voronoi tesselation in order to produce the coordinates of the Voronoi cell vertices.
Reimplemented from SpatialGrid.