#include <SpatialGrid.hpp>
Public Member Functions | |
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 |
Protected Member Functions | |
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 () | |
Private Types | |
using | BaseType = SimulationItem |
using | ItemType = SpatialGrid |
Private Attributes | |
Random * | _random |
Friends | |
class | ItemRegistry |
The SpatialGrid class is an abstract base class for grids that tessellate the spatial domain of the simulation. Each position in the computational domain corresponds to a single spatial cell. A SpatialGrid subclass instance represents only purely geometric properties, i.e. it contains no information on the actual distribution of material over the grid.
|
inlineprotected |
Default constructor for abstract Item subclass SpatialGrid : "a spatial grid" .
|
pure virtual |
This function returns the bounding box that encloses the grid.
Implemented in AdaptiveMeshSpatialGrid, BoxSpatialGrid, CylinderSpatialGrid, and SphereSpatialGrid.
|
pure virtual |
This function returns the index
Implemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder2DSpatialGrid, Cylinder3DSpatialGrid, Sphere1DSpatialGrid, Sphere2DSpatialGrid, Sphere3DSpatialGrid, TetraMeshSpatialGrid, TreeSpatialGrid, and VoronoiMeshSpatialGrid.
|
pure virtual |
This function returns the central location of the cell with index
Implemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder2DSpatialGrid, Cylinder3DSpatialGrid, Sphere1DSpatialGrid, Sphere2DSpatialGrid, Sphere3DSpatialGrid, TetraMeshSpatialGrid, TreeSpatialGrid, and VoronoiMeshSpatialGrid.
|
pure virtual |
This function creates and hands over ownership of a path segment generator (an instance of a PathSegmentGenerator subclass) for the spatial grid. The function must be implemented in each subclass to produce a path segment generator of a type corresponding to the specific type of spatial grid.
Implemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder2DSpatialGrid, Cylinder3DSpatialGrid, Sphere1DSpatialGrid, Sphere2DSpatialGrid, Sphere3DSpatialGrid, TetraMeshSpatialGrid, TreeSpatialGrid, and VoronoiMeshSpatialGrid.
|
pure virtual |
This function returns the actual or approximate diagonal of the cell with index
Implemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder2DSpatialGrid, Cylinder3DSpatialGrid, Sphere1DSpatialGrid, Sphere2DSpatialGrid, Sphere3DSpatialGrid, TetraMeshSpatialGrid, TreeSpatialGrid, and VoronoiMeshSpatialGrid.
|
pure virtual |
This function returns the dimension of the grid, which depends on its (lack of) symmetry. A value of 1 means spherical symmetry, 2 means axial symmetry and 3 means none of these symmetries.
Implemented in AdaptiveMeshSpatialGrid, BoxSpatialGrid, Cylinder2DSpatialGrid, Cylinder3DSpatialGrid, Sphere1DSpatialGrid, Sphere2DSpatialGrid, and Sphere3DSpatialGrid.
|
pure virtual |
This function returns the number of cells in the grid.
Implemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder2DSpatialGrid, Cylinder3DSpatialGrid, Sphere1DSpatialGrid, Sphere2DSpatialGrid, Sphere3DSpatialGrid, TetraMeshSpatialGrid, TreeSpatialGrid, and VoronoiMeshSpatialGrid.
|
inlineprotected |
This function returns the simulation's random generator as a service to subclasses.
|
pure virtual |
This function returns a random location from the cell with index
Implemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder2DSpatialGrid, Cylinder3DSpatialGrid, Sphere1DSpatialGrid, Sphere2DSpatialGrid, Sphere3DSpatialGrid, TetraMeshSpatialGrid, TreeSpatialGrid, and VoronoiMeshSpatialGrid.
|
overrideprotectedvirtual |
This function caches the simulation's random generator for use by subclasses.
Reimplemented from SimulationItem.
Reimplemented in SphereSpatialGrid, TetraMeshSpatialGrid, and VoronoiMeshSpatialGrid.
|
pure virtual |
This function returns the volume of the cell with index
Implemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder2DSpatialGrid, Cylinder3DSpatialGrid, Sphere1DSpatialGrid, Sphere2DSpatialGrid, Sphere3DSpatialGrid, TetraMeshSpatialGrid, TreeSpatialGrid, and VoronoiMeshSpatialGrid.
|
protectedvirtual |
This function writes the intersection of the grid with the xy plane to the specified SpatialGridPlotFile object. The default implementation does nothing.
Reimplemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder2DSpatialGrid, Cylinder3DSpatialGrid, Sphere1DSpatialGrid, Sphere2DSpatialGrid, Sphere3DSpatialGrid, and TreeSpatialGrid.
|
protectedvirtual |
This function writes 3D information for all or part of the cells in the grid structure to the specified SpatialGridPlotFile object. The default implementation does nothing.
Reimplemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder3DSpatialGrid, Sphere3DSpatialGrid, and TreeSpatialGrid.
|
protectedvirtual |
This function writes the intersection of the grid with the xz plane to the specified SpatialGridPlotFile object. The default implementation does nothing.
Reimplemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder2DSpatialGrid, Cylinder3DSpatialGrid, Sphere2DSpatialGrid, Sphere3DSpatialGrid, and TreeSpatialGrid.
|
protectedvirtual |
This function writes the intersection of the grid with the yz plane to the specified SpatialGridPlotFile object. The default implementation does nothing.
Reimplemented in AdaptiveMeshSpatialGrid, CartesianSpatialGrid, Cylinder3DSpatialGrid, Sphere3DSpatialGrid, and TreeSpatialGrid.
|
virtual |
This function outputs text data files that allow plotting the structure of the spatial grid. The number of data files written depends on the dimension of the spatial grid: for spherical symmetry only the intersection with the xy plane is written, for axial symmetry the intersections with the xy and xz planes are written, and for general geometries all three intersections are written. In the latter case, an extra file with three-dimensional information is written as well.
The function is called from the SpatialGridPlotProbe class, and receives a pointer to the probe as its argument. The output files are called prefix_probe_grid_XXX.dat
, where XXX is replaced by "xy", "xz", "yz" or "xyz" depending on the file under consideration. Within a file, each line contains two coordinates seperated by whitespace or is empty. Consecutive nonempty lines represent a sequence of "lineto" commands; an empty line marks a "moveto" command.
The default implementation of this function invokes the write_XXX() functions as appropriate for the dimension of the grid. Subclasses usually override the write_XXX() functions, but can opt to override this function instead if that makes more sense.
Reimplemented in TetraMeshSpatialGrid, and VoronoiMeshSpatialGrid.