MURE
Loading...
Searching...
No Matches
MathHexagon.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef _MathHEXAGON_HXX_
20#define _MathHEXAGON_HXX_
21
27#include <vector>
28#include <cmath>
29#include <algorithm>
30#include <iosfwd>
31#include <string>
32
33#include "MathNode.hxx"
34#include "MCSource.hxx"
35
36using namespace std;
37
39
48class MathHexagon : virtual public MathNode
49{
50 public :
56
67 MathHexagon(double HalfHeight = 0.005, double Side = 0.01, int Sign = - 1);
69
80 MathHexagon(const char *Infinite, double Side = 0.01, int Sign = - 1);
81 MathHexagon(const MathHexagon &h);
82 Shape_ptr Clone(int count = 0) override;
83 void Copy(Shape_ptr S) override;
85
86
91 unsigned IsHexagon() override
92 {
93 return fHexagon;
94 }
95 double GetWidth()
96 {
97 return fSide * sqrt(3.);
98 }
99 double GetSide()
100 {
101 return fSide;
102 }
104 {
105 return fHalfHeight;
106 }
107 double GetOrigin(int i)
108 {
109 return fOrigin[i];
110 }
111 vector < double > GetOrigin()
112 {
113 return fOrigin;
114 }
115
117
125 void SetPeriodicBoundary(bool state = true, string TopBottPlaneBC = "mirror") override;
126 void SetTopBottomPlanesOpen() override;
127 void SetSidePlanesOpen() override;
128
132
137 unsigned IsIncluded(Shape_ptr OtherShape) override;
138 unsigned IsDisjoint(Shape_ptr OtherShape) override;
140
146
152 void Translate(double dx, double dy, double dz, int count = 0) override;
154
161 void Rotate(double phi, double theta = 0, double psi = 0, double *center = nullptr, int count = 0) override;
163
164
169 double GetVirtualSphereRadius() override;
170 double *GetVirtualSphereCenter() override;
171
172 string Print() override;
173
174 void CalculNot() override;
175 vector < double > NormalVector2XRightPlane();
177
178 protected :
179
180 MathHexagon *CreateNewInstance(int sign = 1) override;
181
182 MathHexagon(double HalfHeight, double Side, int Sign, bool Infinite);
183 bool IsSameAxis(MathHexagon *hexagon);
184
185 double fHalfHeight;
186 double fSide;
187 vector < double > fOrigin;
188};
189
190//_________________________________________________________________________________________________
191// Related Functions
192//_________________________________________________________________________________________________
193
202bool IsHexagonInTube(double Xh[2], Shape_ptr hexa, double Rmax, double Rmin = 0, double *Xt = nullptr);
203
210bool IsHexagonInHexagon(double Xh1[2], Shape_ptr hexa1, Shape_ptr hexa2);
211
218bool IsCylinderInHexagon(Shape_ptr cylinder, Shape_ptr hexagon);
219
220#endif
#define sign(a)
Definition GenericReactorAssembly.cxx:43
Header file for Monte-Carlo Source abstract class.
bool IsHexagonInHexagon(double Xh1[2], Shape_ptr hexa1, Shape_ptr hexa2)
Definition MathHexagon.cxx:857
bool IsHexagonInTube(double Xh[2], Shape_ptr hexa, double Rmax, double Rmin=0, double *Xt=nullptr)
Definition MathHexagon.cxx:811
bool IsCylinderInHexagon(Shape_ptr cylinder, Shape_ptr hexagon)
Definition MathHexagon.cxx:951
Header file for MathNode class.
Regular hexagon Shape of a given height.
Definition MathHexagon.hxx:49
unsigned IsHexagon() override
Definition MathHexagon.hxx:91
vector< double > NormalVector2XRightPlane()
Definition MathHexagon.cxx:793
double GetOrigin(int i)
Definition MathHexagon.hxx:107
double fSide
length of Hexagon side.
Definition MathHexagon.hxx:186
double fHalfHeight
Half height of the Hexagon.
Definition MathHexagon.hxx:185
MathHexagon * CreateNewInstance(int sign=1) override
a new MathHexagon instance.
Definition MathHexagon.cxx:777
unsigned IsDisjoint(Shape_ptr OtherShape) override
+1 this is disjoint in OtherShape, 0 not included or don't know.
Definition MathHexagon.cxx:552
double GetVirtualSphereRadius() override
returns the radius of a Sphere containing the Shape
Definition MathHexagon.cxx:735
vector< double > fOrigin
Origin of the Hexagon.
Definition MathHexagon.hxx:187
void Rotate(double phi, double theta=0, double psi=0, double *center=nullptr, int count=0) override
Rotate the Shape clockwise.
Definition MathHexagon.cxx:276
bool IsSameAxis(MathHexagon *hexagon)
whether or not 2 hexagons have same z-axis and planes
Definition MathHexagon.cxx:709
vector< double > GetOrigin()
Definition MathHexagon.hxx:111
Shape_ptr Clone(int count=0) override
Clone a Shape.
Definition MathHexagon.cxx:569
double GetWidth()
Definition MathHexagon.hxx:95
void Copy(Shape_ptr S) override
Copy all attributs of a Shape S (but not attributs of the father classes).
Definition MathHexagon.cxx:691
double GetHalfHeight()
Definition MathHexagon.hxx:103
void SetSidePlanesOpen() override
The side planes are NOT mirrors.
Definition MathHexagon.cxx:765
double * GetVirtualSphereCenter() override
returns the center of a Sphere containing the Shape
Definition MathHexagon.cxx:785
void CalculNot() override
Allocates and calculs the complement of Shape.
Definition MathHexagon.cxx:285
Shape_ptr GetIncludedShape()
Returns the included shape of the hexagon, even if null.
Definition MathHexagon.cxx:750
void Translate(double dx, double dy, double dz, int count=0) override
Translate the Shape by (dx, dy, dz).
Definition MathHexagon.cxx:263
void SetPeriodicBoundary(bool state=true, string TopBottPlaneBC="mirror") override
Periodic boundary (WARNING: only for Brick and Hexagon).
Definition MathHexagon.cxx:255
string Print() override
Print the Node surface in MCNP cell.
Definition MathHexagon.cxx:627
unsigned IsIncluded(Shape_ptr OtherShape) override
+1 this is included in OtherShape, 0 not included or don't know.
Definition MathHexagon.cxx:345
Shape_ptr GetBoundingShape()
Returns the bounding shape of the hexagon, even if null.
Definition MathHexagon.cxx:743
void SetTopBottomPlanesOpen() override
The top/bottom planes are NOT mirrors.
Definition MathHexagon.cxx:757
double GetSide()
Definition MathHexagon.hxx:99
MathNode allows to construct Union or Intersection of Shape.
Definition MathNode.hxx:50
bool fHexagon
true if the Node is an Hexagon
Definition MathNode.hxx:230
the namespace of the Standard C++

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