MURE
Loading...
Searching...
No Matches
MCNPSource.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#ifndef _MCNPSource_
19#define _MCNPSource_
25#include <vector>
26#include <string>
27#include <iosfwd>
28
29#include "MCSource.hxx"
30#include "Spectrum.hxx"
31#include "Shape.hxx"
32#include "TReference.hxx"
33
34class Cell;
35class Spectrum;
36
37using namespace std;
38
39class MathTube;
40class Shape;
41
43
45
52class MCNPSource : public MCSource
53{
54 public:
56
59 MCNPSource(double NPS = 10000);
60 MCNPSource(const MCNPSource &s);
61 MCSource *Clone() override
62 {
63 return new MCNPSource(*this);
64 }
65 ~MCNPSource() override;
66
68
74 void UsePreviousRunSource(string FirstSource = "") override;
76 void SetEnergy(string E)
77 {
78 fEnergy = E;
79 }
80
81 void SetEXT(string EXT)
82 {
83 fEXT = EXT;
84 }
85 void SetEXT(double ext);
86 void SetCEL(int cel);
87 void SetVEC(double i = 0, double j = 0, double k = 0);
88 void SetVEC(string vec);
89 void SetAXS(double i = 0, double j = 0, double k = 0);
90 void SetAXS(string axs);
91 void SetX(string x)
92 {
93 X = x;
94 };
95 void SetY(string y)
96 {
97 Y = y;
98 };
99 void SetZ(string z)
100 {
101 Z = z;
102 };
103 void AddBias(string bias);
104
105 void SetDirection(string dir)
106 {
107 fDirection = dir;
108 }
109 void SetRadius(string rad)
110 {
111 fRadius = rad;
112 }
113 void SetParticleType(int particle)
114 {
115 fParticleType = particle;
116 }
118 {
119 return fParticleType;
120 }
121 void SetParticleDistribution(string ParticleDistribution)
122 {
123 fParticleDistribution = ParticleDistribution;
124 }
141 void SetDistribution(string D)
142 {
143 fDistribution = D;
144 }
145
150 void SetKSRC()
151 {
152 fKSRC = true;
153 }
154 void SetSSR()
155 {
156 fSSR = true;
157 }
158 bool GetSSR()
159 {
160 return fSSR;
161 }
162 void AddPosition(double *pos);
163 void AddPosition(double x, double y, double z);
164 void SetKSRCPosition(int i, double *pos)
165 {
166 fKSRCposition[i] = pos;
167 }
168 string Print() override;
182 void AddTubeSource(MathTube *tube, string TubeParticleEnergy = "1e6");
183
196 void AddTubeSource(MathTube *tube, Spectrum *spectrum) ;
197
204 void UseThisEnergyDistribution(Spectrum *spectrum, int SourceDistributionNum = 800);
205
206 string PrintTubeSource();
207 void SetSurfaceNumber(int num)
208 {
209 fSurfaceNumber = num;
210 }
211
212 private:
215 string fDirection;
216 string fRadius;
218 string fEXT;
219 string X;
220 string Y;
221 string Z;
222 vector<string> fVEC;
223 vector<string> fAXS;
224 vector<string> fBias;
225 int fCEL;
226 bool fKSRC;
227 bool fSSR;
229 vector<double *> fKSRCposition;
230
231 vector<MathTube *> fSourceTube;
232 vector<string> fTubeParticleEnergy;
233 vector<Spectrum *> fTubeParticleSpectrum;
234 vector<double> fSourceTubeRelIntensities; // maybe old
235 vector<Cell *> fTubeCell; // maybe old
236
237};
238#endif
Reference_ptr< Shape > Shape_ptr
Definition MCNPSource.hxx:42
Header file for Monte-Carlo Source abstract class.
Header file for Shape class and Shape_ptr type.
Header file for Spectrum class.
Header file for TReference class and Reference_ptr template.
A Cell is composed from a Shape and a Material.
Definition Cell.hxx:84
Define a MCNP Source.
Definition MCNPSource.hxx:53
void SetSurfaceNumber(int num)
Definition MCNPSource.hxx:207
void SetX(string x)
Definition MCNPSource.hxx:91
void AddPosition(double *pos)
Add a position to the KSRC position vector (in m)
Definition MCNPSource.cxx:153
void SetVEC(double i=0, double j=0, double k=0)
Set the reference vector for DIR.
Definition MCNPSource.cxx:165
string PrintTubeSource()
Print a Tube Source in MCNP.
Definition MCNPSource.cxx:476
string fParticleDistribution
if not only one particle
Definition MCNPSource.hxx:228
void SetRadius(string rad)
Definition MCNPSource.hxx:109
void SetSSR()
Definition MCNPSource.hxx:154
bool GetSSR()
Definition MCNPSource.hxx:158
string fDirection
direction bias
Definition MCNPSource.hxx:215
void SetDistribution(string D)
Definition MCNPSource.hxx:141
void AddBias(string bias)
add a bias to the bias vector
Definition MCNPSource.cxx:136
string Y
Definition MCNPSource.hxx:220
void UsePreviousRunSource(string FirstSource="") override
use a previous kcode source for mcnp.
Definition MCNPSource.cxx:836
int fParticleType
particle type for the source (1=neutron)
Definition MCNPSource.hxx:213
int fSurfaceNumber
particle type for the source (1=neutron)
Definition MCNPSource.hxx:214
void SetCEL(int cel)
void AddTubeSource(MathTube *tube, string TubeParticleEnergy="1e6")
Definition MCNPSource.cxx:224
void SetKSRC()
Definition MCNPSource.hxx:150
void SetAXS(double i=0, double j=0, double k=0)
Set the reference vector for EXT and RAD.
Definition MCNPSource.cxx:195
bool fSSR
whether or not a surface source read is wanted
Definition MCNPSource.hxx:227
void SetDirection(string dir)
Definition MCNPSource.hxx:105
void UseThisEnergyDistribution(Spectrum *spectrum, int SourceDistributionNum=800)
Definition MCNPSource.cxx:251
vector< MathTube * > fSourceTube
vector of Tube for <> sources
Definition MCNPSource.hxx:231
void SetEnergy(string E)
Definition MCNPSource.hxx:76
string Print() override
Print the MCNP source (into MNCP input file).
Definition MCNPSource.cxx:328
string X
Definition MCNPSource.hxx:219
MCSource * Clone() override
Clone method.
Definition MCNPSource.hxx:61
vector< double * > fKSRCposition
KSRC position vector.
Definition MCNPSource.hxx:229
int fCEL
Definition MCNPSource.hxx:225
bool fKSRC
whether or not a KSRC source is wanted
Definition MCNPSource.hxx:226
string fRadius
direction bias
Definition MCNPSource.hxx:216
vector< Cell * > fTubeCell
Definition MCNPSource.hxx:235
void SetParticleDistribution(string ParticleDistribution)
Definition MCNPSource.hxx:121
~MCNPSource() override
destructor
Definition MCNPSource.cxx:113
vector< string > fAXS
Reference vector for ext and rad.
Definition MCNPSource.hxx:223
void SetKSRCPosition(int i, double *pos)
Definition MCNPSource.hxx:164
vector< string > fVEC
Reference vector for DIR.
Definition MCNPSource.hxx:222
void SetEXT(string EXT)
Definition MCNPSource.hxx:81
int GetParticleType()
Definition MCNPSource.hxx:117
string Z
Definition MCNPSource.hxx:221
vector< double > fSourceTubeRelIntensities
Definition MCNPSource.hxx:234
vector< string > fTubeParticleEnergy
vector of "energies" of each source tube (double or distribution)
Definition MCNPSource.hxx:232
void SetY(string y)
Definition MCNPSource.hxx:95
string fEXT
Cell case:distance from POS along AXS Surface Case:cosine of angle from AXS.
Definition MCNPSource.hxx:218
vector< string > fBias
vector of bias
Definition MCNPSource.hxx:224
void SetZ(string z)
Definition MCNPSource.hxx:99
vector< Spectrum * > fTubeParticleSpectrum
vector of energy spectrum if the source uses Spectrum
Definition MCNPSource.hxx:233
void SetParticleType(int particle)
Definition MCNPSource.hxx:113
string fDistribution
source distribution (use with bias)
Definition MCNPSource.hxx:217
Define a Monte-Carlo Source.
Definition MCSource.hxx:53
void SetEnergy(double E=2.5e6)
Set the energy for a point source (in eV)
Definition MCSource.cxx:112
string fEnergy
Energy of the Source (either a number or a bias)
Definition MCSource.hxx:161
A MathTube is a finite cylinder with an optional hole inside (like a pipe).
Definition MathTube.hxx:50
Handle dynamical object creation and pointer affectation.
Definition TReference.hxx:74
Abstract class to define geometrical shapes.
Definition Shape.hxx:85
Base class to define spectra.
Definition Spectrum.hxx:50
the namespace of the Standard C++

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