Define a MCNP Source. More...
#include <MCNPSource.hxx>
Public Member Functions | |
MCNPSource (double NPS=10000) | |
Normal Constructor. More... | |
MCNPSource (const MCNPSource &s) | |
Copy Constructor. More... | |
~MCNPSource () | |
destructor More... | |
void | SetNPS (double NPS=10000) |
set the number of source particles (default=10 000). More... | |
double | GetNPS () |
returns the number of source particles More... | |
void | SetEnergy (double E=2.5e6) |
Set the energy for a point source (in eV) More... | |
void | SetEnergy (string E) |
Set the source energy (using bias) More... | |
void | SetPosition (double *pos=0) |
set the position of a point source (SDEF) (in m) More... | |
void | SetPosition (double x=0, double y=0, double z=0) |
set the position of a point source (SDEF) (in m) More... | |
double * | GetPosition () |
returns the position of a point source More... | |
void | SetSurface (int num) |
set the Surface number for a surface source. More... | |
void | SetSurface (Shape_ptr TheShape) |
set the Surface number for a surface source. More... | |
void | SetWeight (double wgt) |
set the Source particle weight More... | |
void | SetNormal (double nrm) |
Set the normal direction of source (inward or outward) More... | |
void | SetEXT (string EXT) |
See fEXT description. More... | |
void | SetEXT (double ext) |
void | SetVEC (double i=0, double j=0, double k=0) |
Set the reference vector for DIR. More... | |
void | SetVEC (string vec) |
void | SetAXS (double i=0, double j=0, double k=0) |
Set the reference vector for EXT and RAD. More... | |
void | SetAXS (string axs) |
void | AddBias (string bias) |
add a bias to the bias vector More... | |
void | SetExtern (bool state=true) |
void | SetDirection (string dir) |
set the direction bias More... | |
void | SetRadius (string rad) |
set the Radius bias More... | |
void | SetParticleType (int particle) |
set the Particletype (1=n,9=H,...) More... | |
int | GetParticleType () |
get the Particletype (1=n,9=H,...) More... | |
void | SetParticleDistribution (string ParticleDistribution) |
set the Particle Distibution if more than one particle type More... | |
void | SetDistribution (string D) |
void | SetKcode (int ActiveCycle=100, int InactiveCycle=10, double ExpectedKeff=1.) |
bool | GetKcode () |
returns true for KCODE calculation mode. More... | |
int | GetNActiveCycle () |
Returns number of active Kcode cycles. More... | |
int | GetNInactiveCycle () |
Returns number of inactive Kcode cycles. More... | |
void | SetKSRC () |
void | SetSSR () |
void | AddPosition (double *pos) |
Add a position to the KSRC position vector (in m) More... | |
void | AddPosition (double x, double y, double z) |
Add a position to the KSRC position vector (in m) More... | |
void | SetKSRCPosition (int i, double *pos) |
Allow to modify a KSRC point source position. More... | |
string | Print () |
Print the MCNP source (into MNCP input file). More... | |
void | AddTubeSource (Tube *tube, string TubeParticleEnergy="1e6") |
void | AddTubeSource (Tube *tube, Spectrum *spectrum) |
void | UseThisEnergyDistribution (Spectrum *spectrum, int SourceDistributionNum=800) |
string | PrintTubeSource () |
Print a Tube Source in MCNP. More... | |
Private Attributes | |
double | fNPS |
number of source particles More... | |
string | fEnergy |
Energy of the Source (either a number or a bias) More... | |
double * | fPosition |
Position of the point Source (if it is the case) More... | |
int | fSurface |
Surface number for surface source (if it is the case) More... | |
Shape_ptr | fSurfaceShape |
Surface Shape for surface source (if it is the case) More... | |
double | fNormal |
Normal direction (inward or outward) for particle source. More... | |
double | fWeight |
weight of the source More... | |
string | fDirection |
direction bias More... | |
string | fRadius |
direction bias More... | |
string | fDistribution |
source distribution (use with bias) More... | |
string | fEXT |
Cell case:distance from POS along AXS Surface Case:cosine of angle from AXS. More... | |
vector< string > | fVEC |
Reference vector for DIR. More... | |
vector< string > | fAXS |
Reference vector for ext and rad. More... | |
vector< string > | fBias |
vector of bias More... | |
bool | fExtern |
whether the source is extern or defined in MCNP file More... | |
bool | fKcode |
whether or not a KCODE is wanted More... | |
bool | fKSRC |
whether or not a KSRC source is wanted More... | |
bool | fSSR |
whether or not a surface source read is wanted More... | |
int | fActiveCycle |
number of active cycles in KCODE More... | |
int | fInactiveCycle |
number of inactive cycles in KCODE More... | |
double | fKeff |
expected Keff in KCODE More... | |
int | fParticleType |
particle type for the source (1=neutron) More... | |
string | fParticleDistribution |
if not only one particle More... | |
vector< double * > | fKSRCposition |
KSRC position vector. More... | |
vector< Tube * > | fSourceTube |
vector of Tube for <> sources More... | |
vector< string > | fTubeParticleEnergy |
vector of "energies" of each source tube (double or distribution) More... | |
vector< Spectrum * > | fTubeParticleSpectrum |
vector of energy spectrum if the source uses Spectrum More... | |
Define a MCNP Source.
This source has to be added to the global gMURE pointer.
MCNPSource::MCNPSource | ( | double | NPS = 10000 | ) |
Normal Constructor.
NPS | : number of source particles (default=10 000) |
MCNPSource::MCNPSource | ( | const MCNPSource & | s | ) |
Copy Constructor.
MCNPSource::~MCNPSource | ( | ) |
destructor
void MCNPSource::AddBias | ( | string | bias | ) |
add a bias to the bias vector
void MCNPSource::AddPosition | ( | double * | pos | ) |
Add a position to the KSRC position vector (in m)
void MCNPSource::AddPosition | ( | double | x, |
double | y, | ||
double | z | ||
) |
Add a position to the KSRC position vector (in m)
void MCNPSource::AddTubeSource | ( | Tube * | tube, |
string | TubeParticleEnergy = "1e6" |
||
) |
Add a isotropic volumetric Tube source. It allows to define an uniform volumic source in Tube(s).Usefull to define sources in an assembly. The first use was to calculated gamma bremmstralung from Beta Decay.
You CANNOT use in the same code AddTubeSource(Tube*, string) and AddTubeSource(Tube*, Spectrum*).
tube | : the Tube used to define the source shape |
TubeParticleEnergy | : a string containing either a double for mono-energy neutrons, either a source distribution "Dxxx" where xxx is an int. In that case, the user MUST provide via MCNPSource::AddBias() the description of this distribution. |
Add a isotropic volumetric Tube source. It allows to define an uniform volumic source in Tube(s).Usefull to define sources in an assembly. The first use was to calculated gamma bremmstralung from Beta Decay.
You CANNOT use in the same code AddTubeSource(Tube*, string) and AddTubeSource(Tube*, Spectrum*).
tube | : the Tube used to define the source shape |
spectrum | : must be either NeutronSpectrum,GammaSpectrum or BetaSpectrum to define the particle and it energy spectrum |
|
inline |
returns true for KCODE calculation mode.
|
inline |
Returns number of active Kcode cycles.
|
inline |
Returns number of inactive Kcode cycles.
|
inline |
returns the number of source particles
|
inline |
get the Particletype (1=n,9=H,...)
|
inline |
returns the position of a point source
string MCNPSource::Print | ( | ) |
Print the MCNP source (into MNCP input file).
string MCNPSource::PrintTubeSource | ( | ) |
Print a Tube Source in MCNP.
void MCNPSource::SetAXS | ( | double | i = 0 , |
double | j = 0 , |
||
double | k = 0 |
||
) |
Set the reference vector for EXT and RAD.
void MCNPSource::SetAXS | ( | string | axs | ) |
|
inline |
set the direction bias
|
inline |
Set the source distribution. In MCNP, one can define source with distributions ; each distribution is associated with source probability and/or source information. This probabilities and information have to be defined in MCNPSource::AddBias(). For example:
Rem: one can specify also any cards of a SDEF line (such as AXS x y z, ...).
D | : the source distribution. |
void MCNPSource::SetEnergy | ( | double | E = 2.5e6 | ) |
Set the energy for a point source (in eV)
|
inline |
Set the source energy (using bias)
|
inline |
See fEXT description.
void MCNPSource::SetEXT | ( | double | ext | ) |
|
inline |
Say whether the source is extern or defined in MCNP file. if set to "true", a external file is used (such as inps, source.mcnp, ...) else a SDEF card in used in the MCNP file. This can be used either in standard calculation either in KCODE calculation.
state | : if true an external source is used. |
void MCNPSource::SetKcode | ( | int | ActiveCycle = 100 , |
int | InactiveCycle = 10 , |
||
double | ExpectedKeff = 1. |
||
) |
Set KCODE mode for MCNP.
ActiveCycle | : Number of active cycles for keff determination. |
InactiveCycle | : Number of inactive cycles that are skipped for source stabilization |
ExpectedKeff | : the expected value of keff. |
|
inline |
Set KSRC source for MCNP. It allows to suppress SDEF card and specify multipoint source position. See MCNPSource::AddPosition()
|
inline |
Allow to modify a KSRC point source position.
|
inline |
Set the normal direction of source (inward or outward)
|
inline |
set the number of source particles (default=10 000).
|
inline |
set the Particle Distibution if more than one particle type
|
inline |
set the Particletype (1=n,9=H,...)
void MCNPSource::SetPosition | ( | double * | pos = 0 | ) |
set the position of a point source (SDEF) (in m)
void MCNPSource::SetPosition | ( | double | x = 0 , |
double | y = 0 , |
||
double | z = 0 |
||
) |
set the position of a point source (SDEF) (in m)
|
inline |
set the Radius bias
|
inline |
|
inline |
set the Surface number for a surface source.
|
inline |
set the Surface number for a surface source.
void MCNPSource::SetVEC | ( | double | i = 0 , |
double | j = 0 , |
||
double | k = 0 |
||
) |
Set the reference vector for DIR.
void MCNPSource::SetVEC | ( | string | vec | ) |
|
inline |
set the Source particle weight
void MCNPSource::UseThisEnergyDistribution | ( | Spectrum * | spectrum, |
int | SourceDistributionNum = 800 |
||
) |
Use a spectrum as an energy distribution. It allows to use your spectrum object (BetaSpectrum,GammaSpectrum,or NeutronSpectrum) as a MCNP energy distribution
spectrum | : must be either NeutronSpectrum,GammaSpectrum or BetaSpectrum |
SourceDistributionNum | : the MCNP source distribution number used in D, SI,SP, ... cards |
|
private |
number of active cycles in KCODE
|
private |
Reference vector for ext and rad.
|
private |
vector of bias
|
private |
direction bias
|
private |
source distribution (use with bias)
|
private |
Energy of the Source (either a number or a bias)
|
private |
|
private |
whether the source is extern or defined in MCNP file
|
private |
number of inactive cycles in KCODE
|
private |
whether or not a KCODE is wanted
|
private |
expected Keff in KCODE
|
private |
whether or not a KSRC source is wanted
|
private |
KSRC position vector.
|
private |
Normal direction (inward or outward) for particle source.
|
private |
number of source particles
|
private |
if not only one particle
|
private |
particle type for the source (1=neutron)
|
private |
Position of the point Source (if it is the case)
|
private |
direction bias
|
private |
whether or not a surface source read is wanted
|
private |
Surface number for surface source (if it is the case)
|
private |
vector of "energies" of each source tube (double or distribution)
|
private |
vector of energy spectrum if the source uses Spectrum
|
private |
Reference vector for DIR.
|
private |
weight of the source