MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
MCNPSource.hxx
Go to the documentation of this file.
1 #ifndef _MCNPSource_
2 #define _MCNPSource_
3 
8 #include <math.h>
9 #include <vector>
10 #include <string>
11 #include "MureHeaders.hxx"
12 
13 using namespace std;
14 
15 
16 class Tube;
17 class Shape;
19 
21 
29 {
30  public:
32 
35  MCNPSource(double NPS=10000);
36  MCNPSource(const MCNPSource &s);
37  ~MCNPSource();
38 
39  void SetNPS(double NPS=10000){fNPS=NPS;}
40  double GetNPS(){return fNPS;}
41  void SetEnergy(double E=2.5e6);
42  void SetEnergy(string E){fEnergy=E;}
43  void SetPosition(double *pos=0);
44  void SetPosition(double x=0,double y=0,double z=0);
45  double* GetPosition(){return fPosition;}
46  void SetSurface(int num) {fSurface=abs(num);}
47  void SetSurface(Shape_ptr TheShape) {fSurfaceShape=TheShape;}
48  void SetWeight(double wgt){fWeight=wgt;}
49  void SetNormal(double nrm){fNormal=nrm;}
50  void SetEXT(string EXT){fEXT=EXT;}
51  void SetEXT(double ext);
52  void SetVEC(double i=0,double j=0,double k=0);
53  void SetVEC(string vec);
54  void SetAXS(double i=0,double j=0,double k=0);
55  void SetAXS(string axs);
56  void AddBias(string bias);
57 
65  void SetExtern(bool state=true){fExtern=state;}
66  void SetDirection(string dir){fDirection=dir;}
67  void SetRadius(string rad){fRadius=rad;}
68  void SetParticleType(int particle){fParticleType=particle;}
69  int GetParticleType(){return fParticleType;}
70  void SetParticleDistribution(string ParticleDistribution){fParticleDistribution=ParticleDistribution;}
71 
87  void SetDistribution(string D){fDistribution=D;}
94  void SetKcode(int ActiveCycle=100,int InactiveCycle=10,double ExpectedKeff=1.);
95  bool GetKcode(){return fKcode;}
96  int GetNActiveCycle(){return fActiveCycle;}
97  int GetNInactiveCycle(){return fInactiveCycle;}
98 
102  void SetKSRC(){fKSRC=true;}
103  // Change by NT
104  void SetSSR(){fSSR=true;}
105  // End of change by NT
106  void AddPosition(double *pos);
107  void AddPosition(double x,double y,double z);
108  void SetKSRCPosition(int i,double *pos){fKSRCposition[i]=pos;}
109  string Print();
110 
123  void AddTubeSource(Tube *tube, string TubeParticleEnergy="1e6");
124 
137  void AddTubeSource(Tube *tube,Spectrum* spectrum) ;
138 
145  void UseThisEnergyDistribution(Spectrum* spectrum,int SourceDistributionNum=800);
146 
147  string PrintTubeSource();
148 
149  private:
150  double fNPS;
151  string fEnergy;
152  double *fPosition;
153  int fSurface;
155  double fNormal;
156  double fWeight;
157  string fDirection;
158  string fRadius;
159  string fDistribution;
160  string fEXT;
161  vector<string> fVEC;
162  vector<string> fAXS;
163  vector<string> fBias;
164  bool fExtern;
165  bool fKcode;
166  bool fKSRC;
167  // change by NT
168  bool fSSR;
169  // End of change by NT
172  double fKeff;
175  vector<double*> fKSRCposition;
176 
177  vector<Tube*> fSourceTube;
178  vector<string> fTubeParticleEnergy;
179  vector<Spectrum*> fTubeParticleSpectrum;
180 
181 };
182 #endif
bool fExtern
whether the source is extern or defined in MCNP file
Definition: MCNPSource.hxx:164
int fInactiveCycle
number of inactive cycles in KCODE
Definition: MCNPSource.hxx:171
double fKeff
expected Keff in KCODE
Definition: MCNPSource.hxx:172
void SetExtern(bool state=true)
Definition: MCNPSource.hxx:65
int GetParticleType()
get the Particletype (1=n,9=H,...)
Definition: MCNPSource.hxx:69
void SetKSRCPosition(int i, double *pos)
Allow to modify a KSRC point source position.
Definition: MCNPSource.hxx:108
double * fPosition
Position of the point Source (if it is the case)
Definition: MCNPSource.hxx:152
A Tube is a finite Cylinder with a hole inside (like a pipe).
Definition: Tube.hxx:21
bool fKSRC
whether or not a KSRC source is wanted
Definition: MCNPSource.hxx:166
string fDirection
direction bias
Definition: MCNPSource.hxx:157
string fEXT
Cell case:distance from POS along AXS Surface Case:cosine of angle from AXS.
Definition: MCNPSource.hxx:160
double fWeight
weight of the source
Definition: MCNPSource.hxx:156
vector< double * > fKSRCposition
KSRC position vector.
Definition: MCNPSource.hxx:175
void SetNPS(double NPS=10000)
set the number of source particles (default=10 000).
Definition: MCNPSource.hxx:39
void SetSSR()
Definition: MCNPSource.hxx:104
int fSurface
Surface number for surface source (if it is the case)
Definition: MCNPSource.hxx:153
vector< Tube * > fSourceTube
vector of Tube for &lt;&gt; sources
Definition: MCNPSource.hxx:177
Base class to define spectra.
Definition: Spectrum.hxx:25
void SetDirection(string dir)
set the direction bias
Definition: MCNPSource.hxx:66
int fParticleType
particle type for the source (1=neutron)
Definition: MCNPSource.hxx:173
double * GetPosition()
returns the position of a point source
Definition: MCNPSource.hxx:45
int fActiveCycle
number of active cycles in KCODE
Definition: MCNPSource.hxx:170
bool fKcode
whether or not a KCODE is wanted
Definition: MCNPSource.hxx:165
void SetKSRC()
Definition: MCNPSource.hxx:102
bool fSSR
whether or not a surface source read is wanted
Definition: MCNPSource.hxx:168
vector< Spectrum * > fTubeParticleSpectrum
vector of energy spectrum if the source uses Spectrum
Definition: MCNPSource.hxx:179
vector< string > fVEC
Reference vector for DIR.
Definition: MCNPSource.hxx:161
bool GetKcode()
returns true for KCODE calculation mode.
Definition: MCNPSource.hxx:95
File including all headers.
void SetSurface(int num)
set the Surface number for a surface source.
Definition: MCNPSource.hxx:46
int GetNInactiveCycle()
Returns number of inactive Kcode cycles.
Definition: MCNPSource.hxx:97
void SetParticleDistribution(string ParticleDistribution)
set the Particle Distibution if more than one particle type
Definition: MCNPSource.hxx:70
vector< string > fTubeParticleEnergy
vector of &quot;energies&quot; of each source tube (double or distribution)
Definition: MCNPSource.hxx:178
void SetEnergy(string E)
Set the source energy (using bias)
Definition: MCNPSource.hxx:42
void SetDistribution(string D)
Definition: MCNPSource.hxx:87
double fNPS
number of source particles
Definition: MCNPSource.hxx:150
void SetRadius(string rad)
set the Radius bias
Definition: MCNPSource.hxx:67
Reference_ptr< Shape > Shape_ptr
Definition: MCNPSource.hxx:17
Define a MCNP Source.
Definition: MCNPSource.hxx:28
string fParticleDistribution
if not only one particle
Definition: MCNPSource.hxx:174
void SetEXT(string EXT)
See fEXT description.
Definition: MCNPSource.hxx:50
void SetNormal(double nrm)
Set the normal direction of source (inward or outward)
Definition: MCNPSource.hxx:49
vector< string > fBias
vector of bias
Definition: MCNPSource.hxx:163
int GetNActiveCycle()
Returns number of active Kcode cycles.
Definition: MCNPSource.hxx:96
string fRadius
direction bias
Definition: MCNPSource.hxx:158
Shape_ptr fSurfaceShape
Surface Shape for surface source (if it is the case)
Definition: MCNPSource.hxx:154
void SetWeight(double wgt)
set the Source particle weight
Definition: MCNPSource.hxx:48
string fDistribution
source distribution (use with bias)
Definition: MCNPSource.hxx:159
double GetNPS()
returns the number of source particles
Definition: MCNPSource.hxx:40
void SetSurface(Shape_ptr TheShape)
set the Surface number for a surface source.
Definition: MCNPSource.hxx:47
string fEnergy
Energy of the Source (either a number or a bias)
Definition: MCNPSource.hxx:151
void SetParticleType(int particle)
set the Particletype (1=n,9=H,...)
Definition: MCNPSource.hxx:68
double fNormal
Normal direction (inward or outward) for particle source.
Definition: MCNPSource.hxx:155
vector< string > fAXS
Reference vector for ext and rad.
Definition: MCNPSource.hxx:162
Base class to define shapes.
Definition: Shape.hxx:54

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