MURE
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
MCSource Class Referenceabstract

Define a Monte-Carlo Source. More...

#include <MCSource.hxx>

Inheritance diagram for MCSource:
MCNPSource SerpentSource

Public Member Functions

 MCSource (double NPS=10000)
 Normal Constructor.
 
 MCSource (const MCSource &s)
 Copy Constructor.
 
virtual MCSourceClone ()=0
 Clone method.
 
virtual ~MCSource ()
 destructor
 
void SetNPS (double NPS=10000)
 
double GetNPS ()
 
void SetEnergy (double E=2.5e6)
 Set the energy for a point source (in eV)
 
void SetPosition (double *pos=nullptr)
 set the position of a point source (in m)
 
void SetPosition (double x=0, double y=0, double z=0)
 set the position of a point source (in m)
 
double * GetPosition ()
 
virtual void SetSurface (Shape_ptr TheShape)
 set the Surface number for a surface source.
 
void SetNormal (double nrm)
 
void SetWeight (double wgt)
 
void SetExtern (bool state=true)
 
void SetKcode (int ActiveCycle=100, int InactiveCycle=10, double ExpectedKeff=1.)
 
bool GetKcode ()
 
int GetNActiveCycle ()
 
int GetNInactiveCycle ()
 
virtual string Print ()=0
 Print the MC source (into MC transport code input file).
 
virtual void UsePreviousRunSource (string FirstSource="")=0
 use a previous kcode source for mcnp.
 
virtual bool IsUsePrevSource ()
 
void SetUsePrevSource (bool flag=true)
 
string GetSourceFileName ()
 
void SetSourceFileName (string name)
 
void SetOriginalSourceFileName (string name)
 
string GetOriginalSourceFileName ()
 
bool IsStochasticVolumeSource ()
 True if this is a Stochastic Volume Source run.
 
void SetStochasticVolumeSourceShape (Shape_ptr TheShape)
 Set the shape of the outer most sphere for Stochastic Volume run.
 
Shape_ptr GetStochasticVolumeSourceShape ()
 get the source sphere for Stochastic Volume Source run
 

Protected Attributes

double 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)
 
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
 
bool fExtern
 whether the source is extern or defined in MCNP file
 
bool fKcode
 whether or not a KCODE is wanted
 
int fActiveCycle
 number of active cycles in KCODE
 
int fInactiveCycle
 number of inactive cycles in KCODE
 
double fKeff
 expected Keff in KCODE
 
string fSourceFile
 Name of the next source if using file source.
 
string fOriginalSourceFile
 Name of the Original source file.
 
bool fUsePrevSource
 Whether MURE must use the preivous run source or not.
 
bool fStochasticVolumeSource
 
Shape_ptr fStochasticVolumeSourceShape
 

Detailed Description

Define a Monte-Carlo Source.

Define a (abstract) MC particle source.

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

See also
MURE::SetSource or ConnectorPlugin::SetSource
Author
PTO
J.Hajnrych
Version
1.0

Constructor & Destructor Documentation

◆ MCSource() [1/2]

MCSource::MCSource ( double  NPS = 10000)

Normal Constructor.

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

◆ MCSource() [2/2]

MCSource::MCSource ( const MCSource s)

Copy Constructor.

◆ ~MCSource()

MCSource::~MCSource ( )
virtual

destructor

Member Function Documentation

◆ Clone()

virtual MCSource * MCSource::Clone ( )
pure virtual

Clone method.

Implemented in MCNPSource, and SerpentSource.

◆ GetKcode()

bool MCSource::GetKcode ( )
inline

< returns true for KCODE calculation mode.

◆ GetNActiveCycle()

int MCSource::GetNActiveCycle ( )
inline

<Returns number of active Kcode cycles

◆ GetNInactiveCycle()

int MCSource::GetNInactiveCycle ( )
inline

<Returns number of inactive Kcode cycles

◆ GetNPS()

double MCSource::GetNPS ( )
inline

< returns the number of source particles

◆ GetOriginalSourceFileName()

string MCSource::GetOriginalSourceFileName ( )
inline

< set the name of the original input source file for kcode run

◆ GetPosition()

double * MCSource::GetPosition ( )
inline

< returns the position of a point source

◆ GetSourceFileName()

string MCSource::GetSourceFileName ( )
inline

< return the name of the input source file for kcode run

◆ GetStochasticVolumeSourceShape()

Shape_ptr MCSource::GetStochasticVolumeSourceShape ( )
inline

get the source sphere for Stochastic Volume Source run

◆ IsStochasticVolumeSource()

bool MCSource::IsStochasticVolumeSource ( )
inline

True if this is a Stochastic Volume Source run.

◆ IsUsePrevSource()

virtual bool MCSource::IsUsePrevSource ( )
inlinevirtual

< return true if an old "s" file is used as MCNP source

◆ Print()

virtual string MCSource::Print ( )
pure virtual

Print the MC source (into MC transport code input file).

Implemented in MCNPSource, and SerpentSource.

◆ SetEnergy()

void MCSource::SetEnergy ( double  E = 2.5e6)

Set the energy for a point source (in eV)

◆ SetExtern()

void MCSource::SetExtern ( bool  state = true)
inline

Say whether the source is extern or defined in MC input 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.

◆ SetKcode()

void MCSource::SetKcode ( int  ActiveCycle = 100,
int  InactiveCycle = 10,
double  ExpectedKeff = 1. 
)

Set a criticallity source mode for MC.

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.

◆ SetNormal()

void MCSource::SetNormal ( double  nrm)
inline

< Set the normal direction of source (inward or outward)

◆ SetNPS()

void MCSource::SetNPS ( double  NPS = 10000)
inline

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

◆ SetOriginalSourceFileName()

void MCSource::SetOriginalSourceFileName ( string  name)
inline

< set the name of the original input source file for kcode run

◆ SetPosition() [1/2]

void MCSource::SetPosition ( double *  pos = nullptr)

set the position of a point source (in m)

◆ SetPosition() [2/2]

void MCSource::SetPosition ( double  x = 0,
double  y = 0,
double  z = 0 
)

set the position of a point source (in m)

◆ SetSourceFileName()

void MCSource::SetSourceFileName ( string  name)
inline

< set the name of the input source file for kcode run

◆ SetStochasticVolumeSourceShape()

void MCSource::SetStochasticVolumeSourceShape ( Shape_ptr  TheShape)

Set the shape of the outer most sphere for Stochastic Volume run.

◆ SetSurface()

void MCSource::SetSurface ( Shape_ptr  TheShape)
virtual

set the Surface number for a surface source.

Reimplemented in SerpentSource.

◆ SetUsePrevSource()

void MCSource::SetUsePrevSource ( bool  flag = true)
inline

< say whether or not to use an old "s" file

◆ SetWeight()

void MCSource::SetWeight ( double  wgt)
inline

< set the Source particle weight

◆ UsePreviousRunSource()

virtual void MCSource::UsePreviousRunSource ( string  FirstSource = "")
pure virtual

use a previous kcode source for mcnp.

Tells MCSource to use for the next MC run the fission source obtained from a previous critical run. In an evolution, each MC step is done using the source from the previous MC step (or the input "s" file provide by the user). This can be used to reduce inactive cycle in critical calculation, starting from an already converge fission source.

Parameters
FirstSource: name of the first source to use. If not specified, creates a default source.

Implemented in MCNPSource, and SerpentSource.

Member Data Documentation

◆ fActiveCycle

int MCSource::fActiveCycle
protected

number of active cycles in KCODE

◆ fEnergy

string MCSource::fEnergy
protected

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

◆ fExtern

bool MCSource::fExtern
protected

whether the source is extern or defined in MCNP file

◆ fInactiveCycle

int MCSource::fInactiveCycle
protected

number of inactive cycles in KCODE

◆ fKcode

bool MCSource::fKcode
protected

whether or not a KCODE is wanted

◆ fKeff

double MCSource::fKeff
protected

expected Keff in KCODE

◆ fNormal

double MCSource::fNormal
protected

Normal direction (inward or outward) for particle source.

◆ fNPS

double MCSource::fNPS
protected

number of source particles

◆ fOriginalSourceFile

string MCSource::fOriginalSourceFile
protected

Name of the Original source file.

◆ fPosition

double* MCSource::fPosition
protected

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

◆ fSourceFile

string MCSource::fSourceFile
protected

Name of the next source if using file source.

◆ fStochasticVolumeSource

bool MCSource::fStochasticVolumeSource
protected

◆ fStochasticVolumeSourceShape

Shape_ptr MCSource::fStochasticVolumeSourceShape
protected

◆ fSurfaceShape

Shape_ptr MCSource::fSurfaceShape
protected

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

◆ fUsePrevSource

bool MCSource::fUsePrevSource
protected

Whether MURE must use the preivous run source or not.

◆ fWeight

double MCSource::fWeight
protected

weight of the source


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

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