#include <ClipGeometryDecorator.hpp>
Public Types | |
enum class | Remove : int { Inside , Outside } |
Public Member Functions | |
double | density (Position bfr) const override |
Position | generatePosition () const override |
Geometry * | geometry () const |
Remove | remove () const |
double | SigmaX () const override |
double | SigmaY () const override |
double | SigmaZ () const override |
Public Member Functions inherited from Geometry | |
virtual double | density (Position bfr) const =0 |
virtual int | dimension () const =0 |
virtual Position | generatePosition () const =0 |
virtual double | SigmaX () const =0 |
virtual double | SigmaY () const =0 |
virtual double | SigmaZ () const =0 |
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 | |
ClipGeometryDecorator () | |
virtual bool | inside (Position bfr) const =0 |
double | norm () const |
void | setupSelfAfter () override |
Protected Member Functions inherited from Geometry | |
Geometry () | |
Random * | random () const |
void | setupSelfBefore () override |
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 = Geometry |
using | ItemType = ClipGeometryDecorator |
Private Attributes | |
Geometry * | _geometry |
double | _norm |
Remove | _remove |
Friends | |
class | ItemRegistry |
The abstract ClipGeometryDecorator class implements a decorator that adjusts another geometry by setting the density equal to zero inside or outside a region defined in a subclass. Each ClipGeometryDecorator subclass must implement the virtual functions dimension() and inside(). The decorator increases the density in the remaining region with a constant factor to ensure that the total mass remains equal to one. The current implementation does not properly adjust the surface densities along the coordinate axes for the mass taken away by the cavity.
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 which region to remove (Inside or Outside).
Inside : "the inner region (creating a cavity)" .
Outside : "the outer region (cropping)" .
|
inlineprotected |
Default constructor for abstract Item subclass ClipGeometryDecorator : "a decorator that clips another geometry" .
|
overridevirtual |
This function returns the density \(\rho({\bf{r}})\) at the position \({\bf{r}}\). It is zero in the removed region, and equal to the density of the geometry being decorated elsewhere, after an adjustment is made to account for the clipping.
Implements Geometry.
|
overridevirtual |
This function generates a random position from the geometry, by drawing a random point from the three-dimensional probability density \(p({\bf{r}})\, {\text{d}}{\bf{r}} = \rho({\bf{r}})\, {\text{d}}{\bf{r}}\). It repeatedly calls the density() function for the geometry being decorated until a position is returned that does not lie in the removed region.
Implements Geometry.
|
inline |
This function returns the value of the discoverable item property geometry : "the geometry to be clipped" .
|
protectedpure virtual |
This pure virtual function, to be implemented by a subclass, returns true if the specified position is inside the boundary defined by the subclass, i.e. the point is in the region that would be carved away when creating a cavity, or in the region that would be retained when cropping.
Implemented in BoxClipGeometryDecorator, CylindricalClipGeometryDecorator, and SphericalClipGeometryDecorator.
|
protected |
This function returns the normalization factor calculated by this class during setup.
|
inline |
This function returns the value of the discoverable Remove enumeration property remove : "the region to be removed" .
|
overrideprotectedvirtual |
This function estimates the fraction \(\chi\) of the mass from the original model taken away by the clipping. It samples the density of the geometry being decorated, and counts the number of generated positions that fall in the removed region. This value is used to renormalize the decorated density distribution to unity: the factor by which the original density has to be multiplied is simply \(1/(1-\chi)\).
Reimplemented from SimulationItem.
|
overridevirtual |
This function returns the X-axis surface density, i.e. the integration of the density along the entire X-axis,
\[ \Sigma_X = \int_{-\infty}^\infty \rho(x,0,0)\,{\text{d}}x. \]
It returns the corresponding value of the geometry being decorated after re-normalization.
Implements Geometry.
Reimplemented in CylindricalClipGeometryDecorator.
|
overridevirtual |
This function returns the Y-axis surface density, i.e. the integration of the density along the entire Y-axis,
\[ \Sigma_Y = \int_{-\infty}^\infty \rho(0,y,0)\,{\text{d}}y. \]
It returns the corresponding value of the geometry being decorated after re-normalization.
Implements Geometry.
Reimplemented in CylindricalClipGeometryDecorator.
|
overridevirtual |
This function returns the Z-axis surface density, i.e. the integration of the density along the entire Z-axis,
\[ \Sigma_Z = \int_{-\infty}^\infty \rho(0,0,z)\,{\text{d}}z. \]
It returns the corresponding value of the geometry being decorated after re-normalization.
Implements Geometry.
Reimplemented in CylindricalClipGeometryDecorator.