MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions | Private Attributes
MCNPSource Class Reference

Define a MCNP Source. More...

#include <MCNPSource.hxx>

List of all members.

Public Member Functions

 MCNPSource (int NPS=10000)
 Normal Constructor.
 MCNPSource (const MCNPSource &s)
 Copy Constructor.
 ~MCNPSource ()
 destructor
void SetNPS (int NPS=10000)
 set the number of source particles (default=10 000).
int GetNPS ()
 returns the number of source particles
void SetEnergy (double E=2.5e6)
 Set the energy for a point source (in eV)
void SetEnergy (string E)
 Set the source energy (using bias)
void SetPosition (double *pos=0)
 set the position of a point source (SDEF) (in m)
void SetPosition (double x=0, double y=0, double z=0)
 set the position of a point source (SDEF) (in m)
double * GetPosition ()
 returns the position of a point source
void SetSurface (int num)
 set the Surface number for a surface source.
void SetSurface (Shape_ptr TheShape)
 set the Surface number for a surface source.
void SetWeight (double wgt)
 set the Source particle weight
void SetNormal (double nrm)
 Set the normal direction of source (inward or outward)
void SetEXT (string EXT)
 See fEXT description.
void SetEXT (double ext)
void SetVEC (double i=0, double j=0, double k=0)
 Set the reference vector for DIR.
void SetVEC (string vec)
void SetAXS (double i=0, double j=0, double k=0)
 Set the reference vector for EXT and RAD.
void SetAXS (string axs)
void AddBias (string bias)
 add a bias to the bias vector
void SetExtern (bool state=true)
void SetDirection (string dir)
 set the direction bias
void SetRadius (string rad)
 set the Radius bias
void SetParticleType (int particle)
 set the Particletype (1=n,9=H,...)
int GetParticleType ()
 get the Particletype (1=n,9=H,...)
void SetParticleDistribution (string ParticleDistribution)
 set the Particle Distibution if more than one particle type
void SetDistribution (string D)
void SetKcode (int ActiveCycle=100, int InactiveCycle=10, double ExpectedKeff=1.)
bool GetKcode ()
 returns true for KCODE calculation mode.
int GetNActiveCycle ()
 Returns number of active Kcode cycles.
int GetNInactiveCycle ()
 Returns number of inactive Kcode cycles.
void SetKSRC ()
void AddPosition (double *pos)
 Add a position to the KSRC position vector (in m)
void AddPosition (double x, double y, double z)
 Add a position to the KSRC position vector (in m)
void SetKSRCPosition (int i, double *pos)
 Allow to modify a KSRC point source position.
string Print ()
 Print the MCNP source (into MNCP input file).
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.

Private Attributes

int fNPS
 number of source particles
string fEnergy
 Energy of the Source (either a number or a bias)
double * fPosition
 Position of the point Source (if it is the case)
int fSurface
 Surface number for surface source (if it is the case)
Shape_ptr fSurfaceShape
 Surface Shape for surface source (if it is the case)
double fNormal
 Normal direction (inward or outward) for particle source.
double fWeight
 weight of the source
string fDirection
 direction bias
string fRadius
 direction bias
string fDistribution
 source distribution (use with bias)
string fEXT
 Cell case:distance from POS along AXS Surface Case:cosine of angle from AXS.
vector< string > fVEC
 Reference vector for DIR.
vector< string > fAXS
 Reference vector for ext and rad.
vector< string > fBias
 vector of bias
bool fExtern
 whether the source is extern or defined in MCNP file
bool fKcode
 whether or not a KCODE is wanted
bool fKSRC
 whether or not a KSRC source is wanted
int fActiveCycle
 number of active cycles in KCODE
int fInactiveCycle
 number of inactive cycles in KCODE
double fKeff
 expected Keff in KCODE
int fParticleType
 particle type for the source (1=neutron)
string fParticleDistribution
 if not only one particle
vector< double * > fKSRCposition
 KSRC position vector.
vector< Tube * > fSourceTube
 vector of Tube for <> sources
vector< string > fTubeParticleEnergy
 vector of "energies" of each source tube (double or distribution)
vector< Spectrum * > fTubeParticleSpectrum
 vector of energy spectrum if the source uses Spectrum

Detailed Description

Define a MCNP Source.

This source has to be added to the global gMURE pointer.

See also:
MURE::SetSource
Author:
PTO
Version:
1.0

Constructor & Destructor Documentation

MCNPSource::MCNPSource ( int  NPS = 10000)

Normal Constructor.

Parameters:
NPS: number of source particles (default=10 000)

Copy Constructor.

destructor


Member Function Documentation

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*).

Parameters:
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.
void MCNPSource::AddTubeSource ( Tube tube,
Spectrum spectrum 
)

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*).

Parameters:
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
bool MCNPSource::GetKcode ( ) [inline]

returns true for KCODE calculation mode.

int MCNPSource::GetNActiveCycle ( ) [inline]

Returns number of active Kcode cycles.

Returns number of inactive Kcode cycles.

int MCNPSource::GetNPS ( ) [inline]

returns the number of source particles

int MCNPSource::GetParticleType ( ) [inline]

get the Particletype (1=n,9=H,...)

double* MCNPSource::GetPosition ( ) [inline]

returns the position of a point source

string MCNPSource::Print ( )

Print the MCNP source (into MNCP input file).

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)
void MCNPSource::SetDirection ( string  dir) [inline]

set the direction bias

void MCNPSource::SetDistribution ( string  D) [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:
                MCNPSource s;
                s.SetDistribution("RAD=D1 EXT =D2");
                s.AddBias("SI1 1 2"); //radial extension (from r=1cm to r=2cm) 
                s.AddBias("SI2 -10 10");//axial extension (from z=-10cm to z=10cm)

Rem: one can specify also any cards of a SDEF line (such as AXS x y z, ...).

Parameters:
D: the source distribution.
void MCNPSource::SetEnergy ( double  E = 2.5e6)

Set the energy for a point source (in eV)

void MCNPSource::SetEnergy ( string  E) [inline]

Set the source energy (using bias)

void MCNPSource::SetEXT ( string  EXT) [inline]

See fEXT description.

void MCNPSource::SetEXT ( double  ext)
void MCNPSource::SetExtern ( bool  state = true) [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.

Parameters:
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.

Parameters:
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.
void MCNPSource::SetKSRC ( ) [inline]

Set KSRC source for MCNP. It allows to suppress SDEF card and specify multipoint source position. See MCNPSource::AddPosition()

void MCNPSource::SetKSRCPosition ( int  i,
double *  pos 
) [inline]

Allow to modify a KSRC point source position.

void MCNPSource::SetNormal ( double  nrm) [inline]

Set the normal direction of source (inward or outward)

void MCNPSource::SetNPS ( int  NPS = 10000) [inline]

set the number of source particles (default=10 000).

void MCNPSource::SetParticleDistribution ( string  ParticleDistribution) [inline]

set the Particle Distibution if more than one particle type

void MCNPSource::SetParticleType ( int  particle) [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)

void MCNPSource::SetRadius ( string  rad) [inline]

set the Radius bias

void MCNPSource::SetSurface ( int  num) [inline]

set the Surface number for a surface source.

void MCNPSource::SetSurface ( Shape_ptr  TheShape) [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)
void MCNPSource::SetWeight ( double  wgt) [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

Parameters:
spectrum,:must be either NeutronSpectrum,GammaSpectrum or BetaSpectrum
SourceDistributionNum,:the MCNP source distribution number used in D, SI,SP, ... cards

Member Data Documentation

int MCNPSource::fActiveCycle [private]

number of active cycles in KCODE

vector<string> MCNPSource::fAXS [private]

Reference vector for ext and rad.

vector<string> MCNPSource::fBias [private]

vector of bias

string MCNPSource::fDirection [private]

direction bias

string MCNPSource::fDistribution [private]

source distribution (use with bias)

string MCNPSource::fEnergy [private]

Energy of the Source (either a number or a bias)

string MCNPSource::fEXT [private]

Cell case:distance from POS along AXS Surface Case:cosine of angle from AXS.

bool MCNPSource::fExtern [private]

whether the source is extern or defined in MCNP file

number of inactive cycles in KCODE

bool MCNPSource::fKcode [private]

whether or not a KCODE is wanted

double MCNPSource::fKeff [private]

expected Keff in KCODE

bool MCNPSource::fKSRC [private]

whether or not a KSRC source is wanted

vector<double*> MCNPSource::fKSRCposition [private]

KSRC position vector.

double MCNPSource::fNormal [private]

Normal direction (inward or outward) for particle source.

int MCNPSource::fNPS [private]

number of source particles

if not only one particle

particle type for the source (1=neutron)

double* MCNPSource::fPosition [private]

Position of the point Source (if it is the case)

string MCNPSource::fRadius [private]

direction bias

vector<Tube*> MCNPSource::fSourceTube [private]

vector of Tube for <> sources

int MCNPSource::fSurface [private]

Surface number for surface source (if it is the case)

Surface Shape for surface source (if it is the case)

vector<string> MCNPSource::fTubeParticleEnergy [private]

vector of "energies" of each source tube (double or distribution)

vector of energy spectrum if the source uses Spectrum

vector<string> MCNPSource::fVEC [private]

Reference vector for DIR.

double MCNPSource::fWeight [private]

weight of the source


The documentation for this class was generated from the following files:

MURE Project, documentation generated by Doxygen 1.8.0 - Mon Apr 15 2013