EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
A radial geometry replicator. More...
#include <egs_iplanes.h>
Public Member Functions | |
EGS_RadialRepeater (const EGS_Vector &Xo, const EGS_Vector &A, int np, EGS_BaseGeometry *G, EGS_Float first=0, const string &Name="") | |
bool | isInside (const EGS_Vector &x) |
int | isWhere (const EGS_Vector &x) |
int | medium (int ireg) const |
int | inside (const EGS_Vector &x) |
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 | getMaxStep () const |
const string & | getType () const |
void | printInfo () const |
void | setRLabels (EGS_Input *input) |
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 | howfarToOutside (int ireg, const EGS_Vector &x, const EGS_Vector &u) |
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... | |
virtual bool | isRealRegion (int ireg) const |
Returnes true if ireg is a real region, false otherwise. More... | |
virtual int | computeIntersections (int ireg, int n, const EGS_Vector &x, const EGS_Vector &u, EGS_GeometryIntersections *isections) |
Calculates intersection distances to region boundaries. 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... | |
virtual EGS_Float | getRelativeRho (int ireg) const |
Get the relative mass density in region ireg. More... | |
virtual void | setRelativeRho (int start, int end, EGS_Float rho) |
Set the relative mass density in regions. More... | |
virtual void | setRelativeRho (EGS_Input *) |
Set the relative mass density from an user input. 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? | |
virtual EGS_Float | getBScaling (int ireg) const |
Get the B field scaling factor in region ireg. | |
virtual void | setBScaling (int start, int end, EGS_Float bf) |
Set the B field scaling factor in regions. More... | |
virtual void | setBScaling (EGS_Input *) |
Set the B field scaling factor from an user input. More... | |
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. | |
virtual bool | hasBooleanProperty (int ireg, EGS_BPType prop) const |
Is the boolean property prop set for region ireg ? | |
virtual void | setBooleanProperty (EGS_BPType prop) |
Set the boolean properties of the entire geometry to prop. More... | |
virtual void | addBooleanProperty (int bit) |
Add a boolean property for the entire geometry by setting the bit'th bit. More... | |
virtual void | setBooleanProperty (EGS_BPType prop, int start, int end, int step=1) |
Set the boolean properties of every step'th region between start and end (inclusive) to prop. More... | |
virtual void | addBooleanProperty (int bit, int start, int end, int step=1) |
Add a boolean property to every step'th region between start and end (inclusive) by setting the bit'th bit. More... | |
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 Attributes | |
EGS_IPlanes * | iplanes |
EGS_BaseGeometry * | g |
EGS_RotationMatrix * | R |
EGS_Vector | xo |
int | nrep |
int | ng |
EGS_Float | phi_o |
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. | |
Static Protected Attributes | |
static string | type = "EGS_RadialRepeater" |
Static Protected Attributes inherited from EGS_BaseGeometry | |
static int | error_flag = 0 |
Set to non-zero status if a geometry problem is encountered. | |
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 () |
Protected Member Functions inherited from EGS_BaseGeometry | |
virtual void | setMedia (EGS_Input *inp, int nmed, const int *med_ind) |
Set media. More... | |
A radial geometry replicator.
The main reason for the introduction of the EGS_RadialRepeater geometry is convenience when defining a rotationally repetitive structure. A EGS_RadialRepeater is a geometry where a base geometry is repeated times radially around an axis specified by the user. It is defined using
:start geometry: library = egs_iplanes type = EGS_RadialRepeater name = some_name axis = 0 0 0 0 0 1 # axis of rotation repeated geometry = some_geometry_name number of repetitions = N medium = medium_name first angle = phi_o
The first 3 inputs in the axis keyword specify a point through which the axis passes, the other 3 the axis direction (does not need to be normalized to unity). The repeated geometry
must specify the name of an existing geometry, which can be of any type as long as it fits completely within 1 radial segment after dividing space into equally large segments defined by planes intersecting in the specified axis (the EGS_RadialRepeater class uses internally an EGS_Iplanes geometry). Note that an EGS_RadialRepeater geometry is infinite, so one should inscribe it into a finite size geometry using a CD geometry for viewing with egs_view
. The medium
input specifies the medium with which the space outside of the replicated geometry is filled. It is optional and, if missing, vacuum is assumed. The 'th copy of the repeated geometry is rotated by around the rotation axis ( goes from 0 to ). The 'th copy must then fit within the 'th radial segment of the i-planes, which is between the planes with normals rotated by and around the axis or rotation and intersecting in the axis of rotation. This can be achieved by setting appropriately using the first angle
input (this input is optional and, if missing, is assumed). Obviously the proper choice of will depend on the location of the geometry to be replicated and on the rotation axis. One way to determine is to select a point inside the geometry to be replicated and to follow the transformations beeing made with particle positions and directions in the EGS_RadialRepeater geometry method. Another, perhaps easier, approach is to simply experiment with the value of until the replicated geometry looks as expected in the geometry viewer ( is typically a multiple of , unless you want to apply an extra rotation to the geometry to be replicated).
Examples of the use of an EGS_RadialRepeater geometry can be found in radial_repetitions.geom, radial_repetitions1.geom
and gear.geom
example input files.
A simple example:
:start geometry definition: # An EGS_RadialRepeater geometry takes the entire space. Thus, in # order to be able to view it, we need to limit its size. Here we # use a big box filled with vacuum and will later inscribe the # radial repetitions into this box using a CD geometry logic. :start geometry: name = my_box library = egs_box box size = 4 :stop geometry: # The geometry that will be repeated :start geometry: name = my_sphere library = egs_spheres midpoint = 1 0 0 radii = 0.2 :start media input: media = water :stop media input: :stop geometry: :start geometry: name = my_radial_repeater library = egs_iplanes type = EGS_RadialRepeater medium = vacuum repeated geometry = my_sphere # Axis position, direction axis = 0 0 1 0 0 1 number of repetitions = 8 :stop geometry: :start geometry: name = my_repetition_box library = egs_cdgeometry base geometry = my_box set geometry = 0 my_radial_repeater :stop geometry: simulation geometry = my_repetition_box :stop geometry definition:
Definition at line 341 of file egs_iplanes.h.