MURE
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MathNode Class Reference

MathNode allows to construct Union or Intersection of Shape. More...

#include <MathNode.hxx>

Inheritance diagram for MathNode:
Shape TReference MCNP::Node MathHexagon MathTube Serpent::Node MCNP::Hexagon MCNP::Tube MCNP::Hexagon Serpent::Hexagon MCNP::Tube Serpent::Tube Serpent::Hexagon Serpent::Tube

Public Member Functions

 MathNode (int Sign=+1)
 
 MathNode (const MathNode &n)
 Copy constructor.
 
 ~MathNode () override
 Normal destrutor.
 
Shape_ptr Clone (int count=0) override
 Clone a Shape.
 
Node parameters
unsigned IsNode () override
 
unsigned IsFullVoid () override
 
unsigned IsVoid () override
 
unsigned IsFull () override
 
double GetVolume () override
 return the Volume of a Node
 
Shape_ptr GetLeaf (int i) override
 
int GetNumberOfLeaves () override
 
unsigned Add (Shape_ptr OtherShape) override
 Add a new Shape (in fact a Shape_ptr) to a Node.
 
void ReplaceLeaf (int i, Shape_ptr OtherShape) override
 replace the ith leaf of a Node.
 
void SetBoundingShape (Shape_ptr theShape)
 Declare a bounding shape.
 
Shape_ptr GetBoundingShape ()
 
void SetIncludedShape (Shape_ptr theShape)
 Declare an included shape.
 
Shape_ptr GetIncludedShape ()
 
void SetMirrorBoundary (bool state=true) override
 mirror a particle on the surface
 
void SetWhiteBoundary (bool state=true) override
 mirror a particle on the surface with a cosine distribution
 
void SetTopBottomPlanesOpen () override
 The top/bottom planes are NOT mirrors.
 
void SetSidePlanesOpen () override
 The side planes are NOT mirrors.
 
Shape transformations
void Translate (double dx, double dy, double dz, int count=0) override
 Translate the Node of (dx, dy, dz).
 
void Rotate (double phi, double theta=0, double psi=0, double *center=nullptr, int count=0) override
 Rotate the Node clockwise.
 
Relations with other shapes
unsigned IsIncluded (Shape_ptr OtherShape) override
 +1 this is included in OtherShape, 0 not included or don't know.
 
unsigned IsDisjoint (Shape_ptr OtherShape) override
 +1 this is disjoint in OtherShape, 0 not included or don't know.
 
virtual unsigned Contain (Shape_ptr OtherShape)
 +1 this contains the OtherShape, 0 not included or don't know.
 
Miscellaneous methods
void SetUniverse (int u=0) override
 Set the Universe number for a shape used in a lattice.
 
double GetVirtualSphereRadius () override
 returns the radius of a Sphere containing the Shape
 
double * GetVirtualSphereCenter () override
 
bool PointInShape (double *P, int border) override
 true if the point P is in the Shape.
 
void PrintX (int count=0) override
 Debug method: Print the shape surface when fMouvement=true.
 
void PrintY (int count=0) override
 Debug method: Print the shape surfaces, InsideShape, ...
 
void ReplaceNode (Shape_ptr C) override
 Replace a Node by an other (C must be a Node)
 
int NumberOfShapes () override
 return the number of Shapes contains in a Node
 
void CalculNot () override
 Allocates and calculs the complement of Shape.
 
void Simplify (bool violent=false) override
 Simplify a tree of Node.
 
void ResetIsDefinedSurfaceCalled () override
 
- Public Member Functions inherited from Shape
 Shape ()
 Default constructor. The interior of a Shape is built.
 
 Shape (const Shape &s)
 Copy constructor.
 
 ~Shape () override
 Normal destructor.
 
Shape_ptr Not ()
 Return the complementary Shape (i.e. the other side)
 
void NewNot ()
 
void SetClone (Shape_ptr clone)
 
void SetClone2Not ()
 Set the CloneShape to a Not.
 
int GetSign ()
 
void SetSign (int s)
 
void SetOutermostShape (bool flag=true)
 Say that this Shape is the most outer one.
 
virtual unsigned IsBrick ()
 
virtual unsigned IsCylinder ()
 
virtual unsigned IsHexagon ()
 
virtual unsigned IsPlane ()
 
virtual unsigned IsSphere ()
 
virtual unsigned IsTube ()
 
virtual unsigned IsZTorus ()
 
bool IsInfinite ()
 
void SetVolume (double V)
 
virtual double GetArea ()
 Get the Area of a Shape.
 
void SetArea (double S)
 
virtual bool IsTopBottomPlanesOpen ()
 
virtual bool IsSidePlanesOpen ()
 
virtual void SetPeriodicBoundary (bool state=true, string TopBottPlaneBC="mirror")
 Periodic boundary (WARNING: only for Brick and Hexagon).
 
virtual bool IsMirrorBoundary ()
 
virtual bool IsWhiteBoundary ()
 
virtual bool IsPeriodicBoundary ()
 
unsigned AddInsideShape (Shape_ptr OtherShape)
 Add a Shape in fInsideShape each time a "put in" is done.
 
unsigned AddOriginalInsideShape (Shape_ptr OtherShape)
 This method is called by Shape::AddInsideShape.
 
void ClearOriginalInsideShape ()
 
void ClearInsideShape ()
 
unsigned GetInsideShapeSize ()
 
unsigned GetOriginalInsideShapeSize ()
 
void SetInsideShape (int i, Shape_ptr S)
 
void SetOriginalInsideShape (int i, Shape_ptr S)
 
Shape_ptr GetInsideShape (int i)
 
Shape_ptr GetOriginalInsideShape (int i)
 
virtual void Copy (Shape_ptr S)
 Copy all attributs of a Shape S (but not attributs of the father classes).
 
string GetShapeName ()
 returns the Shape name
 
void SetDebugName (string str)
 
string GetDebugName ()
 
virtual void SetFill (int f)
 
int GetFill ()
 
int GetUniverse ()
 
void IncrementSurface (double S)
 
virtual string Print ()
 
virtual void SetLinkedPlane (Shape_ptr P)
 
virtual SurfaceCardGetSurfaceCard ()
 
virtual SurfaceCardGetSurfaceCard (int i)
 
virtual void SetMouvement (bool state=true)
 
bool GetMouvement ()
 
void SetViolentSimplify (bool Allowed=true)
 Enable/disable violent simplification a certain shapes to avoid "union" (for Serpent outside)
 
void SetFreezeSimplify (bool flag=true)
 Enable/disable simplification a certain nodes to avoid "union" (for Serpent outside)
 
bool IsViolentSimplifyAllowed ()
 
virtual int GetMonoSurfaceType ()
 
void SetInfinite ()
 
- Public Member Functions inherited from TReference
 TReference ()
 
virtual ~TReference ()=default
 Destructor.
 
void AddReference (unsigned n=1)
 
unsigned DelReference (unsigned n=1)
 
unsigned Reference ()
 

Node simplification methods

vector< Shape_ptrfShapeVector
 a vector of Shape_ptr of a Node
 
vector< Shape_ptrfDestroyShape
 a vector of destroyed Shape_ptr of a Node (for UnSetMouvement())
 
Shape_ptr fBoundingShape
 Shape containing the Node, 0 for none.
 
Shape_ptr fIncludedShape
 Shape included in the Node, 0 for none.
 
bool fTube
 true if the Node is a Tube
 
bool fHexagon
 true if the Node is an Hexagon
 
int fCount
 count flag to unset mvt
 
virtual void ElagueRoot ()
 Trims a tree with a Chain Saw.
 
void DevElague (int count=0, bool violent=false) override
 Developps and Trims a tree of Node.
 
void UnSetMouvement () override
 Set the fMouvement flag to false;.
 
virtual void ClearVectorShape (int UMVT=0)
 Clear VectorShape.
 
MathNodeCreateNewInstance (int sign=1) override
 a new MathNode instance.
 
void RemoveSurface () override
 Removed unused surface from gMURE.
 
void Remove (vector< Shape_ptr > ::iterator Iterator)
 remove a vector element
 

Additional Inherited Members

- Protected Member Functions inherited from Shape
virtual void MinimumCopy (Shape *S)
 Copy all attributs of a Shape S (but not attributs of the father classes).
 
void SetNot (Shape *aNot)
 Allocates and calculs the complement of Shape.
 
void SetNotofNot ()
 
- Protected Attributes inherited from Shape
vector< Shape_ptrfInsideShape
 a vector to remember which Shapes are inside the current one.Clear at each ">>"
 
vector< Shape_ptrfOriginalInsideShape
 a vector to remember which Shapes are inside the current one.
 
int fSign
 Define whether the interior (-1) or the exterior (+1) of the Shape is considered.
 
bool fInfinite
 Determines whether the shape is infinite or not.
 
ShapefNot
 pointer on complementary Shape if exists, else 0.
 
bool fMouvement
 Flag that indicate a Shape is in mouvement (translation, ..) in a tree.
 
int fUniverse
 Universe number (for lattice filling)
 
int fFill
 Universe number that fill the Shape.
 
double fVolume
 the Volume of a Shape;
 
double fArea
 the area of a Shape;
 
string fShapeName
 Name of a Shape.
 
string fDebugName
 Debug Name of a Shape.
 
double fVirtualSphereR
 the radius of a Sphere containing the Shape
 
double * fVirtualSphereO
 the center of a Sphere containing the Shape
 
Shape_ptr fCloneShape
 the clone of a Shape
 
bool fMirrorBoundary
 whether or not mirror a particle on the surface
 
bool fOpenZPlanes
 whether the top/bottom planes are not mirrors (default=false)
 
bool fOpenXYPlanes
 whether the side planes are not mirrors (default=false)
 
bool fWhiteBoundary
 whether or not mirror a particle on the surface with a cosine distribution
 
bool fPeriodicBoundary
 whether or not Periodic boundary are applied (only for plane)
 
string fTopBottPlaneBoundaryCondition
 whether the top(bottom) plane of a periodic boundary Shape is white or mirror
 
Shape_ptr fLinkedPlane
 the Plane linked to an this for periodic boundary
 
bool fIsViolentSimplifyAllowed
 whether or not a "violent simplification is allowed (ie a Node or a Brick are allowed to be separated)
 
bool fOutermostShape
 whether or not this Shape is the limit to the exterior world (for calculating particle losses).
 
bool fFreezeSimplify
 disable any Node simplification (for serpent in ReactorAssembly)
 

Detailed Description

MathNode allows to construct Union or Intersection of Shape.

Thus MathNode is a tree of union (OR) or intersection (AND) of Shape. In a Node, fSign=+1 for OR and fSign=-1 for AND. A Node is said full (the whole space) when it is the intersection of nothing, whereas it is said void when it is the union of nothing (empty set). MathNodes are never directly called by the user ; he/she just used the croncrete class Node which is linked either to MCNP or to Serpent.

Author
WEC
PTO
J. Hajnrych
Version
2.0

Constructor & Destructor Documentation

◆ MathNode() [1/2]

MathNode::MathNode ( int  Sign = + 1)

Normal constructor for a Node (default : OR).

Parameters
Sign: +1 for an Union (OR) and -1 for ans Intersection (AND)

◆ MathNode() [2/2]

MathNode::MathNode ( const MathNode n)

Copy constructor.

◆ ~MathNode()

MathNode::~MathNode ( )
override

Normal destrutor.

Member Function Documentation

◆ Add()

unsigned MathNode::Add ( Shape_ptr  OtherShape)
overridevirtual

Add a new Shape (in fact a Shape_ptr) to a Node.

Reimplemented from Shape.

◆ CalculNot()

void MathNode::CalculNot ( )
overridevirtual

Allocates and calculs the complement of Shape.

Reimplemented from Shape.

Reimplemented in MathTube.

◆ ClearVectorShape()

void MathNode::ClearVectorShape ( int  UMVT = 0)
protectedvirtual

Clear VectorShape.

◆ Clone()

Shape_ptr MathNode::Clone ( int  count = 0)
overridevirtual

Clone a Shape.

Implements Shape.

Reimplemented in MathTube.

◆ Contain()

unsigned MathNode::Contain ( Shape_ptr  OtherShape)
virtual

+1 this contains the OtherShape, 0 not included or don't know.

◆ CreateNewInstance()

MathNode * MathNode::CreateNewInstance ( int  sign = 1)
overrideprotectedvirtual

a new MathNode instance.

Implements Shape.

Reimplemented in MathTube, MCNP::Node, MCNP::Tube, Serpent::Node, and Serpent::Tube.

◆ DevElague()

void MathNode::DevElague ( int  count = 0,
bool  violent = false 
)
overrideprotectedvirtual

Developps and Trims a tree of Node.

Must be overriden

Reimplemented from Shape.

◆ ElagueRoot()

void MathNode::ElagueRoot ( )
protectedvirtual

Trims a tree with a Chain Saw.

Not recursive.

◆ GetBoundingShape()

Shape_ptr MathNode::GetBoundingShape ( )
inline

< return the BoundingShape if exist

◆ GetIncludedShape()

Shape_ptr MathNode::GetIncludedShape ( )
inline

< return the IncludedShape if exist

◆ GetLeaf()

Shape_ptr MathNode::GetLeaf ( int  i)
inlineoverridevirtual

< returns the i-th leaf (Shape) of a Node

Reimplemented from Shape.

◆ GetNumberOfLeaves()

int MathNode::GetNumberOfLeaves ( )
inlineoverridevirtual

< returns the number of leaves (Shape) of a Node

Reimplemented from Shape.

◆ GetVirtualSphereCenter()

double * MathNode::GetVirtualSphereCenter ( )
inlineoverridevirtual

< returns the center of a Sphere containing the Shape

Reimplemented from Shape.

Reimplemented in MathTube.

◆ GetVirtualSphereRadius()

double MathNode::GetVirtualSphereRadius ( )
overridevirtual

returns the radius of a Sphere containing the Shape

Reimplemented from Shape.

Reimplemented in MathTube.

◆ GetVolume()

double MathNode::GetVolume ( )
overridevirtual

return the Volume of a Node

Reimplemented from Shape.

◆ IsDisjoint()

unsigned MathNode::IsDisjoint ( Shape_ptr  OtherShape)
overridevirtual

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

Implements Shape.

Reimplemented in MathTube.

◆ IsFull()

unsigned MathNode::IsFull ( )
inlineoverridevirtual

< 1 if the node is Full.

Reimplemented from Shape.

◆ IsFullVoid()

unsigned MathNode::IsFullVoid ( )
inlineoverridevirtual

< 1 if the Node is void or full.

Reimplemented from Shape.

◆ IsIncluded()

unsigned MathNode::IsIncluded ( Shape_ptr  OtherShape)
overridevirtual

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

Implements Shape.

Reimplemented in MathTube.

◆ IsNode()

unsigned MathNode::IsNode ( )
inlineoverridevirtual

< +1 for a Node

Reimplemented from Shape.

◆ IsVoid()

unsigned MathNode::IsVoid ( )
inlineoverridevirtual

< 1 if the node is void.

Reimplemented from Shape.

◆ NumberOfShapes()

int MathNode::NumberOfShapes ( )
overridevirtual

return the number of Shapes contains in a Node

Reimplemented from Shape.

◆ PointInShape()

bool MathNode::PointInShape ( double *  P,
int  border 
)
overridevirtual

true if the point P is in the Shape.

Parameters
P: a (x, y, z) point of space
border: =-1 : if P is at the Shape surface then P is inside or =+1 : if P is at the Shape surface then P is outside

Reimplemented from Shape.

◆ PrintX()

void MathNode::PrintX ( int  count = 0)
overridevirtual

Debug method: Print the shape surface when fMouvement=true.

Reimplemented from Shape.

◆ PrintY()

void MathNode::PrintY ( int  count = 0)
overridevirtual

Debug method: Print the shape surfaces, InsideShape, ...

Reimplemented from Shape.

◆ Remove()

void MathNode::Remove ( vector< Shape_ptr > ::iterator  Iterator)
protected

remove a vector element

◆ RemoveSurface()

void MathNode::RemoveSurface ( )
overrideprotectedvirtual

Removed unused surface from gMURE.

Reimplemented from Shape.

◆ ReplaceLeaf()

void MathNode::ReplaceLeaf ( int  i,
Shape_ptr  OtherShape 
)
overridevirtual

replace the ith leaf of a Node.

Reimplemented from Shape.

◆ ReplaceNode()

void MathNode::ReplaceNode ( Shape_ptr  C)
overridevirtual

Replace a Node by an other (C must be a Node)

Reimplemented from Shape.

◆ ResetIsDefinedSurfaceCalled()

void MathNode::ResetIsDefinedSurfaceCalled ( )
overridevirtual

Reimplemented from Shape.

◆ Rotate()

void MathNode::Rotate ( double  phi,
double  theta = 0,
double  psi = 0,
double *  center = nullptr,
int  count = 0 
)
overridevirtual

Rotate the Node clockwise.

Parameters
phi: arround z axis
theta: arround y axis
psi: arround x axis
center: the center of rotation (Default=origin)
count: normal used is default (=0) ; usefull to know the recursion depth

Implements Shape.

◆ SetBoundingShape()

void MathNode::SetBoundingShape ( Shape_ptr  theShape)

Declare a bounding shape.

This may be very usefull when a "closed" Node is built to know if the Node is inlcuded or disjoint of an other Shape.

Parameters
theShape: the Shape (Shape_ptr) bounding the Node

◆ SetIncludedShape()

void MathNode::SetIncludedShape ( Shape_ptr  theShape)

Declare an included shape.

This may be very usefull when a "closed" Node is built to know if the Node is inlcuded or disjoint of an other Shape.

Parameters
theShape: the Shape (Shape_ptr) that is included by the Node

◆ SetMirrorBoundary()

void MathNode::SetMirrorBoundary ( bool  state = true)
overridevirtual

mirror a particle on the surface

Reimplemented from Shape.

◆ SetSidePlanesOpen()

void MathNode::SetSidePlanesOpen ( )
overridevirtual

The side planes are NOT mirrors.

Reimplemented from Shape.

Reimplemented in MathTube.

◆ SetTopBottomPlanesOpen()

void MathNode::SetTopBottomPlanesOpen ( )
overridevirtual

The top/bottom planes are NOT mirrors.

Reimplemented from Shape.

Reimplemented in MathTube.

◆ SetUniverse()

void MathNode::SetUniverse ( int  u = 0)
overridevirtual

Set the Universe number for a shape used in a lattice.

Parameters
u: universe number. if u<=0 (default) a universe number is automatically given.

Reimplemented from Shape.

◆ SetWhiteBoundary()

void MathNode::SetWhiteBoundary ( bool  state = true)
overridevirtual

mirror a particle on the surface with a cosine distribution

Reimplemented from Shape.

◆ Simplify()

void MathNode::Simplify ( bool  violent = false)
overridevirtual

Simplify a tree of Node.

Super simplification of the death which kills. Calls DevElague().

Reimplemented from Shape.

◆ Translate()

void MathNode::Translate ( double  dx,
double  dy,
double  dz,
int  count = 0 
)
overridevirtual

Translate the Node of (dx, dy, dz).

Parameters
dx: translation along x-axis
dy: translation along y-axis
dz: translation along z-axis
count: normal used is default (=0) ; usefull to know the recursion depth

Implements Shape.

◆ UnSetMouvement()

void MathNode::UnSetMouvement ( )
overrideprotectedvirtual

Set the fMouvement flag to false;.

Reimplemented from Shape.

Member Data Documentation

◆ fBoundingShape

Shape_ptr MathNode::fBoundingShape
protected

Shape containing the Node, 0 for none.

◆ fCount

int MathNode::fCount
protected

count flag to unset mvt

◆ fDestroyShape

vector< Shape_ptr > MathNode::fDestroyShape
protected

a vector of destroyed Shape_ptr of a Node (for UnSetMouvement())

◆ fHexagon

bool MathNode::fHexagon
protected

true if the Node is an Hexagon

◆ fIncludedShape

Shape_ptr MathNode::fIncludedShape
protected

Shape included in the Node, 0 for none.

◆ fShapeVector

vector< Shape_ptr > MathNode::fShapeVector
protected

a vector of Shape_ptr of a Node

◆ fTube

bool MathNode::fTube
protected

true if the Node is a Tube


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

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024