EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
A Bravais, cubic, and hexagonal lattice geometryA geometry which embeds a lattice of one geometry (named subgeometry below) into one region of a second geometry (named base geometry). This geometry effectively recurses the subgeometry at every position defined by a Bravais, cubic, or hexagonal lattice. As such, you can model an infinite amount of subgeometries (e.g., region 0 of egs_space) and the only slow down to your simulation would depend on how many subgeometries you would expect over a particle track. More...
#include <egs_lattice.h>
Public Member Functions | |
EGS_Lattice (EGS_BaseGeometry *B, EGS_BaseGeometry *S, int i, EGS_Float x, EGS_Float y, EGS_Float z, const string &Name="") | |
EGS_Vector | closestPoint (const EGS_Vector &x) |
int | computeIntersections (int ireg, int n, const EGS_Vector &x, const EGS_Vector &u, EGS_GeometryIntersections *isections) |
bool | isRealRegion (int ireg) const |
bool | isInside (const EGS_Vector &x) |
int | isWhere (const EGS_Vector &x) |
int | inside (const EGS_Vector &x) |
int | medium (int ireg) const |
EGS_Float | howfarToOutside (int ireg, const EGS_Vector &x, const EGS_Vector &u) |
int | howfar (int ireg, const EGS_Vector &x, const EGS_Vector &u, EGS_Float &t, int *newmed=0, EGS_Vector *normal=0) |
EGS_Float | hownear (int ireg, const EGS_Vector &x) |
int | regions () |
int | getMaxStep () const |
const string & | getType () const |
void | printInfo () const |
bool | hasBooleanProperty (int ireg, EGS_BPType prop) const |
void | setBooleanProperty (EGS_BPType prop) |
void | addBooleanProperty (int bit) |
void | setBooleanProperty (EGS_BPType prop, int start, int end, int step=1) |
void | addBooleanProperty (int bit, int start, int end, int step=1) |
EGS_Float | getRelativeRho (int ireg) const |
void | setRelativeRho (int start, int end, EGS_Float rho) |
void | setRelativeRho (EGS_Input *) |
void | setBScaling (int start, int end, EGS_Float rho) |
void | setBScaling (EGS_Input *) |
EGS_Float | getBScaling (int ireg) const |
virtual void | getLabelRegions (const string &str, vector< int > ®s) |
Public Member Functions inherited from EGS_BaseGeometry | |
EGS_BaseGeometry (const string &Name) | |
Construct a geometry named Name. More... | |
virtual | ~EGS_BaseGeometry () |
Destructor. More... | |
bool | isConvex () const |
Is the geometry convex? More... | |
virtual EGS_Float | getVolume (int ireg) |
Calculates the volume of region ireg. More... | |
virtual EGS_Float | getBound (int idir, int ind) |
Returns region boundaries in direction determined by idir. More... | |
virtual int | getNRegDir (int idir) |
int | regions () const |
Returns the number of local regions in this geometry. More... | |
void | setMedium (const string &Name) |
Set all regions to a medium with name Name. More... | |
void | setMedium (int start, int end, const string &Name, int delta=1) |
Set every delta'th region between start and end to the medium named Name. More... | |
void | setMedium (int imed) |
Set all regions to a medium with index imed. More... | |
void | setMedium (int istart, int iend, int imed, int delta=1) |
Set every delta'th region between start and end (inclusive) to imed. More... | |
void | setMedia (EGS_Input *inp) |
Set the media in the geometry from the input pointed to by inp. More... | |
bool | hasRhoScaling () const |
Does this geometry object have a mass density scaling feature? More... | |
EGS_Float | getMediumRho (int ind) const |
virtual void | setApplication (EGS_Application *app) |
bool | hasBScaling () const |
Does this geometry object have a B field scaling feature? | |
const string & | getName () const |
Get the name of this geometry. More... | |
void | setDebug (bool deb) |
Turn debugging on. More... | |
void | setName (EGS_Input *inp) |
Set the name of the geometry from the input inp. More... | |
void | setBoundaryTolerance (EGS_Input *inp) |
Set the value of the boundary tolerance from the input inp. More... | |
void | setBoundaryTolerance (EGS_Float tol) |
Set the value of the boundary tolerance from argument. | |
int | ref () |
Increase the reference count to this geometry. More... | |
int | deref () |
Decrease the reference count to this geometry. More... | |
EGS_Float | getBoundaryTolerance () |
Get the value of the boundary tolerance. | |
virtual void | getNumberRegions (const string &str, vector< int > ®s) |
Get a list of all the regions labeled with a number. | |
virtual const string & | getLabelName (const int i) |
Get the name of the i-th explicit label in the geometry. | |
virtual int | getLabelCount () |
Get the number of explicit labels in the geometry. | |
int | setLabels (EGS_Input *input) |
Set the labels from an input block. | |
int | setLabels (const string &inp) |
Set the labels from an input string. | |
Protected Member Functions | |
void | setMedia (EGS_Input *inp, int, const int *) |
Protected Attributes | |
EGS_BaseGeometry * | base |
The geometry within which the sub geometry appears. | |
EGS_TransformedGeometry * | sub |
The sub geometry that could appear within base. | |
int | ind |
The region in base geom where we could encounter sub geom. | |
int | maxStep |
The maximum number of steps. | |
EGS_Float | a |
EGS_Float | b |
EGS_Float | c |
The center-to-center distance along x, y, and z. | |
string | type |
The geometry type. | |
Protected Attributes inherited from EGS_BaseGeometry | |
int | nreg |
Number of local regions in this geometry. More... | |
string | name |
Name of this geometry. More... | |
short * | region_media |
Array of media indeces. More... | |
int | med |
Medium index. More... | |
bool | has_rho_scaling |
Does this geometry have relative mass density scvaling? More... | |
EGS_Float * | rhor |
Array with relative mass densities. More... | |
bool | has_B_scaling |
Does this geometry has B field scaling factor? More... | |
bool | has_Ref_rho |
EGS_Float * | bfactor |
Array with B field scaling factors. More... | |
EGS_Float | rhoRef |
Reference density for B field scaling. More... | |
int | nref |
Number of references to this geometry. More... | |
bool | debug |
Debugging flag. More... | |
bool | is_convex |
Is this geometry convex? More... | |
EGS_BPType | bproperty |
A bit mask of boolean properties for the entire geometry. More... | |
EGS_BPType * | bp_array |
An array of boolean properties on a region by region basis. More... | |
EGS_Float | boundaryTolerance |
Boundary tolerance for geometries that need it. | |
EGS_Float | halfBoundaryTolerance |
vector< label > | labels |
Labels. More... | |
EGS_Application * | app |
The application this object belongs to. | |
Additional Inherited Members | |
Static Public Member Functions inherited from EGS_BaseGeometry | |
static int | findRegion (EGS_Float xp, int np, const EGS_Float *p) |
Find the bin to which xp belongs, given np bin edges p. More... | |
static int | nMedia () |
Get the number of media registered so far by all geometries. More... | |
static const char * | getMediumName (int ind) |
Get the name of medium with index ind. More... | |
static int | addMedium (const string &medname) |
Add a medium or get the index of an existing medium. More... | |
static int | getMediumIndex (const string &medname) |
Get the index of a medium named medname. More... | |
static EGS_BaseGeometry * | createGeometry (EGS_Input *) |
Create a geometry (or geometries) from a given input. More... | |
static EGS_BaseGeometry * | createSingleGeometry (EGS_Input *inp) |
Create a single geometry from the input inp. More... | |
static void | clearGeometries () |
Clears (deletes) all geometries in the currently active geometry list. More... | |
static EGS_BaseGeometry * | getGeometry (const string &Name) |
Get a pointer to the geometry named Name. More... | |
static EGS_BaseGeometry ** | getGeometries () |
static int | getNGeometries () |
static string | getUniqueName () |
Get a unique geometry name. More... | |
static void | describeGeometries () |
Describes all existing geometries. More... | |
static void | setActiveGeometryList (int list) |
Set the currently active geometry list. More... | |
static int | getLastError () |
static void | resetErrorFlag () |
Static Protected Attributes inherited from EGS_BaseGeometry | |
static int | error_flag = 0 |
Set to non-zero status if a geometry problem is encountered. | |
A Bravais, cubic, and hexagonal lattice geometry
A geometry which embeds a lattice of one geometry (named subgeometry below) into one region of a second geometry (named base geometry). This geometry effectively recurses the subgeometry at every position defined by a Bravais, cubic, or hexagonal lattice. As such, you can model an infinite amount of subgeometries (e.g., region 0 of egs_space) and the only slow down to your simulation would depend on how many subgeometries you would expect over a particle track.
As this geometry only stores a single subgeometry in memory, it can only score in ALL subgeometries (or rather, the single subgeometry at all lattice positions) at once. Therefore, dose to the subgeometry at different locations cannot be discerned. Final geometry regions are numbered as all base geometry regions first, then enumerating all subgeometry regions afterwards. A more complete description can be found in the paper referenced in the header.
All egs_lattice geometries require a base geometry, a subgeometry, and a subgeometry index. The base geometry is the larger geometry into which the lattice will be embedded. The subgeometry is the geometry which will be placed at each lattice position. The subgeometry index will be the base geometry region in which the lattice is placed. Any geometries at the boundary will be partially modelled (only the fraction in the selected region). The spacing and type of geometry can be defined in one of three ways:
1) Bravais Lattice: Define spacing in x, y, and z using the three inputs for spacing, respectively. 2) Cubic Lattice: Define the same spacing in x, y, and z using a single input for spacing. 3) Hexagonal Lattice: Define the type as hexagonal, then spacing defines the hexagonal close-packed lattice nearest neighbour distance.
#Example Bravais lattice with spacings 1, 2 and 3 :start geometry: library = egs_lattice name = phantom_w_microcavity base geometry = phantom subgeometry = microcavity subgeometry index = 0 spacing = 1 2 3 :stop geometry:
#Example cubic lattice with spacings 1 :start geometry: library = egs_lattice name = phantom_w_microcavity base geometry = phantom subgeometry = microcavity subgeometry index = 0 spacing = 1 :stop geometry:
#Example hexagonal lattice with nearest neighbour distance 1 :start geometry: library = egs_lattice type = hexagonal name = phantom_w_microcavity base geometry = phantom subgeometry = microcavity subgeometry index = 0 spacing = 1 :stop geometry:
Definition at line 145 of file egs_lattice.h.