MURE
Loading...
Searching...
No Matches
MCSource.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
19#ifndef _MCSource_
20#define _MCSource_
26#include <vector>
27#include <string>
28#include <iosfwd>
29
30#include "Shape.hxx"
31#include "TReference.hxx"
32
33using namespace std;
34
35
36class Shape;
37
38typedef Reference_ptr < Shape > Shape_ptr;
39
41
53{
54 public:
56
59 MCSource(double NPS = 10000);
60 MCSource(const MCSource &s);
61 virtual MCSource *Clone() = 0;
62 virtual ~MCSource();
63
64 void SetNPS(double NPS = 10000)
65 {
66 fNPS = NPS;
67 }
68 double GetNPS()
69 {
70 return fNPS;
71 }
72 void SetEnergy(double E = 2.5e6);
73 void SetPosition(double *pos = nullptr);
74 void SetPosition(double x = 0, double y = 0, double z = 0);
75 double *GetPosition()
76 {
77 return fPosition;
78 }
79
80 virtual void SetSurface(Shape_ptr TheShape);
81 void SetNormal(double nrm)
82 {
83 fNormal = nrm;
84 }
85 void SetWeight(double wgt)
86 {
87 fWeight = wgt;
88 }
89
97 void SetExtern(bool state = true)
98 {
99 fExtern = state;
100 }
107 void SetKcode(int ActiveCycle = 100, int InactiveCycle = 10, double ExpectedKeff = 1.);
108 bool GetKcode()
109 {
110 return fKcode;
111 }
113 {
114 return fActiveCycle;
115 }
117 {
118 return fInactiveCycle;
119 }
120 virtual string Print() = 0;
121
123
129 virtual void UsePreviousRunSource(string FirstSource = "") = 0;
130 virtual bool IsUsePrevSource()
131 {
132 return fUsePrevSource;
133 }
134 void SetUsePrevSource(bool flag = true)
135 {
136 fUsePrevSource = flag;
137 }
139 {
140 return fSourceFile;
141 }
142 void SetSourceFileName(string name)
143 {
144 fSourceFile = name;
145 }
147 {
148 fOriginalSourceFile = name;
149 }
151 {
152 return fOriginalSourceFile;
153 }
154
158
159 protected:
160 double fNPS;
161 string fEnergy;
162 double *fPosition;
163
165 double fNormal;
166
167 double fWeight;
168 bool fExtern;
169 bool fKcode;
172 double fKeff;
173
174 string fSourceFile;
177
180
181};
182#endif
Reference_ptr< Shape > Shape_ptr
Definition MCSource.hxx:38
Header file for Shape class and Shape_ptr type.
Header file for TReference class and Reference_ptr template.
Define a Monte-Carlo Source.
Definition MCSource.hxx:53
virtual void SetSurface(Shape_ptr TheShape)
set the Surface number for a surface source.
Definition MCSource.cxx:141
void SetNPS(double NPS=10000)
Definition MCSource.hxx:64
void SetPosition(double *pos=nullptr)
set the position of a point source (in m)
Definition MCSource.cxx:120
double fKeff
expected Keff in KCODE
Definition MCSource.hxx:172
void SetEnergy(double E=2.5e6)
Set the energy for a point source (in eV)
Definition MCSource.cxx:112
void SetKcode(int ActiveCycle=100, int InactiveCycle=10, double ExpectedKeff=1.)
Definition MCSource.cxx:103
void SetOriginalSourceFileName(string name)
Definition MCSource.hxx:146
double * GetPosition()
Definition MCSource.hxx:75
int fInactiveCycle
number of inactive cycles in KCODE
Definition MCSource.hxx:171
void SetNormal(double nrm)
Definition MCSource.hxx:81
void SetStochasticVolumeSourceShape(Shape_ptr TheShape)
Set the shape of the outer most sphere for Stochastic Volume run.
Definition MCSource.cxx:150
void SetSourceFileName(string name)
Definition MCSource.hxx:142
bool IsStochasticVolumeSource()
True if this is a Stochastic Volume Source run.
Definition MCSource.hxx:155
string fOriginalSourceFile
Name of the Original source file.
Definition MCSource.hxx:175
bool fUsePrevSource
Whether MURE must use the preivous run source or not.
Definition MCSource.hxx:176
int GetNInactiveCycle()
Definition MCSource.hxx:116
Shape_ptr GetStochasticVolumeSourceShape()
get the source sphere for Stochastic Volume Source run
Definition MCSource.hxx:157
bool fKcode
whether or not a KCODE is wanted
Definition MCSource.hxx:169
int GetNActiveCycle()
Definition MCSource.hxx:112
void SetWeight(double wgt)
Definition MCSource.hxx:85
void SetUsePrevSource(bool flag=true)
Definition MCSource.hxx:134
string fSourceFile
Name of the next source if using file source.
Definition MCSource.hxx:174
double fNPS
number of source particles
Definition MCSource.hxx:160
double * fPosition
Position of the point Source (if it is the case)
Definition MCSource.hxx:162
bool GetKcode()
Definition MCSource.hxx:108
bool fStochasticVolumeSource
Definition MCSource.hxx:178
double fNormal
Normal direction (inward or outward) for particle source.
Definition MCSource.hxx:165
Shape_ptr fStochasticVolumeSourceShape
Definition MCSource.hxx:179
virtual void UsePreviousRunSource(string FirstSource="")=0
use a previous kcode source for mcnp.
bool fExtern
whether the source is extern or defined in MCNP file
Definition MCSource.hxx:168
string fEnergy
Energy of the Source (either a number or a bias)
Definition MCSource.hxx:161
string GetOriginalSourceFileName()
Definition MCSource.hxx:150
double GetNPS()
Definition MCSource.hxx:68
virtual ~MCSource()
destructor
Definition MCSource.cxx:96
virtual string Print()=0
Print the MC source (into MC transport code input file).
int fActiveCycle
number of active cycles in KCODE
Definition MCSource.hxx:170
void SetExtern(bool state=true)
Definition MCSource.hxx:97
virtual MCSource * Clone()=0
Clone method.
string GetSourceFileName()
Definition MCSource.hxx:138
virtual bool IsUsePrevSource()
Definition MCSource.hxx:130
Shape_ptr fSurfaceShape
Surface Shape for surface source (if it is the case)
Definition MCSource.hxx:164
double fWeight
weight of the source
Definition MCSource.hxx:167
Abstract class to define geometrical shapes.
Definition Shape.hxx:85
the namespace of the Standard C++

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