#include <Sphere1DSpatialGrid.hpp>

Public Member Functions | |
| 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 |
| int | dimension () const override |
| Mesh * | meshRadial () const |
| int | numCells () const override |
| Position | randomPositionInCell (int m) const override |
| void | setupSelfAfter () override |
| double | volume (int m) const override |
Public Member Functions inherited from SphereSpatialGrid | |
| Box | boundingBox () const override |
| double | maxRadius () const |
| double | minRadius () const |
Public Member Functions inherited from SpatialGrid | |
| 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 |
Public Member Functions inherited from SimulationItem | |
| 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 |
Public Member Functions inherited from Item | |
| 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 | |
| Sphere1DSpatialGrid () | |
| void | write_xy (SpatialGridPlotFile *outfile) const override |
Protected Member Functions inherited from SphereSpatialGrid | |
| SphereSpatialGrid () | |
| void | setupSelfBefore () override |
Protected Member Functions inherited from SpatialGrid | |
| 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 |
Protected Member Functions inherited from SimulationItem | |
| SimulationItem () | |
| virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
| virtual void | setupSelfAfter () |
| virtual void | setupSelfBefore () |
Protected Member Functions inherited from Item | |
| Item () | |
Private Types | |
| using | BaseType = SphereSpatialGrid |
| using | ItemType = Sphere1DSpatialGrid |
Private Attributes | |
| Mesh * | _meshRadial |
| int | _Nr |
| Array | _rv |
Friends | |
| class | ItemRegistry |
| class | MySegmentGenerator |
Additional Inherited Members | |
Static Protected Member Functions inherited from SphereSpatialGrid | |
| static int | initPolarGrid (Array &thetav, Array &cosv, const Mesh *mesh) |
The Sphere1DSpatialGrid class is a subclass of the SphereSpatialGrid class, and represents a one-dimensional, spherically symmetric spatial grid. Each cell in such a grid is a spherical shell. A grid with \(N_r\) cells is specified through a set of \(N_r+1\) radial grid points \(r_i, \,i=0,\ldots,N_r\), with \(0\le r_\text{min} = r_0\), \(r_i<r_{i+1}\), and \(r_{N_r} = r_\text{max}\).
This item type is allowed only if the Boolean expression "!Dimension2&!Dimension3" evaluates to true after replacing the names by true or false depending on their presence.
|
inlineprotected |
Default constructor for concrete Item subclass Sphere1DSpatialGrid : "a 1D spherically symmetric spatial grid" .
|
overridevirtual |
This function returns the index \(m\) of the cell that contains the position \({\bf{r}}\). It just determines the index of the radial bin containing the position, and returns that number.
Implements SpatialGrid.
|
overridevirtual |
This function returns the central location of the cell with index \(m\). The cell index \(m\) corresponds to the radial bin with lower border index \(i=m\), and the central radius is determined using
\[ r = \frac{r_i + r_{i+1}}{2}. \]
The returned position is arbitrarily located on the x-axis.
Implements SpatialGrid.
|
overridevirtual |
This function creates and hands over ownership of a path segment generator (an instance of a PathSegmentGenerator subclass) appropriate for a spherical grid, implemented as a private PathSegmentGenerator subclass.
The figure above is drawn in the plane containing the coordinate system origin \(\bf{o}\) and the path under consideration, defined by its starting point \(\bf{r}\) and direction vector \(\bf{k}\). Now consider the point of closest approach \(\bf{c}\). The distance \(q\) from \(\bf{c}\) to \(\bf{r}\) can be obtained by projecting the position vector \({\bf{r}}\) onto the line formed by the path. Assuming \(\bf{k}\) is normalized to unity, this distance is given by the dot product \(q=\bf{r}\cdot\bf{k}\). The resulting value is negative if \(\bf{r}\) is before \(\bf{c}\) (i.e. it is going inward) and positive if \(\bf{r}\) is after \(\bf{c}\) (i.e. it is going outward). We further define the impact parameter \(p\) as the distance of closest approach. From the rectangular triangles illustrated in the figure it is easily seen that \(p^2 + q^2 = r^2\) and \(p^2 + q_*^2 = r_*^2\). The segment generator uses these relations to step the path through the consecutive spherical bins, updating the value of \(q\) along the way as a proxy for updating \({\bf{r}}\).
Implements SpatialGrid.
|
overridevirtual |
This function returns the "diagonal" of the cell with index \(m\). The cell index \(m\) corresponds to the radial bin with lower border index \(i=m\). The function simply returns the cell width, i.e. the difference between the outer and inner cell radius.
Implements SpatialGrid.
|
overridevirtual |
This function returns the dimension of the grid, which is 1.
Implements SpatialGrid.
|
inline |
This function returns the value of the discoverable item property meshRadial : "the bin distribution in the radial direction" .
The default value for this property is given by the conditional value expression "LinMesh" .
|
overridevirtual |
This function returns the number of cells \(N_r\) in the grid.
Implements SpatialGrid.
|
overridevirtual |
This function returns a random location in the cell with index \(m\). The cell index \(m\) corresponds to the radial bin with lower border index \(i=m\), and a random radius is determined using
\[ r = \left( r_i^3 + {\cal{X}} \,(r_{i+1}^3-r_i^3) \right)^{1/3} \]
with \({\cal{X}}\) a random deviate. This random radius is combined with a random position on the unit sphere to obtain a random position in the cell.
Implements SpatialGrid.
|
overridevirtual |
This function sets up a number of data members that depend on the Mesh object configured for this grid.
Reimplemented from SimulationItem.
|
overridevirtual |
This function returns the volume of the cell with index \(m\). The cell index \(m\) corresponds to the radial bin with lower border index \(i=m\), and the volume is easily calculated as
\[V = \frac{4\pi}{3}\, (r_{i+1}^3-r_i^3),\]
with \(r_i\) and \(r_{i+1}\) the inner and outer radius of the shell respectively.
Implements SpatialGrid.
|
overrideprotectedvirtual |
This function writes the intersection of the grid with the xy plane to the specified SpatialGridPlotFile object.
Reimplemented from SpatialGrid.