MURE
Loading...
Searching...
No Matches
Nucleus.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 _NUCLEUS_
20#define _NUCLEUS_
27#include <libValErr/ValErr.hxx>
28#include <vector>
29#include <map>
30#include <string>
31#include <sstream>
32#include <iostream>
33#include <utility>
34#include <algorithm>
35
36#include "TReference.hxx"
37#include "ZAI.hxx"
38#include "NucleusMCRecord.hxx"
39
40class NucleusMCRecord;
41
42using namespace std;
43
44class Nucleus;
45
46typedef Reference_ptr < Nucleus > Nucleus_ptr;
47
48class Cell;
49
51
70class Nucleus : public TReference
71{
72 public:
74
82 Nucleus(int aZ, int aA, int aI = 0, bool Moderator = 0, bool Evolution = false);
84
93 Nucleus(int aZ, int aA, int aI, double T, bool Moderator = 0, bool Evolution = false);
95
102 Nucleus(ZAI *zai, double T, bool Moderator = 0, bool Evolution = false);
103 //Nucleus(const Nucleus &n); //!< Copy constructor
104 Nucleus(const Nucleus &n, bool clone = false);
105 ~Nucleus() override;
106
111 int Z()
112 {
113 return fZAI -> Z();
114 }
115 int A()
116 {
117 return fZAI -> A();
118 }
119 int I()
120 {
121 return fZAI -> I();
122 }
124 {
125 return fZAI;
126 }
127 void SetZAI(int aZ, int aA, int aI);
128 double GetMass()
129 {
130 return fZAI -> GetMass();
131 }
132 void SetMass(double m)
133 {
134 fZAI -> SetMass(m);
135 }
137 {
138 return fTemperature;
139 }
140 void SetTemperature(double T)
141 {
142 fIdCode = "";
143 fIdCode2 = "";
144 fTemperature = T;
145 }
146
148 {
149 return fModerator;
150 }
152 {
153 return fModeratorLine;
154 }
155 void SetModeratorName(string name)
156 {
157 fModeratorName = name;
158 fModerator = true;
159 }
160 void SetModeratorLine(string line)
161 {
162 fModeratorLine = line;
163 }
164
166
182 void SetModeratorCategory(string ModeratorCategory)
183 {
184 fModeratorCategory = ModeratorCategory;
185 }
188
194
197 string FindMCCode();
199
203 void FindMCCode2();
204 //void AddCell(Cell *cell){fCellVector.push_back(cell);} //!< Say that this Nucleus is in cell
205 void SetXSExtension(string code);
206 void SetXSDIRLine(string Line)
207 {
208 fBestLine = Line;
209 fUserCode = false;
210 }
211 string GetIdCode()
212 {
213 return fIdCode;
214 }
215 string GetIdCode2();
216 void SetIdCode(string code = "")
217 {
218 fIdCode = code;
219 }
220 string GetBestLine()
221 {
222 return fBestLine;
223 }
224 string GetBestLine2();
225 void SetBestLine(string BestLine)
226 {
227 fBestLine = BestLine;
228 }
229 void SetGlobalNucleiIndex(int Index)
230 {
231 fGlobalNucleiIndex = Index;
232 }
233 string FindMCModeratorName();
234
236
242 double FindCode(double Temperature, string Type, bool AllWarning = false);
243
244 void SetXSCode(vector < int > XSC)
245 {
246 fXSCode = XSC;
247 }
248 vector < int > GetXSCode()
249 {
250 return fXSCode;
251 }
253 {
254 return fUserCode;
255 }
257
263
268 double GetSigmaPhi(Cell *cell, int ReactionCode);
269
271
276 ValErr_t GetMCSigmaPhi(Cell *cell, int ReactionCode);
277
279
283 ValErr_t GetMCSigma(Cell *cell, int ReactionCode);
284
286
292 ValErr_t GetMCSigmaPhi2(Cell *cell, int ReactionCode);
293
295
301 double GetSigmaPhi2(Cell *cell, int ReactionCode);
302
304
308 ValErr_t GetMCSigmaFM(int BinNum, int FMBinNum);
309
311
316 ValErr_t GetMCSigma2(Cell *cell, int ReactionCode);
317
319
324 ValErr_t GetMCSigmaPhiFM(int BinNum, int FMBinNum);
325
326
328
334 void SetMCSigmaPhi(int BinNum, int FMBinNum, ValErr_t r);
335
337
344 void SetMCSigmaPhi2(int BinNum, int FMBinNum, ValErr_t r);
345
347
353 void SetMCSigma2(int BinNum, int FMBinNum, ValErr_t xs);
354
356
361 void SetMCSigma(int BinNum, int FMBinNum, ValErr_t xs);
362
363
364
365
366
367 void SetTotalSigma(double xs)
368 {
369 fTotalSigma = xs;
370 }
372 {
373 return fTotalSigma;
374 }
375 double GetTotalSigmaPhi(Cell *cell);
376 void SetTotalSigmaPhi(int BinNum, double xs);
378 int GetNumberOfCells();
379 bool IsInThatCell(int CellNum);
380 int GetCellBinNumber(int CellNum);
381 int GetNumberOfMultiplicatorBinInCell(int CellNum);
382
383 vector < NucleusMCRecord *> &GetNucleusMCRecord()
384 {
385 return fNucleusMCRecord;
386 }
387 void AddNucleusMCRecord(int TallyNum, int CellNumber, int TallyBinIdx);
389
390 int FindFMBin(int ReactionCode);
391 void FindSlope(int BinNum, int FMBinNum);
392 void FindSmooth(int BinNum, int FMBinNum);
394
400 string Print();
401 string PrintPseudoNucleus(double proportion);
402 void SetEvolution(bool Evolution)
403 {
404 fEvolution = Evolution;
405 }
407 {
408 return fEvolution;
409 }
411 {
412 return fGlobalNucleiIndex;
413 }
414 void ResetFirstReaction();
415 bool IsFirstTimeReactionAsk(int ReactionCode);
416 void SetFirstTimeReactionAsk2False(int ReactionCode);
417
419
426 void Duplicate(bool flag)
427 {
428 fDuplicate = flag;
429 }
431 {
432 return fDuplicate;
433 }
434 void SetAlreadyWarn(bool flag = true)
435 {
436 fAlreadyWarn = flag;
437 }
439 {
440 return fAlreadyWarn;
441 }
442
444
449 {
451 }
453 {
454 return fPseudoNucleus;
455 }
456 void SetPseudoNucleus(bool flag = true)
457 {
458 fPseudoNucleus = flag;
459 }
460 void SetTemperatureEvolution(bool flag = true)
461 {
462 fTemperatureEvolution = flag;
463 }
464
465 void SetNuSigmaFisPhi(int BinNum, double Value);
466 vector < double > GetNuSigmaFisPhi()
467 {
468 return fNuSigmaFisPhi;
469 }
470 double GetNuSigmaFisPhi(int BinNum);
471 double GetNuSigmaFisPhi(Cell *cell);
473
474
475 private:
477
483 double GetSigmaPhi(int BinNum, int ReactionCode);
485
491 double GetSigmaPhi2(int BinNum, int ReactionCode);
493
498 ValErr_t GetMCSigmaPhi(int BinNum, int ReactionCode);
500
506 ValErr_t GetMCSigmaPhi2(int BinNum, int ReactionCode);
508
513 double GetSigmaPhi(Cell *cell, ZAI *daughter);
515
520 ValErr_t GetMCSigmaPhi(Cell *cell, ZAI *daughter);
521
523
527 ValErr_t GetMCSigma(int BinNum, int ReactionCode);
529
534 ValErr_t GetMCSigma2(int BinNum, int ReactionCode);
536
540 ValErr_t GetMCSigma(Cell *cell, ZAI *daughter);
541
542
543
544 void InitSigmaPhi();
545 int FindReactionCode(ZAI *daughter);
546 int FindCellBin(Cell *cell);
547
548 int NumberOfReactions();
549 bool IsModeratorCategoryOk(string Code);
550
552
554
558
563
565 string fIdCode;
566 string fIdCode2;
568 string fBestLine;
569 string fBestLine2;
570
575
576 vector < NucleusMCRecord *> fNucleusMCRecord;
579
581
585 vector < vector < vector < ValErr_t > > > fSigmaPhi;
587
592 vector < vector < vector < ValErr_t > > > fSigmaPhi2;
594
598 vector < vector < ValErr_t > > fMCSigmaPhi;
600
605 vector < vector < ValErr_t > > fMCSigmaPhi2;
607
613 vector < vector < ValErr_t > > fMCSigmaPhi3;
615
619 vector < vector < ValErr_t > > fMCSigma;
621
626 vector < vector < ValErr_t > > fMCSigma2;
627 vector < double > fTotalSigmaPhi;
628 //int fFMTotalBinNum; //!< FM Tally bin Number for total reaction rate
629 vector < int > fXSCode;
630 vector < double > fNuSigmaFisPhi;
631 double fTotalSigma;
632
633 vector < double > fMCTime;
634
635 vector < vector < double > > fFitSlope;
636 vector < vector < double > > fIntersept;
637 vector < vector < double > > fFitSlope2;
638 vector < vector < double > > fIntersept2;
639
640 map < int, bool > fFirstTimeReactionAsk;
641 bool **fASK;
642};
643#endif
Header file for NucleusMCRecord class.
Reference_ptr< Nucleus > Nucleus_ptr
Definition Nucleus.hxx:46
Header file for TReference class and Reference_ptr template.
Header file for ZAI and ZAIReaction classes.
A Cell is composed from a Shape and a Material.
Definition Cell.hxx:84
A NucleusMCRecord allows to record data for writing &reading reaction rates tallies.
Definition NucleusMCRecord.hxx:54
A real Nucleus with a Temperature.
Definition Nucleus.hxx:71
double GetTotalSigmaPhi(Cell *cell)
returns total sigma*phi of cell
Definition Nucleus.cxx:1259
void SetMCSigma(int BinNum, int FMBinNum, ValErr_t xs)
Set the cross section from the nucleus to its daughter.
Definition Nucleus.cxx:1115
void SetMCSigma2(int BinNum, int FMBinNum, ValErr_t xs)
Set the cross section from the nucleus to its daughter.
Definition Nucleus.cxx:1131
vector< double > GetNuSigmaFisPhi()
Definition Nucleus.hxx:466
string GetModeratorLine()
Definition Nucleus.hxx:151
vector< double > fNuSigmaFisPhi
Nu tot sigma micro phi.
Definition Nucleus.hxx:630
void InitSigmaPhi()
init reaction rate array
Definition Nucleus.cxx:1355
bool fEvolution
whether or not it is an evolutive nucleus
Definition Nucleus.hxx:553
int Z()
Definition Nucleus.hxx:111
void SetZAI(int aZ, int aA, int aI)
set the ZAI *of the Nucleus
Definition Nucleus.cxx:793
ValErr_t GetMCSigma2(Cell *cell, int ReactionCode)
returns the cross-section of the nucleus according to the reaction code.
Definition Nucleus.cxx:1244
void SetXSExtension(string code)
allows user to override the XS id code for MC
Definition Nucleus.cxx:1502
string GetIdCode2()
Returns the alternative Extension of this nucleus.
Definition Nucleus.cxx:1822
bool ** fASK
temporary flag....
Definition Nucleus.hxx:641
void SetAlreadyWarn(bool flag=true)
Definition Nucleus.hxx:434
vector< vector< ValErr_t > > fMCSigma2
Cross-sections.
Definition Nucleus.hxx:626
int NumberOfReactions()
returns the number of different reactions
Definition Nucleus.cxx:1302
vector< vector< ValErr_t > > fMCSigmaPhi
MC Reaction rates.
Definition Nucleus.hxx:598
void FindSmooth(int BinNum, int FMBinNum)
Find the smooth reaction rate for a bin.
Definition Nucleus.cxx:1664
string FindMCCode()
Find the closest MC code of the nucleus.
Definition Nucleus.cxx:597
vector< vector< double > > fIntersept2
intersept to find the sigma*phi extrapolation
Definition Nucleus.hxx:638
string PrintPseudoNucleus(double proportion)
Print the nucleus as a pseudo material nucleus (e.g 1001.60c 0.5 1001.70c 0.5)
Definition Nucleus.cxx:705
int A()
Definition Nucleus.hxx:115
void ClearNucleusMCRecord()
Definition Nucleus.cxx:1271
vector< NucleusMCRecord * > & GetNucleusMCRecord()
Definition Nucleus.hxx:383
void SetFirstTimeReactionAsk2False(int ReactionCode)
Set the fFirstTimeReactionAsk[ReactionCode] to false.
Definition Nucleus.cxx:816
int GetNumberOfMultiplicatorBinInCell(int CellNum)
Definition Nucleus.cxx:1850
string GetBestLine()
Definition Nucleus.hxx:220
string fModeratorLine
XSDIR moderator line.
Definition Nucleus.hxx:561
vector< vector< ValErr_t > > fMCSigmaPhi2
MC Reaction rates.
Definition Nucleus.hxx:605
int fNReaction
Number of different reactions.
Definition Nucleus.hxx:577
void SetXSCode(vector< int > XSC)
Definition Nucleus.hxx:244
double GetSigmaPhi2(Cell *cell, int ReactionCode)
returns the disparition rate of the nucleus according to the reaction code.
Definition Nucleus.cxx:985
void SetPseudoNucleus(bool flag=true)
Definition Nucleus.hxx:456
void SetTemperature(double T)
Definition Nucleus.hxx:140
string Print()
Print MC code and Proportion of the nucleus.
Definition Nucleus.cxx:698
~Nucleus() override
Normal destructor.
Definition Nucleus.cxx:194
vector< vector< double > > fFitSlope
slope to find the sigma*phi extrapolation
Definition Nucleus.hxx:635
vector< vector< ValErr_t > > fMCSigmaPhi3
MC Reaction rates for PCE fit in corrector step.
Definition Nucleus.hxx:613
bool IsDuplicate()
Definition Nucleus.hxx:430
string fBestLine2
Second best line of the BaseSummary.dat for this Nucleus.
Definition Nucleus.hxx:569
bool IsTemperatureEvolution()
say if the nucleus temperature is going to evolved.
Definition Nucleus.hxx:448
string FindMCModeratorName()
find MC moderator name (e.g. grph.01t)
Definition Nucleus.cxx:689
void SetMCSigmaPhi(int BinNum, int FMBinNum, ValErr_t r)
Set the disparition rate from the nucleus to its daughter.
Definition Nucleus.cxx:1062
void FindSlope(int BinNum, int FMBinNum)
Find the reaction rate slope for a bin.
Definition Nucleus.cxx:1510
vector< vector< double > > fIntersept
intersept to find the sigma*phi extrapolation or the Smooth value if used
Definition Nucleus.hxx:636
void SetMCSigmaPhi2(int BinNum, int FMBinNum, ValErr_t r)
Set the disparition rate from the nucleus to its daughter.
Definition Nucleus.cxx:1108
void SetModeratorName(string name)
Definition Nucleus.hxx:155
int GetNumberOfCells()
Definition Nucleus.cxx:1279
bool IsUserCode()
Definition Nucleus.hxx:252
string fIdCode
MC id code for the closest cross-section (.60c)
Definition Nucleus.hxx:565
string GetIdCode()
Definition Nucleus.hxx:211
bool IsPseudoNucleus()
Definition Nucleus.hxx:452
ZAI * GetZAI()
Definition Nucleus.hxx:123
int I()
Definition Nucleus.hxx:119
int fNBinCell
Number of different reactions.
Definition Nucleus.hxx:578
ValErr_t GetMCSigmaPhiFM(int BinNum, int FMBinNum)
returns the disparition rate from the nucleus for a given FM bin number.
Definition Nucleus.cxx:883
string GetModeratorCategory()
Definition Nucleus.hxx:186
vector< vector< vector< ValErr_t > > > fSigmaPhi2
Reaction rates.
Definition Nucleus.hxx:592
int FindReactionCode(ZAI *daughter)
Find the Reaction code that leeds to daughter.
Definition Nucleus.cxx:865
void SetEvolution(bool Evolution)
Definition Nucleus.hxx:402
void SetTotalSigma(double xs)
Definition Nucleus.hxx:367
double fTotalSigma
Total cross section.
Definition Nucleus.hxx:631
bool IsEvolutive()
Definition Nucleus.hxx:406
double GetSigmaPhi(Cell *cell, int ReactionCode)
returns the disparition rate of the nucleus according to the reaction code.
Definition Nucleus.cxx:971
void SetModeratorCategory(string ModeratorCategory)
Set the moderator category.
Definition Nucleus.hxx:182
bool IsModeratorCategoryOk(string Code)
returns true is Code and fModeratorCategory are compatible
Definition Nucleus.cxx:1397
string fModeratorCategory
Moderator category for automatic moderator name.
Definition Nucleus.hxx:562
void AddNucleusMCRecord(int TallyNum, int CellNumber, int TallyBinIdx)
Definition Nucleus.cxx:1328
double fBaseTemperature1
Closest Base temperature to fTemperature.
Definition Nucleus.hxx:572
bool fUserCode
whether or not the user has given the extension, by a SetXSExtension()
Definition Nucleus.hxx:564
int fGlobalNucleiIndex
Index of this nucleus in the Global nuclei vector.
Definition Nucleus.hxx:567
ValErr_t GetMCSigmaFM(int BinNum, int FMBinNum)
returns the cross-section of the nucleus according to FM bin number.
Definition Nucleus.cxx:1138
vector< vector< vector< ValErr_t > > > fSigmaPhi
Reaction rates.
Definition Nucleus.hxx:585
bool fPseudoNucleus
whether or not nucleus is a pseudo nucleus
Definition Nucleus.hxx:555
void SetNuSigmaFisPhi(int BinNum, double Value)
Set Nu tot sigma phi (E)
Definition Nucleus.cxx:1088
void Duplicate(bool flag)
Say that a nucleus is duplicate in a material.
Definition Nucleus.hxx:426
void SetModeratorLine(string line)
Definition Nucleus.hxx:160
ValErr_t GetMCSigma(Cell *cell, int ReactionCode)
returns the cross-section of the nucleus according to the reaction code.
Definition Nucleus.cxx:1229
vector< vector< double > > fFitSlope2
slope to find the sigma*phi extrapolation
Definition Nucleus.hxx:637
bool fModerator
whether or not apply a S(alpha, Beta) thermal treatment
Definition Nucleus.hxx:559
int FindFMBin(int ReactionCode)
Find the FM bin number of the reaction code.
Definition Nucleus.cxx:830
map< int, bool > fFirstTimeReactionAsk
a map of Reaction code to bool
Definition Nucleus.hxx:640
double GetTemperature()
Definition Nucleus.hxx:136
bool fTemperatureEvolution
whether or not temperature will evolve
Definition Nucleus.hxx:574
vector< double > fTotalSigmaPhi
Total sigma phi in each Tally bin.
Definition Nucleus.hxx:627
bool IsModerator()
Definition Nucleus.hxx:147
string fBestLine
Best line of the BaseSummary.dat for this Nucleus.
Definition Nucleus.hxx:568
void SetBestLine(string BestLine)
Definition Nucleus.hxx:225
void SetTemperatureEvolution(bool flag=true)
Definition Nucleus.hxx:460
ZAI * fZAI
Pointer on the ZAI.
Definition Nucleus.hxx:551
void ResetFirstReaction()
Set all fFirstTimeReactionAsk to true.
Definition Nucleus.cxx:804
vector< double > fMCTime
vector of last MC run time
Definition Nucleus.hxx:633
string fIdCode2
MC id code for the second closest cross-section (.60c)
Definition Nucleus.hxx:566
bool fDuplicate
True for duplicate nucleus in composition.
Definition Nucleus.hxx:556
bool IsAlreadyWarn()
Definition Nucleus.hxx:438
double GetMass()
Definition Nucleus.hxx:128
void FindMCCode2()
Find the secondary MC code of the nucleus.
Definition Nucleus.cxx:621
ValErr_t GetMCSigmaPhi2(Cell *cell, int ReactionCode)
returns the disparition rate of the nucleus according to the reaction code.
Definition Nucleus.cxx:1034
vector< int > fXSCode
array of reaction codes in tally multiplier bins
Definition Nucleus.hxx:629
int FindCellBin(Cell *cell)
Find the tally bin number of cell.
void SetGlobalNucleiIndex(int Index)
Definition Nucleus.hxx:229
string GetBestLine2()
Gives the second best BaseSummary line for this nucleus.
Definition Nucleus.cxx:1829
bool fAlreadyWarn
true when a 1st warning occur in Material::print()
Definition Nucleus.hxx:557
double GetTotalSigma()
Definition Nucleus.hxx:371
int GetNumberOfReactions()
Definition Nucleus.cxx:1293
bool IsInThatCell(int CellNum)
Definition Nucleus.cxx:1837
vector< int > GetXSCode()
Definition Nucleus.hxx:248
string fModeratorName
MC moderator name (e.g. grph.01t)
Definition Nucleus.hxx:560
void SetIdCode(string code="")
Definition Nucleus.hxx:216
int GetGlobalNucleiIndex()
Definition Nucleus.hxx:410
double FindCode(double Temperature, string Type, bool AllWarning=false)
Find either Nucleus MC code, or Moderator MC code.
Definition Nucleus.cxx:233
vector< vector< ValErr_t > > fMCSigma
Cross-sections.
Definition Nucleus.hxx:619
double fBaseTemperature2
Second closest Base temperature to fTemperature.
Definition Nucleus.hxx:573
void SetTotalSigmaPhi(int BinNum, double xs)
set the total reaction rate
Definition Nucleus.cxx:1348
vector< NucleusMCRecord * > fNucleusMCRecord
Definition Nucleus.hxx:576
bool IsFirstTimeReactionAsk(int ReactionCode)
returns the fFirstTimeReactionAsk[ReactionCode]
Definition Nucleus.cxx:823
void SetMass(double m)
Definition Nucleus.hxx:132
void SetXSDIRLine(string Line)
Definition Nucleus.hxx:206
double fTemperature
The temperature of the nucleus.
Definition Nucleus.hxx:571
int GetCellBinNumber(int CellNum)
Definition Nucleus.cxx:1863
ValErr_t GetMCSigmaPhi(Cell *cell, int ReactionCode)
returns the disparition rate of the nucleus according to the reaction code.
Definition Nucleus.cxx:1022
Base class to reference all Shape objects and some nucleus.
Definition TReference.hxx:38
A ZAI defined a (Z, A, Isomere) for a Nucleus.
Definition ZAI.hxx:118
the namespace of the Standard C++

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