MURE
|
A rectangular parallepipede box. More...
#include <MathBrick.hxx>
Public Member Functions | |
Constructors | |
MathBrick (double HalfX=0.01, double HalfY=0.01, double HalfZ=0.01, int Sign=- 1) | |
Build a Brick of size (2*HalfX, 2*HalfY, 2*HalfZ) at origin (0, 0, 0). | |
MathBrick (double *Origin, double *Ux, double *Uy, double *Uz, double HalfX=0.01, double HalfY=0.01, double HalfZ=0.01, int Sign=- 1) | |
Build a Box of size (2*HalfX, 2*HalfY, 2*HalfZ) centered at Origin, with Ux, Uy, Uz, normal vectors to its faces. | |
MathBrick (const char *Infinite, double HalfX=0.01, double HalfY=0.01, int Sign=- 1) | |
Build a Box of size (2*HalfX, 2*HalfY) and of infinite height at origin (0, 0, 0). | |
Shape_ptr | Clone (int count=0) override |
Clone a Shape. | |
void | Copy (Shape_ptr B) override |
Copy all attributes of a Shape (but not attributes of the ancestor classes). | |
Shape parameters | |
unsigned | IsBrick () override |
double | GetHalfX () |
double | GetHalfY () |
double | GetHalfZ () |
vector< double > | GetOrigin () |
vector< double > | GetUx () |
vector< double > | GetUy () |
vector< double > | GetUz () |
void | SetPeriodicBoundary (bool state=true, string TopBottPlaneBC="mirror") override |
Periodic boundary (WARNING: only for MathBrick and MathHexagon). | |
Shape transformations | |
void | Translate (double dx, double dy, double dz, int count=0) override |
Translate the Shape by (dx, dy, dz). | |
void | Rotate (double phi, double theta=0, double psi=0, double *center=nullptr, int count=0) override |
Rotate the Shape clockwise. | |
Relations with other shapes | |
unsigned | IsIncluded (Shape_ptr OtherShape) override |
return 1 if the MathBrick is included in OtherShape otherwise 0 | |
unsigned | IsDisjoint (Shape_ptr OtherShape) override |
return 1 if the MathBrick is disjoint of OtherShape otherwise 0 | |
bool | PointInShape (double *P, int border) override |
True if the point P is in the Shape. | |
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 | IsCylinder () |
virtual unsigned | IsFullVoid () |
virtual unsigned | IsHexagon () |
virtual unsigned | IsNode () |
virtual unsigned | IsPlane () |
virtual unsigned | IsSphere () |
virtual unsigned | IsTube () |
virtual unsigned | IsFull () |
virtual unsigned | IsVoid () |
virtual unsigned | IsZTorus () |
bool | IsInfinite () |
virtual double | GetVolume () |
Get the Volume of a Shape. | |
void | SetVolume (double V) |
virtual double | GetArea () |
Get the Area of a Shape. | |
void | SetArea (double S) |
virtual void | SetMirrorBoundary (bool state=true) |
mirror a particle on the surface | |
virtual void | SetTopBottomPlanesOpen () |
virtual bool | IsTopBottomPlanesOpen () |
virtual void | SetSidePlanesOpen () |
virtual bool | IsSidePlanesOpen () |
virtual void | SetWhiteBoundary (bool state=true) |
virtual bool | IsMirrorBoundary () |
virtual bool | IsWhiteBoundary () |
virtual bool | IsPeriodicBoundary () |
virtual unsigned | Add (Shape_ptr OtherShape) |
Add a new Shape (in fact a Shape_ptr) to a Node. | |
virtual void | ReplaceLeaf (int i, Shape_ptr OtherShape) |
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 Shape_ptr | GetLeaf (int i) |
virtual int | GetNumberOfLeaves () |
string | GetShapeName () |
returns the Shape name | |
void | SetDebugName (string str) |
string | GetDebugName () |
virtual void | SetUniverse (int u=- 1) |
Set the Universe number for a Shape . | |
virtual void | SetFill (int f) |
int | GetFill () |
int | GetUniverse () |
void | IncrementSurface (double S) |
virtual void | RemoveSurface () |
virtual string | Print () |
virtual void | PrintX (int count=0) |
Debug method: Print the shape surface when fMouvement=true. | |
virtual void | PrintY (int count=0) |
Debug method: Print the shape surfaces, InsideShape, ... | |
virtual void | SetLinkedPlane (Shape_ptr P) |
virtual void | ReplaceNode (Shape_ptr C) |
Replace a Node by an other (C must be a Node) | |
virtual SurfaceCard * | GetSurfaceCard () |
virtual SurfaceCard * | GetSurfaceCard (int i) |
virtual void | ResetIsDefinedSurfaceCalled () |
virtual void | Simplify (bool violent=false) |
Simplify a tree of Node. | |
virtual void | SetMouvement (bool state=true) |
virtual void | UnSetMouvement () |
Set the fMouvement flag to false;. | |
bool | GetMouvement () |
virtual void | DevElague (int count=0, bool violent=false) |
Developps and Trims a tree of Node. | |
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 () |
Miscellaneous methods | |
double | fHalfSize [3] |
Half sizes of the brick. | |
vector< double > | fOrigin |
Origin of the brick. | |
vector< double > | fUx |
Normal vector to the 2 X planes. | |
vector< double > | fUy |
Normal vector to the 2 Y planes. | |
vector< double > | fUz |
Normal vector to the 2 Z planes. | |
double | MinDistanceFrom2OppositeFace (vector< double > N, int whichplane, double *S) |
void | CalculNot () override |
Allocates and calculs the complement of a brick. | |
int | NumberOfShapes () override |
Number of shapes/surfaces this shape consists of. | |
MathBrick (double HalfX, double HalfY, double HalfZ, int Sign, bool Infinite) | |
Private constructor needed to copy a MathBrick in methods. | |
MathBrick * | CreateNewInstance (int sign=1) override |
a new MathBrick instance. | |
void | Init (double HalfX, double HalfY, double HalfZ) |
unsigned | CornerInBrick (MathBrick *brick, int all, int border) |
Return 1 if corner(s) of this shape are in a brick. | |
unsigned | CornerInCylinder (MathCylinder *cyl, int all, int border) |
Return 1 if corner(s) of this shape are in a cylinder. | |
double | Dist2Segment (MathCylinder *cyl, double Segment[6][2], double C0[6][2], int &segmentNum) |
void | FindBrickProjection (MathCylinder *cyl, double Segment[6][2], double C0[6][2], double Origin[2]) |
unsigned | GeneralIntersectionOf2Brick (MathBrick *brick) |
return 1 if there is an intersection of the segment of this with the MathBrick brick | |
unsigned | LineCrossPlane (double *X, vector< double > N, double *P, vector< double > U, double *D) |
unsigned | CylinderCrossBrick (MathCylinder *Cyl) |
unsigned | PointInSegment (double *X, double *A, double *B, int border) |
unsigned | TwoFaces3Segments (MathBrick *brick, vector< double > N, int whichSize, double *C0, double C1[3][3]) |
unsigned | TwoFaces2Segments (MathBrick *brick, vector< double > N, int whichSize, double *C0, double C1[2][3]) |
double | GetVirtualSphereRadius () override |
returns the radius of a Sphere containing the Shape | |
double * | GetVirtualSphereCenter () override |
returns the center of a Sphere containing the Shape | |
double | MinDist1Point2Face (vector< double > U0, vector< double > U1, vector< double > U2, double *P0, double *S, int whichplane) |
double | MinDist1Point2FaceInfinite (vector< double > U0, vector< double > U1, double *P0, double *S, int whichplane) |
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_ptr > | fInsideShape |
a vector to remember which Shapes are inside the current one.Clear at each ">>" | |
vector< Shape_ptr > | fOriginalInsideShape |
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. | |
Shape * | fNot |
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) | |
A rectangular parallepipede box.
A MathBrick is a rectangular parallepipede defined by half width, half length, half height (HalfX, HalfY, HalfZ). It is only a mathematical shape (no link to any code output). User should use Brick (from MCNP or Serpent namespace).
Sign=-1 for Brick interior and Sign=+1 for its exterior.
Default: interior of a 0.01*0.01*0.01 cube, perpendicular to (x, y, z) basis and center at origin.
MathBrick::MathBrick | ( | double | HalfX = 0.01 , |
double | HalfY = 0.01 , |
||
double | HalfZ = 0.01 , |
||
int | Sign = - 1 |
||
) |
Build a Brick of size (2*HalfX, 2*HalfY, 2*HalfZ) at origin (0, 0, 0).
Default: Cube center at origin of 0.01*0.01*0.01 = 1 cm3
HalfX | : half of X-dimension of the brick |
HalfY | : half of Y-dimension of the brick |
HalfZ | : half of Z-dimension of the brick |
Sign | : -1 (default) for interior and +1 for exterior |
MathBrick::MathBrick | ( | double * | Origin, |
double * | Ux, | ||
double * | Uy, | ||
double * | Uz, | ||
double | HalfX = 0.01 , |
||
double | HalfY = 0.01 , |
||
double | HalfZ = 0.01 , |
||
int | Sign = - 1 |
||
) |
Build a Box of size (2*HalfX, 2*HalfY, 2*HalfZ) centered at Origin, with Ux, Uy, Uz, normal vectors to its faces.
Default: Cube of 0.01*0.01*0.01 = 1 cm3
Origin | : Center point of the brick (double[3]) |
Ux | : normal vector of face normally perpendicular to x-axis (double[3]) |
Uy | : normal vector of face normally perpendicular to y-axis (double[3]) |
Uz | : normal vector of face normally perpendicular to z-axis (double[3]) |
HalfX | : half of X-dimension of the brick |
HalfY | : half of Y-dimension of the brick |
HalfZ | : half of Z-dimension of the brick |
Sign | : -1 (default) for interior and +1 for exterior |
MathBrick::MathBrick | ( | const char * | Infinite, |
double | HalfX = 0.01 , |
||
double | HalfY = 0.01 , |
||
int | Sign = - 1 |
||
) |
Build a Box of size (2*HalfX, 2*HalfY) and of infinite height at origin (0, 0, 0).
Default: Cube center at origin of 0.01*0.01 = 1 cm2 rectangular basis
Infinite | : any string between "" (for resolution of overload) |
HalfX | : half of X-dimension of the brick |
HalfY | : half of Y-dimension of the brick |
Sign | : -1 (default) for interior and +1 for exterior |
|
protected |
Private constructor needed to copy a MathBrick in methods.
|
overridevirtual |
Allocates and calculs the complement of a brick.
Reimplemented from Shape.
|
overridevirtual |
|
protected |
Return 1 if corner(s) of this shape are in a brick.
all | : Ask about all (all=1) or at least one (all=0) corner of this shape. |
border | : Resolve border: if a corner of this shape is at the surface of brick , it is considered inside (-1) or outside (+1) |
brick | : The brick which we try to fit in. |
|
protected |
Return 1 if corner(s) of this shape are in a cylinder.
all | : Ask about all (all=1) or at least one (all=0) corner of this shape. |
border | : Resolve border: if a corner of this shape is at the surface of cyl , it is considered inside (-1) or outside (+1) |
cyl | : The cylinder which we try to fit in. |
|
overrideprotectedvirtual |
|
protected |
Return 1 if a cylinder and a brick cut together. Find (if exist) the cross-point of the axis cylinder with on brick face.
Cyl | : The cylinder |
|
protected |
|
protected |
Projection of a brick in a plane perpendicular to the cylinder axis. THIS METHOD IS NO MORE USED BECAUSE IT GIVES WRONG ANWSER (how to join the hexagon corners?)
cyl | : cylinder |
Segment | : the segments of the result hexagon of the projection (2D); they are order in such way that C0[i] is linked to C0[i+1] |
C0 | : the corners of the result hexagon of the projection (2D) |
Origin | : origin |
|
protected |
return 1 if there is an intersection of the segment of this with the MathBrick brick
|
inline |
< return the half width
|
inline |
< return the half length
|
inline |
< return the half height (if it exists)
|
inline |
< return the origin
|
inline |
< return the 3 components of normal vector to the 2 X planes
|
inline |
< return the 3 components of normal vector to the 2 Y planes
|
inline |
< return the 3 components of normal vector to the 2 Z planes (or the axis vector if infinite)
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
protected |
Set half sizes, origin, and normal vectors, needed by constructors
|
inlineoverridevirtual |
|
overridevirtual |
|
overridevirtual |
|
protected |
Find the intersection of a plane and a line. 0=no intersection, 1=at least 1 intesection.
P | : a point of the plane |
N | : the normal vector of the plane |
D | : a point of the line |
U | : a vector of the line |
X | : (output) the intersection point if exists |
|
protected |
Calculates the minimum distance from point S to faces of normal vector U0 and center P0
U1 | : the other faces, in x->y->z->x order |
U2 | : the other faces, in x->y->z->x order |
S | : point |
P0 | : center |
U0 | : normal vector |
whichplane | : indicates which plane is considered (for fHalfSize) |
|
protected |
Calculates the minimum distance from point S to face of normal vector U0 and center P0, in case of infinite brick
S | : point |
P0 | : center |
U0 | : normal vector |
U1 | : the other face |
whichplane | : indicates which plane is considered (for fHalfSize) |
double MathBrick::MinDistanceFrom2OppositeFace | ( | vector< double > | N, |
int | whichplane, | ||
double * | S | ||
) |
return the minimum distance of 2 opposite faces of a brick to the point S.
N | : normal vector defining the 2 surfaces (either fUx, fUy or fUz). |
whichplane | : used to know if N is fUx, fUy or fUz |
S | : The point |
|
inlineoverridevirtual |
Number of shapes/surfaces this shape consists of.
Reimplemented from Shape.
|
protected |
returns 1 if the point X is in (A, B) otherwise 0.
X | : point |
A | : point |
B | : point |
border | : -1 => X is in [A, B], +1 => X is in ]A, B[ |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Periodic boundary (WARNING: only for MathBrick and MathHexagon).
Please read carefully the MCNP user guide before using these conditions.
state | : true or false to allow periodic condition |
TopBottPlaneBC | : The Top/Bottom planes of the MathBrick or MathHexagon boundary conditions ; Possible values are
|
Reimplemented from Shape.
|
overridevirtual |
|
protected |
return 1 if there is an intersection of 2 segments of a Brick's rectangular basis with at least one of 2 opposite face of an other MathBrick.
|
protected |
return 1 if there is an intersection of 3 segments of a Brick with at least one of 2 opposite face of an other Brick.
|
protected |
Half sizes of the brick.
|
protected |
Origin of the brick.
|
protected |
Normal vector to the 2 X planes.
|
protected |
Normal vector to the 2 Y planes.
|
protected |
Normal vector to the 2 Z planes.