MURE
Loading...
Searching...
No Matches
MureTally.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 _MURETALLY_HXX_
20#define _MURETALLY_HXX_
21
27#include <vector>
28#include <algorithm>
29#include <iosfwd>
30#include <string>
31
32using namespace std;
33#include "Material.hxx"
34#include "Reaction.hxx"
36#include "MCSource.hxx"
37
38class Cell;
39class Material;
40class MureTallyBin;
41class PinCell;
42class Reaction;
43
45
56{
57 public:
70 TallyMultiplicator(Material *M, int reaction, double constant = 1);
84 TallyMultiplicator(Material *M, Reaction *R, double constant = 1);
93 TallyMultiplicator(int MatNumber, int reaction, double constant = 1);
95
102 TallyMultiplicator(int MatNumber, Reaction *R, double constant = 1);
103
106
108 {
109 return fMatNumber;
110 }
111 double GetConstant()
112 {
113 return fConstant;
114 }
116 {
117 return fReaction;
118 }
119
120 private:
121 void Init(int MatNumber, Reaction *R, double constant = 1);
122 double fConstant;
125};
126
127
128
129
131
141{
142 public:
143
145
149 MureTally();
150 MureTally(const MureTally &t);
151 virtual MureTally *Clone() = 0;
152 virtual ~MureTally();
153
155 {
156 return fNumber;
157 }
158 void SetNumber(int num)
159 {
160 fNumber = num;
161 }
162
163 bool NeedVolume();
164 virtual vector < double > GetBinVolume(int i) = 0;
165 virtual void SetBinVolume(int i, double V, int k = 0) = 0;
166 virtual string Print() = 0;
167 virtual string PrintMultiplicator() = 0;
168 void SetComment(string str)
169 {
170 fComment = str;
171 }
178 void AddEnergy(int NE, double *E);
184 void AddEnergy(vector < double > E);
193 void AddEnergy(int NE, double Emin, double Emax, bool Linear = false);
194
202 void AddEnergy(double Emin, double Emax, int N_by_Decade = 10);
203
204 string PrintDebugET();
205
223 void AddMultiGroupEnergy(double Emin, double Emax, double decad_mult = 1);
224
231 void AddTime(int NT, double *T);
232
241 void AddTime(int NT, double Tmin, double Tmax, bool Linear = false);
242
250 void AddTime(double Tmin, double Tmax, int N_by_Decade = 10);
251
252 void Add(Cell *C, bool SetCellTally = true);
253 void Add(PinCell *C, int i, bool SetCellTally = true);
254 void Add(Shape_ptr S);
255 void Add(int universe);
256 void Add(MureTallyBin *theTallyBin);
257
258 void Add(TallyMultiplicator *Multiplicator)
259 {
260 fMultiplicator.push_back(Multiplicator);
261 }
262 void AddMultiplicator(Material *M, int reaction, double constant = 1);
263 void AddMultiplicator(Material *M, Reaction *R, double constant = 1);
264 void AddMultiplicator(int M, int R, double constant);
265 vector < TallyMultiplicator *> &GetMultiplicator()
266 {
267 return fMultiplicator;
268 }
269
271 {
272 return fBin[i];
273 }
274 vector < MureTallyBin *> &GetBin()
275 {
276 return fBin;
277 }
278
279 int IsInTallyBin(Cell *C);
280 int IsInTallyBin(int num);
281 int IsInTallyBin(Shape_ptr S);
282 void SetPrintable(bool flag = true)
283 {
284 fIsPrintable = flag;
285 }
287 {
288 return fIsPrintable;
289 }
291 {
292 return fType;
293 }
294 void SetType(int type)
295 {
296 fType = type;
297 }
299 {
300 fSkipVolumeCalc = true;
301 }
303 {
304 return fSkipVolumeCalc;
305 }
306 void SetPinCellTally(bool flag)
307 {
308 fIsPinCellTally = flag;
309 }
311 {
312 return fIsPinCellTally;
313 }
314
315 protected:
316
317 bool IsMaterialUsed(int num);
319
320 int fType;
322 vector < TallyMultiplicator *> fMultiplicator;
324 vector < MureTallyBin *> fBin;
326 string fComment;
329
330};
331
332
333
334
335
336#endif
Header file for Monte-Carlo Source abstract class.
Header file for Material class.
Header file for MureTimeEnergyGrid Abstract class.
A Cell is composed from a Shape and a Material.
Definition Cell.hxx:84
A Material constituing a Cell.
Definition Material.hxx:83
Define a general Tally Bin.
Definition MureTallyBin.hxx:62
Define a MURE Tally.abstract class.
Definition MureTally.hxx:141
virtual string Print()=0
MureTimeEnergyGrid::BinRange ETBinRange
Definition MureTally.hxx:144
bool IsVolumeCalculationSkept()
Definition MureTally.hxx:302
virtual void SetBinVolume(int i, double V, int k=0)=0
set the ith bin volume of (the kth partial bin in a LatticeBin) Tally bin
bool fSkipVolumeCalc
flag to know whether or not try to calculate Volume/Surface
Definition MureTally.hxx:327
vector< MureTallyBin * > & GetBin()
Definition MureTally.hxx:274
virtual MureTally * Clone()=0
The only good way to call copy constructor.
string PrintDebugET()
Definition MureTally.cxx:431
virtual MureTimeEnergyGrid * GetNewTimeEnergyGrid()=0
A time &energy grid.
bool IsPrintable()
Definition MureTally.hxx:286
MureTimeEnergyGrid * fTimeEnergyGrid
store time &/or energy grid
Definition MureTally.hxx:323
virtual vector< double > GetBinVolume(int i)=0
returns the ith bin volume of Tally bin
bool IsMaterialUsed(int num)
Definition MureTally.cxx:175
virtual ~MureTally()
Destructor.
Definition MureTally.cxx:149
vector< TallyMultiplicator * > fMultiplicator
array of Multiplicator bin
Definition MureTally.hxx:322
int GetType()
Definition MureTally.hxx:290
int IsInTallyBin(Cell *C)
whether or not the cell/suface "num" is in the bin
Definition MureTally.cxx:555
vector< MureTallyBin * > fBin
array of Cell/Surface bin
Definition MureTally.hxx:324
void Add(TallyMultiplicator *Multiplicator)
Definition MureTally.hxx:258
void SetComment(string str)
Definition MureTally.hxx:168
void SetPrintable(bool flag=true)
Definition MureTally.hxx:282
bool fIsPrintable
True for not printable tallies.
Definition MureTally.hxx:325
int fNumber
Tally number.
Definition MureTally.hxx:321
int fType
Tally type.
Definition MureTally.hxx:320
void SetType(int type)
Definition MureTally.hxx:294
void SkipVolumeCalculation()
Definition MureTally.hxx:298
void AddMultiplicator(Material *M, int reaction, double constant=1)
add a Tally Multiplicator
Definition MureTally.cxx:204
MureTally()
Definition MureTally.cxx:108
void SetNumber(int num)
Definition MureTally.hxx:158
bool NeedVolume()
Whether or not a stochastic volume/surface calculation is needed.
Definition MureTally.cxx:575
void SetPinCellTally(bool flag)
Definition MureTally.hxx:306
MureTallyBin * GetBin(int i)
Definition MureTally.hxx:270
virtual string PrintMultiplicator()=0
string fComment
Tally coment (Added by T. Courau)
Definition MureTally.hxx:326
void AddMultiGroupEnergy(double Emin, double Emax, double decad_mult=1)
Definition MureTally.cxx:320
int GetNumber()
Definition MureTally.hxx:154
bool IsPinCellTally()
Definition MureTally.hxx:310
void AddEnergy(int NE, double *E)
Definition MureTally.cxx:236
void Add(Cell *C, bool SetCellTally=true)
Add a cell bin.
Definition MureTally.cxx:438
bool fIsPinCellTally
flag to know whether the tally is from PinCell
Definition MureTally.hxx:328
void AddTime(int NT, double *T)
Definition MureTally.cxx:361
vector< TallyMultiplicator * > & GetMultiplicator()
Definition MureTally.hxx:265
Define a Time and/or Energy Grid for tallies (abstract class)
Definition MureTimeEnergyGrid.hxx:40
pair< double, double > BinRange
Min and Max value.
Definition MureTimeEnergyGrid.hxx:43
PinCell class allows to create cylindrical cell set included as Matrioshka.
Definition PinCell.hxx:53
Define a Reaction list for Tally multiplicator inputs.
Definition Reaction.hxx:41
Define a Tally Multiplicator entry (FM card in MCNP, dr card in Serpent).
Definition MureTally.hxx:56
double GetConstant()
Definition MureTally.hxx:111
~TallyMultiplicator()
Destructor.
Definition MureTally.cxx:84
Reaction * fReaction
Reaction of the FM/dr card.
Definition MureTally.hxx:124
int GetMaterialNumber()
Definition MureTally.hxx:107
double fConstant
multiplicative constant of the FM, not use in Serpent.
Definition MureTally.hxx:122
void Init(int MatNumber, Reaction *R, double constant=1)
Build a TallyMultiplicator. Called by constructors.
Definition MureTally.cxx:89
int fMatNumber
Material Number of the FM/dr card.
Definition MureTally.hxx:123
Reaction * GetReaction()
Definition MureTally.hxx:115
the namespace of the Standard C++

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