EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Public Member Functions | Protected Attributes | List of all members
EGS_RoundRectCylindersT< Tx, Ty > Class Template Reference

A set of concentric rounded rectangles. More...

#include <egs_roundrect_cylinders.h>

Inheritance diagram for EGS_RoundRectCylindersT< Tx, Ty >:
EGS_BaseGeometry

Public Member Functions

 ~EGS_RoundRectCylindersT ()
 Desctructor. More...
 
 EGS_RoundRectCylindersT (const vector< EGS_Float > &x_wid, const vector< EGS_Float > &y_wid, const vector< EGS_Float > &rad, const EGS_Vector &position, const string &Name, const Tx &A_x, const Ty &A_y)
 Construct a set of concentric rounded rectangles. More...
 
bool isInside (const EGS_Vector &src)
 
int isWhere (const EGS_Vector &x)
 
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 &src)
 
const string & getType () const
 
void printInfo () const
 
- 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 medium (int ireg) const
 Returns the medium index in region ireg. More...
 
virtual int getMaxStep () const
 Returns the maximum number of steps through the geometry. 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 > &regs)
 Get a list of all the regions labeled with a number.
 
virtual void getLabelRegions (const string &str, vector< int > &regs)
 Get the list of all regions labeled with str.
 
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_Float * ax
 Widths along the axis defined by Ax,.
 
EGS_Float * ay
 Widths along the axis defined by Ay,.
 
EGS_Float * ar
 Radii of roundings for each rect.
 
EGS_Vector xo
 A point on the cylinder axis.
 
Tx Ax
 The projection operator for the first ('x') axis.
 
Ty Ay
 The projection operator for the second ('y') axis.
 
string mytype
 The cylinder 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< labellabels
 Labels. More...
 
EGS_Applicationapp
 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_BaseGeometrycreateGeometry (EGS_Input *)
 Create a geometry (or geometries) from a given input. More...
 
static EGS_BaseGeometrycreateSingleGeometry (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_BaseGeometrygetGeometry (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...
 
- Static Protected Attributes inherited from EGS_BaseGeometry
static int error_flag = 0
 Set to non-zero status if a geometry problem is encountered.
 

Detailed Description

template<class Tx, class Ty>
class EGS_RoundRectCylindersT< Tx, Ty >

A set of concentric rounded rectangles.

This template class implements the geometry methods for a set of $N$ concentric founded rectangular cylinders which define a geometry of $N$ regions. It can be specialized to orient along the x-, y-, z-, or an arbitrary axis. Similar comments as in the case of planes apply for the motivation for having 4 different rounded rectangular cylinder classes. Although the cylinder axis by default passes through the origin, the point through which the main axis passes can be modified. Sets of cylinders at another location can be obtained by using a transformed geometry. The convention for region numbering is that the region inside the inner-most cylinder is region 0 with region index increasing towards the last cylinder in the set. Note also that the geometry defined by a set of rounded rectangular cylinders is unlimited in the direction along the cylinder axis.

The additional keys needed to construct a set of cylinders are

type = EGS_RoundRectCylinders or EGS_RoundRectCylindersXY or EGS_RoundRectCylindersYZ or EGS_RoundRectCylindersXZ
radii    = list of fillet radii
x-widths = list of cylinder half-widths in the x-direction
y-widths = list of cylinder half-widths in the y-direction
x-axis   = ax, ay, az
y-axis   = bx, by, bz
midpoint = px, py, pz

The x-axis and y-axis keys are only needed for an object of type EGS_RoundRectCylinders (and in fact are ignored for xz-, yz- or xz-cylinders). The axis vectors don't need to be normalized to unity.

Radii and half-widths need to be given in increasing order. Different rounded rectangles may not intersect.

A simple example:

:start geometry definition:

    ### a rounded rectangle cylinder
    :start geometry:
        name      = rounded_rect_cyl
        library   = egs_roundrect_cylinders
        type      = EGS_RoundRectCylindersXY
        x-widths  = 1 2
        y-widths  = 0.5 1
        radii     = 0.1 0.5
        :start media input:
            media = red green
            set medium = 1 1
        :stop media input:
    :stop geometry:

    ### planes to cut the cylinder
    :start geometry:
        name      = cd_planes
        library   = egs_planes
        type      = EGS_Zplanes
        positions = -2 2
    :stop geometry:

    ### cut cylinder with planes
    :start geometry:
        name      = rounded_rect
        library   = egs_cdgeometry
        base geometry = cd_planes
        set geometry  = 0 rounded_rect_cyl
    :stop geometry:

    ### simulation geometry
    simulation geometry = rounded_rect

:stop geometry definition:
egs_roundrect_cylinders.png
A simple rounded rectangle cylinders example

A more complex example of the usage of rounded rectangle cylinder sets can be found in the roundedrect_cylinders.geom sample geometry input file.

Definition at line 160 of file egs_roundrect_cylinders.h.

Constructor & Destructor Documentation

template<class Tx, class Ty>
EGS_RoundRectCylindersT< Tx, Ty >::~EGS_RoundRectCylindersT ( )

Desctructor.

Definition at line 178 of file egs_roundrect_cylinders.h.

template<class Tx, class Ty>
EGS_RoundRectCylindersT< Tx, Ty >::EGS_RoundRectCylindersT ( const vector< EGS_Float > &  x_wid,
const vector< EGS_Float > &  y_wid,
const vector< EGS_Float > &  rad,
const EGS_Vector position,
const string &  Name,
const Tx &  A_x,
const Ty &  A_y 
)

Construct a set of concentric rounded rectangles.

Construct a set of concentric rounded rectangles named Name using the projection operators A_x and A_y.

Parameters x_wid, y_wid, and rad should all have the same length and correspond to the half-widths in the projected x-direction and projected y-direction, as well as the radii of the fillets on the rectangles.

position is a point on the cylinder axis

Definition at line 198 of file egs_roundrect_cylinders.h.

References EGS_BaseGeometry::getType().


The documentation for this class was generated from the following file: