MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Hexagon Class Reference

Regular hexagon Shape of a given height. More...

#include <Hexagon.hxx>

Inheritance diagram for Hexagon:
Node Shape TReference

Public Member Functions

 Hexagon (double HalfHeight=0.005, double Side=0.01, double Signe=-1)
 Normal Constructor. More...
 
 Hexagon (const char *Infinite, double Side=0.01, double Signe=-1)
 Infinite Constructor. More...
 
 Hexagon (const Hexagon &h)
 Copy Constructor. More...
 
Shape_ptr Clone (int count=0)
 Clone a Shape. More...
 
virtual void Copy (Shape_ptr S)
 Copy all attributs of a Shape S (but not attributs of the father classes). More...
 
unsigned IsHexagon ()
 1 if Shape is a Hexagon More...
 
Get shape parameters
double GetWidth ()
 return the distance of 2 opposite hexagon sides More...
 
double GetSide ()
 return the length of a hexagon side More...
 
double GetHalfHeight ()
 return the 1/2 height of an hexagon More...
 
double GetOrigin (int i)
 returns the origin of the hexagon More...
 
double * GetOrigin ()
 returns the origin of the hexagon More...
 
void SetPeriodicBoundary (bool state=true, string TopBottPlaneBC="mirror")
 Periodic boundary (WARNING: only for Brick and Hexagon). More...
 
virtual void SetTopBottomPlanesOpen ()
 The top/bottom planes are NOT mirrors. More...
 
virtual void SetSidePlanesOpen ()
 The side planes are NOT mirrors. More...
 
Shape_ptr GetBoundingShape ()
 Returns the bounding shape of the hexagon, even if null. More...
 
Shape_ptr GetIncludedShape ()
 Returns the included shape of the hexagon, even if null. More...
 
Relations with other shapes
unsigned Inclus (Shape_ptr OtherShape)
 +1 this is included in OtherShape, 0 not included or don't know. More...
 
unsigned Disjoint (Shape_ptr OtherShape)
 +1 this is disjointed in OtherShape, 0 not included or don't know. More...
 
Shape transformations
virtual void Translate (double dx, double dy, double dz, int count=0)
 Translate the Shape by (dx,dy,dz). More...
 
virtual void Rotate (double phi, double theta=0, double psi=0, double *center=0, int count=0)
 Rotate the Shape clockwise. More...
 
Miscellaneous methods
double GetVirtualSphereRadius ()
 returns the radius of a Sphere containing the Shape More...
 
double * GetVirtualSphereCenter ()
 returns the center of a Sphere containing the Shape More...
 
virtual string Print ()
 Print the Node surface in MCNP cell. More...
 
void CalculNot ()
 Allocates and calculs the complement of Shape. More...
 
- Public Member Functions inherited from Node
 Node (double Signe=+1)
 
 Node (const Node &n)
 Copy constructor. More...
 
 ~Node ()
 Normal destrutor. More...
 
unsigned IsNode ()
 +1 for a Node More...
 
unsigned IsFullVoid ()
 1 if the Node is void or full. More...
 
unsigned IsVoid ()
 1 if the node is void. More...
 
unsigned IsFull ()
 1 if the node is Full. More...
 
double GetVolume ()
 return the Volume of a Node More...
 
Shape_ptr GetLeaf (int i)
 returns the i-th leaf (Shape) of a Node More...
 
int GetNumberOfLeaves ()
 returns the number of leaves (Shape) of a Node More...
 
unsigned Add (Shape_ptr OtherShape)
 Add a new Shape (in fact a Shape_ptr) to a Node. More...
 
void SetBoundingShape (Shape_ptr theShape)
 Declare a bounding shape. More...
 
Shape_ptr GetBoundingShape ()
 return the BoundingShape if exist More...
 
void SetIncludedShape (Shape_ptr theShape)
 Declare an included shape. More...
 
Shape_ptr GetIncludedShape ()
 return the IncludedShape if exist More...
 
virtual void SetMirrorBoundary (bool state=true)
 mirror a particle on the surface More...
 
virtual bool GetTopBottomPlanesOpen ()
 Get Top and bottom planes open. More...
 
virtual bool GetSidePlanesOpen ()
 Get The side planes open. More...
 
virtual void SetWhiteBoundary (bool state=true)
 mirror a particle on the surface with a cosine distribution More...
 
virtual unsigned Contain (Shape_ptr OtherShape)
 +1 this is contains in OtherShape, 0 not included or don't know. More...
 
void Simplify (bool violent=false)
 Simplify a tree of Node. More...
 
void ElagueRoot ()
 Trims a tree with a Chain Saw. More...
 
virtual void UnSetMouvement ()
 Set the fMouvement flag to false;. More...
 
void ClearVectorShape (int UMVT=0)
 Clear VectorShape. More...
 
void SetUniverse (int u=0)
 Set the Universe number for a shape used in a lattice. More...
 
void AlreadyDefine (bool state=true)
 Set a flag to know wheter a surface is already defined. More...
 
bool PointInShape (double *P, int border)
 true if the point P is in the Shape. More...
 
void PrintX (int count=0)
 Debug method: Print the shape surface when fMouvement=true. More...
 
void PrintY (int count=0)
 Debug method: Print the shape surfaces, InsideShape,... More...
 
virtual void ReplaceNode (Shape_ptr C)
 Replace a Node by an other (C must be a Node) More...
 
int NumberOfShapes ()
 return the number of Shapes contains in a Node More...
 
- Public Member Functions inherited from Shape
 Shape ()
 Default constructor. The interior of a Shape is built. More...
 
 Shape (const Shape &s)
 Copy constructor. More...
 
virtual ~Shape ()
 Normal destructor. More...
 
double GetSigne ()
 Return -1 if the Shape exterior is considered, +1 otherwise. More...
 
void SetSigne (double s)
 
void SetOutermostShape (bool flag=true)
 Say that this Shape is the most outer one. More...
 
bool IsInfinite ()
 Return 1 if the Shape is an axially infinite one (??? why not resolve thru inheritance as same as shape type?) More...
 
virtual unsigned IsBrick ()
 1 if Shape is a Brick More...
 
virtual unsigned IsCylinder ()
 1 if Shape is a Cylinder More...
 
virtual unsigned IsPlane ()
 1 if Shape is a Plane More...
 
virtual unsigned IsSphere ()
 1 if Shape is a Sphere More...
 
virtual unsigned IsTube ()
 1 if Shape is a Tube More...
 
virtual double GetSurface ()
 Get the Surface of a Shape. More...
 
void SetVolume (double V)
 Set the volume of a Shape to V. More...
 
void SetSurface (double S)
 Set the surface of a Shape to S. More...
 
virtual bool IsMirrorBoundary ()
 mirror a particle on the surface More...
 
virtual bool IsWhiteBoundary ()
 mirror a particle on the surface with a cosine distribution More...
 
virtual bool IsPeriodicBoundary ()
 Periodic boundary (only for Brick or Hexagon) More...
 
Shape_ptr Not ()
 Return the complementary Shape (i.e. the other side) More...
 
void RotateVector (double *V, double phi, double theta=0, double psi=0)
 Rotate a Vector clockwise. ??? why a shape member? More...
 
void RotatePoint (double *P, double phi, double theta=0, double psi=0, double *center=0)
 Rotate a Point clockwise.??? why a shape member? More...
 
virtual void SetMouvement (bool state=true)
 Set the fMouvement flag to state;. More...
 
bool GetMouvement ()
 returns fMouvement flag; More...
 
unsigned AddInsideShape (Shape_ptr OtherShape)
 Add a Shape in fInsideShape each time a "put in" is done. More...
 
unsigned AddOriginalInsideShape (Shape_ptr OtherShape)
 This method is called by Shape::AddInsideShape. More...
 
void ClearOriginalInsideShape ()
 Clear all Inside Shapes. More...
 
void ClearInsideShape ()
 Clear all Inside Shapes. More...
 
unsigned GetInsideShapeSize ()
 return the number of Shape put in this More...
 
unsigned GetOriginalInsideShapeSize ()
 return the number of Original Shape put in this More...
 
void SetInsideShape (int i, Shape_ptr S)
 set the ith InsideShape put in to S More...
 
void SetOriginalInsideShape (int i, Shape_ptr S)
 set the ith Original InsideShape put in to S More...
 
Shape_ptr GetInsideShape (int i)
 return the ith InsideShape put in this More...
 
Shape_ptr GetOriginalInsideShape (int i)
 return the ith Original InsideShape put in this More...
 
virtual string PrintSurface ()
 Print the Shape surfaces in MCNP surface block. More...
 
void SetClone (Shape_ptr clone)
 Set the CloneShape to clone. More...
 
void SetClone2Not ()
 Set the CloneShape to a Not. More...
 
void AddSurfaceNumber (int i)
 Give the vector of Surface of the Shape. More...
 
vector< int > GetSurfaceNumber ()
 Give the vector of Surface of the Shape. More...
 
virtual void DefineSurface ()
 Define MCNP surfaces for this Shape. More...
 
virtual void SetFill (int f)
 Set the Universe number filling a Shape. More...
 
int GetUniverse ()
 return the Univers number if exists. More...
 
int GetFill ()
 return the Univers number that fills the Shape. More...
 
void IncrementSurface (double S)
 Increment the surface of a Shape of S. More...
 
void NewNot ()
 Update the Not. More...
 
virtual void SetLinkedPlane (Shape_ptr P)
 linked plane for periodic boundary More...
 
double PS (double *U, double *V)
 Scalar product of 3D vectors U and V. More...
 
string GetName ()
 returns the Shape name More...
 
void SetZone (int z)
 set test flag for complex geometries More...
 
int GetZone ()
 get test flag for complex geometries More...
 
- Public Member Functions inherited from TReference
 TReference ()
 Default constructor. Number of references is set to 0. More...
 
virtual ~TReference ()
 Destructor. More...
 
void AddReference (unsigned n=1)
 Add n references to an object. More...
 
unsigned DelReference (unsigned n=1)
 Remove n references to an object. More...
 
unsigned Reference ()
 returns the Number of references to an object More...
 

Protected Member Functions

 Hexagon (double HalfHeight, double Side, double Signe, bool Infinite)
 Private constructor needed to copy an Hexagon in methods. More...
 
bool IsSameAxis (Hexagon *hexagon)
 whether or not 2 hexagons have same z-axis and planes More...
 
- Protected Member Functions inherited from Node
void RemoveSurface ()
 Removed unused surface from gMURE. More...
 
void Remove (vector< Shape_ptr >::iterator Iterator)
 remove a vector element More...
 
- Protected Member Functions inherited from Shape
void SetNot (Shape *Not)
 Allocates and calculs the complement of Shape. More...
 
void SetNotofNot ()
 Give a Not to the Not. More...
 
void UpdateSurface (Surface *&S)
 Add (if not exists) the surface S to MURE::fSurfaceVector. More...
 

Protected Attributes

double fHalfHeight
 Half height of the Hexagon. More...
 
double fSide
 length of Hexagon side. More...
 
double fOrigin [3]
 Origin of the Hexagon. More...
 
- Protected Attributes inherited from Node
vector< Shape_ptrfShapeVector
 a vector of Shape_ptr of a Node More...
 
vector< Shape_ptrfDestroyShape
 a vector of destroyed Shape_ptr of a Node (for UnSetMouvement()) More...
 
Shape_ptr fBoundingShape
 Shape containing the Node, 0 for none. More...
 
Shape_ptr fIncludedShape
 Shape included in the Node, 0 for none. More...
 
bool fTube
 true if the Node is a Tube More...
 
bool fHexagon
 true if the Node is an Hexagon More...
 
int fCount
 count flag to unset mvt More...
 
- Protected Attributes inherited from Shape
vector< int > fSurfaceNumber
 number(s) of Surface(s) defining the Shape More...
 
vector< Shape_ptrfInsideShape
 a vector to remember which Shapes are inside the current one.Clear at each ">>" More...
 
vector< Shape_ptrfOriginalInsideShape
 a vector to remember which Shapes are inside the current one. More...
 
double fSigne
 Define whether the interior (-1) or the exterior (+1) of the Shape is considered. More...
 
bool fInfinite
 Determines whether the shape is infinite or not. More...
 
ShapefNot
 pointer on complementary Shape if exists, else 0. More...
 
bool fAlreadyDefine
 Flag to know whether a surface is already defined. More...
 
bool fMouvement
 Flag that indicate a Shape is in mouvement (translation,..) in a tree. More...
 
int fUniverse
 Universe number (for lattice filling) More...
 
int fFill
 Universe number that fill the Shape. More...
 
double fVolume
 the Volume of a Shape; More...
 
double fSurface
 the Surface of a Shape; More...
 
string fName
 Name of a Shape. More...
 
double fVirtualSphereR
 the radius of a Sphere containing the Shape More...
 
double * fVirtualSphereO
 the center of a Sphere containing the Shape More...
 
Shape_ptr fCloneShape
 the clone of a Shape More...
 
bool fMirrorBoundary
 wether or not mirror a particle on the surface More...
 
bool fOpenZPlanes
 whether the top/bottom planes are not mirrors (default=false) More...
 
bool fOpenXYPlanes
 whether the side planes are not mirrors (default=false) More...
 
bool fWhiteBoundary
 wether or not mirror a particle on the surface with a cosine distribution More...
 
bool fPeriodicBoundary
 wether or not Periodic boundary are applied (only for plane) More...
 
string fTopBottPlaneBoundaryCondition
 wether the top(bottom) plane of a periodic boundary Shape is white or mirror More...
 
Shape_ptr fLinkedPlane
 the Plane linked to an this for periodic boundary More...
 
bool fOutermostShape
 wether or not this Shape is the limit to the exterior world (for calculating particle losses). More...
 
int fZone
 flag for identifying complex geometries (test fms) More...
 

Detailed Description

Regular hexagon Shape of a given height.

Default Hexagon is the interior of a vertical Hexagon center at origin of 0.01m high and 0.01m length side

Author
PTO
Version
1.0

Constructor & Destructor Documentation

Hexagon::Hexagon ( double  HalfHeight = 0.005,
double  Side = 0.01,
double  Signe = -1 
)

Normal Constructor.

Default: Interior of a vertical Hexagon center at origin of 0.01m high and 0.01m length side.

Rem: To build a hexagon of width W (distance between 2 opposite planes) the Side should be set to

\[ Side=\frac{W}{\sqrt(3)}\]

.

Parameters
HalfHeight: Half height of the Hexagon
Side: length of Hexagon side.
Signe: whether interior of the Tube is considered (-1) or exterior (+1)
Hexagon::Hexagon ( const char *  Infinite,
double  Side = 0.01,
double  Signe = -1 
)

Infinite Constructor.

Default: Interior of a vertical Hexagon center at origin of infinite height and 0.01m length side.

Rem: To build a hexagon of width W (distance between 2 opposite planes) the Side should be set to

\[ Side=\frac{W}{\sqrt(3)}\]

.

Parameters
Infinite: any string between "" (for resolution of overload)
Side: length of Hexagon side.
Signe: whether interior of the Hexagon is considered (-1) or exterior (+1)
Hexagon::Hexagon ( const Hexagon h)

Copy Constructor.

Hexagon::Hexagon ( double  HalfHeight,
double  Side,
double  Signe,
bool  Infinite 
)
protected

Private constructor needed to copy an Hexagon in methods.

Member Function Documentation

void Hexagon::CalculNot ( )
virtual

Allocates and calculs the complement of Shape.

Reimplemented from Node.

Shape_ptr Hexagon::Clone ( int  count = 0)
virtual

Clone a Shape.

Reimplemented from Node.

void Hexagon::Copy ( Shape_ptr  S)
virtual

Copy all attributs of a Shape S (but not attributs of the father classes).

Reimplemented from Shape.

unsigned Hexagon::Disjoint ( Shape_ptr  OtherShape)
virtual

+1 this is disjointed in OtherShape, 0 not included or don't know.

Reimplemented from Node.

Shape_ptr Hexagon::GetBoundingShape ( )

Returns the bounding shape of the hexagon, even if null.

double Hexagon::GetHalfHeight ( )
inline

return the 1/2 height of an hexagon

Shape_ptr Hexagon::GetIncludedShape ( )

Returns the included shape of the hexagon, even if null.

double Hexagon::GetOrigin ( int  i)
inline

returns the origin of the hexagon

double* Hexagon::GetOrigin ( )
inline

returns the origin of the hexagon

double Hexagon::GetSide ( )
inline

return the length of a hexagon side

double* Hexagon::GetVirtualSphereCenter ( )
inlinevirtual

returns the center of a Sphere containing the Shape

Reimplemented from Node.

double Hexagon::GetVirtualSphereRadius ( )
virtual

returns the radius of a Sphere containing the Shape

Reimplemented from Node.

double Hexagon::GetWidth ( )
inline

return the distance of 2 opposite hexagon sides

unsigned Hexagon::Inclus ( Shape_ptr  OtherShape)
virtual

+1 this is included in OtherShape, 0 not included or don't know.

Reimplemented from Node.

unsigned Hexagon::IsHexagon ( )
inlinevirtual

1 if Shape is a Hexagon

Reimplemented from Shape.

bool Hexagon::IsSameAxis ( Hexagon hexagon)
protected

whether or not 2 hexagons have same z-axis and planes

string Hexagon::Print ( )
virtual

Print the Node surface in MCNP cell.

Reimplemented from Node.

void Hexagon::Rotate ( double  phi,
double  theta = 0,
double  psi = 0,
double *  center = 0,
int  count = 0 
)
virtual

Rotate the Shape clockwise.

Parameters
phi: around z axis
theta: around y axis
psi: around x axis
center: pivot of rotation (Default=origin)
count: recursive transformation depth counter

Reimplemented from Node.

void Hexagon::SetPeriodicBoundary ( bool  state = true,
string  TopBottPlaneBC = "mirror" 
)
virtual

Periodic boundary (WARNING: only for Brick and Hexagon).

Please read carefully the MCNP user guide before using these conditions.

Parameters
state: = true or false to allow periodic condition
TopBottPlaneBC: The Top/Bottom planes of the Brick or Hexagon boundary conditions ; Possible values are
TopBottPlaneBC: ="mirror" : The Top/Bottom planes are reflecting surfaces (Default)
TopBottPlaneBC: ="white" : The Top/Bottom planes are white boundaries
TopBottPlaneBC: ="infinite" : The Top/Bottom planes are infinite (not yet implemented)

Reimplemented from Shape.

void Hexagon::SetSidePlanesOpen ( )
virtual

The side planes are NOT mirrors.

Reimplemented from Node.

void Hexagon::SetTopBottomPlanesOpen ( )
virtual

The top/bottom planes are NOT mirrors.

Reimplemented from Node.

void Hexagon::Translate ( double  dx,
double  dy,
double  dz,
int  count = 0 
)
virtual

Translate the Shape by (dx,dy,dz).

Parameters
dx: translation along x-axis
dy: translation along y-axis
dz: translation along z-axis
count: recursive transformation depth counter

Reimplemented from Node.

Member Data Documentation

double Hexagon::fHalfHeight
protected

Half height of the Hexagon.

double Hexagon::fOrigin[3]
protected

Origin of the Hexagon.

double Hexagon::fSide
protected

length of Hexagon side.


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

MURE Project, documentation generated by Doxygen 1.8.5 - Mon Nov 17 2014