MURE
Loading...
Searching...
No Matches
ReadXSFile.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 _ReadXSFile_
20#define _ReadXSFile_
21
26#include <fstream> // for ifstream, std
27#include <string> // for string
28#include <vector> // for vector
29#include <libValErr/ValErr.hxx> // for ValErr_t
30
31using namespace std;
32
33#ifdef MCNP5
34typedef double Real;
35#else
36typedef float Real;
37#endif
38
44{
45 kTotal = 1,
48 kN_2Nd = 11,
49 kN_2N = 16, kN_3N = 17,
51 kN_Nalpha = 22, kN_N3alpha = 23, kN_2Nalpha = 24, kN_3Nalpha = 25,
52 kN_Np = 28,
54 kN_Nd = 32,
56 kN_4N = 37,
58 kN_2Np = 41, kN_3Np = 42,
59 kN_N2p = 44, kN_Npalpha = 45,
63 kN_gamma = 102,
64 kN_p = 103, kN_d = 104, kN_t = 105, kN_He3 = 106,
65 kN_alpha = 107, kN_2alpha = 108, kN_3alpha = 109,
66 kN_2p = 111, kN_palpha = 112, kN_t2alpha = 113,
67 kN_d2alpha = 114, kN_pd = 115, kN_pt = 116, kN_dalpha = 117
68};
69
71
83{
84 public:
95 ReadXSFile(ifstream *inputfile, int start_record, int table_length, int record_length, int nrecord_per_entry, string FN);
104 ReadXSFile(ifstream *inputfile, int start_record, int table_length, string FN);
105 ReadXSFile(const ReadXSFile &XSF);
106 ~ReadXSFile();
107
108 Real GetInterpolXS(int MT, Real E);
109 Real GetXS(int MT, Real E);
110 Real GetXS(int MT, int BinE);
111 double SumXS(int MT);
112 Real *GetEnergy();
113 Real GetEnergy(int i);
115 {
116 return fNEnergy;
117 }
118 int GetXSMinEnergyBin(int MT);
119 int GetXSMaxEnergyBin(int MT);
120 int FindEnergyBin(double E, int N, float *Ephi );
121 int FindEnergyBin(Real E, int N, Real *Earray);
122 int FindEnergyBin(Real E);
124 {
125 return fXSFound;
126 }
127 Real *GetTotalNuBar(int &NE, Real *&E, bool &Todelete);
129 Real *GetPromptNuBar(int &NE, Real *&E);
130 ValErr_t SigmaPhi(int N, vector < ValErr_t > &Phi, float *Ephi, int MT, double emin = 0, double emax = 1e40);
131 ValErr_t NuSigmaFisPhi(int N, vector < ValErr_t > &Phi, float *Ephi);
132
133 private:
134 void ReadNXS();
135 void ReadJXS();
136 void ReadAsciiNXS();
137 void ReadAsciiJXS();
138 void AffectPointer();
139 Real *GetXS(int MT);
141 Real GetFissionXS(int binE);
142 void XSFound()
143 {
144 fXSFound = true;
145 }
146 int GetXSMinMaxEnergyBin(int MT, int min);
147 int GetStartEndEnergyBin(int MT, int min);
148
149 ifstream *OriginalFile;
150 int fNXS[16];
151 int fJXS[32];
161 int fNXXS;
163 bool fXSFound;
164
165};
166
167#endif
ReactionId
Definition ReadXSFile.hxx:44
@ k_3NFission
Definition ReadXSFile.hxx:57
@ kN_N2p
Definition ReadXSFile.hxx:59
@ kN_d2alpha
Definition ReadXSFile.hxx:67
@ kN_pt
Definition ReadXSFile.hxx:67
@ kN_Nt
Definition ReadXSFile.hxx:55
@ kN_2Nalpha
Definition ReadXSFile.hxx:51
@ kN_Nd
Definition ReadXSFile.hxx:54
@ kN_2Np
Definition ReadXSFile.hxx:58
@ kN_alpha
Definition ReadXSFile.hxx:65
@ k_Elastic
Definition ReadXSFile.hxx:46
@ kN_2N
Definition ReadXSFile.hxx:49
@ kN_2Nd
Definition ReadXSFile.hxx:48
@ kN_N3alpha
Definition ReadXSFile.hxx:51
@ kN_Np
Definition ReadXSFile.hxx:52
@ kTotal
Definition ReadXSFile.hxx:45
@ kN_gamma
Definition ReadXSFile.hxx:63
@ kN_3alpha
Definition ReadXSFile.hxx:65
@ kN_NFission
Definition ReadXSFile.hxx:50
@ kN_N2alpha
Definition ReadXSFile.hxx:53
@ kN_pd
Definition ReadXSFile.hxx:67
@ kN_NHe3
Definition ReadXSFile.hxx:55
@ kN_Nt2alpha
Definition ReadXSFile.hxx:55
@ kN_2NFission
Definition ReadXSFile.hxx:50
@ kN_Np2continuum
Definition ReadXSFile.hxx:61
@ kN_3Np
Definition ReadXSFile.hxx:58
@ kN_Np2second
Definition ReadXSFile.hxx:60
@ kN_p
Definition ReadXSFile.hxx:64
@ kN_t
Definition ReadXSFile.hxx:64
@ k_Absorption
Definition ReadXSFile.hxx:62
@ kN_Np40
Definition ReadXSFile.hxx:61
@ kN_Fission
Definition ReadXSFile.hxx:50
@ kN_3N
Definition ReadXSFile.hxx:49
@ kTotalInelastic
Definition ReadXSFile.hxx:47
@ kN_Npalpha
Definition ReadXSFile.hxx:59
@ kN_3Nalpha
Definition ReadXSFile.hxx:51
@ kN_2N2alpha
Definition ReadXSFile.hxx:53
@ kN_t2alpha
Definition ReadXSFile.hxx:66
@ kN_palpha
Definition ReadXSFile.hxx:66
@ kN_d
Definition ReadXSFile.hxx:64
@ kN_Nd2alpha
Definition ReadXSFile.hxx:55
@ kN_Nalpha
Definition ReadXSFile.hxx:51
@ kN_2p
Definition ReadXSFile.hxx:66
@ kN_Np2first
Definition ReadXSFile.hxx:60
@ kN_dalpha
Definition ReadXSFile.hxx:67
@ kN_He3
Definition ReadXSFile.hxx:64
@ kN_4N
Definition ReadXSFile.hxx:56
@ kN_2alpha
Definition ReadXSFile.hxx:65
@ k_Fission
Definition ReadXSFile.hxx:50
float Real
in MCNP4 and under binary cross-section are stored in float
Definition ReadXSFile.hxx:36
Allows to read XS file in the MCNP ACE format.
Definition ReadXSFile.hxx:83
Real * fLocXS
Address number for some reaction cross-sections.
Definition ReadXSFile.hxx:162
int GetStartEndEnergyBin(int MT, int min)
helper funtion for GetXSMinMaxEnergyBin
Definition ReadXSFile.cxx:683
int fJXS[32]
Array of JXS (address of XS)
Definition ReadXSFile.hxx:151
void ReadNXS()
read the NXS array (Binary)
Definition ReadXSFile.cxx:271
ValErr_t NuSigmaFisPhi(int N, vector< ValErr_t > &Phi, float *Ephi)
return
Definition ReadXSFile.cxx:770
void AffectPointer()
decomposed all global arrays in user understandable one
Definition ReadXSFile.cxx:237
int GetXSMinEnergyBin(int MT)
returns the lower energy bin for the XS(MT)
Definition ReadXSFile.cxx:628
Real * fElasticXS
Elastic scattering cross-section [0..fNEnergy-1].
Definition ReadXSFile.hxx:158
Real GetTotalInterpolateNuBar(Real E)
returns the total mean nu at E (fission neutron yield)
Definition ReadXSFile.cxx:325
double SumXS(int MT)
returns
Definition ReadXSFile.cxx:562
Real GetXS(int MT, Real E)
returns XS for reaction MT at energy E
Definition ReadXSFile.cxx:471
int fNXXS
Size of this array.
Definition ReadXSFile.hxx:161
int fNEnergy
Number of Energy point.
Definition ReadXSFile.hxx:155
Real * GetTotalNuBar(int &NE, Real *&E, bool &Todelete)
returns the total mean nu (fission neutron yield)
Definition ReadXSFile.cxx:357
void ReadAsciiNXS()
read the NXS array (Ascii)
Definition ReadXSFile.cxx:279
int GetXSMaxEnergyBin(int MT)
returns the upper energy bin for the XS(MT)
Definition ReadXSFile.cxx:637
Real * fEnergy
Energy grid [0..fNEnergy-1].
Definition ReadXSFile.hxx:154
void ReadJXS()
read the JXS array (Binary)
Definition ReadXSFile.cxx:287
int FindEnergyBin(double E, int N, float *Ephi)
returns the bin for energy E in array Ephi
Definition ReadXSFile.cxx:876
void ReadAsciiJXS()
read the JXS array (Ascii)
Definition ReadXSFile.cxx:296
Real GetFissionXS(int binE)
returns total fission XS
Definition ReadXSFile.cxx:580
Real * fTotalXS
Total cross-section [0..fNEnergy-1].
Definition ReadXSFile.hxx:156
bool fXSFound
whether a XS is found or not
Definition ReadXSFile.hxx:163
int fNReaction
Number of reaction (ONLY neutrons)
Definition ReadXSFile.hxx:153
Real GetTotalFissionXS(Real E)
returns total fission XS (prefer GetFissionXS())
Definition ReadXSFile.cxx:606
~ReadXSFile()
destructor
Definition ReadXSFile.cxx:262
int GetNEnergy()
Definition ReadXSFile.hxx:114
Real * fReactionType
Array [fNReaction] of ENDF reaction type.
Definition ReadXSFile.hxx:152
Real * GetPromptNuBar(int &NE, Real *&E)
returns the prompt mean nu (fission neutron yield)
Definition ReadXSFile.cxx:417
int fNXS[16]
Array of NXS (size, ...)
Definition ReadXSFile.hxx:150
ifstream * OriginalFile
Original MCNP ENDF Data File.
Definition ReadXSFile.hxx:149
Real * fAbsorptionXS
Total Absorption cross-section [0..fNEnergy-1].
Definition ReadXSFile.hxx:157
void XSFound()
Definition ReadXSFile.hxx:142
int GetXSMinMaxEnergyBin(int MT, int min)
find the lower(min=0) or upper (min=1) Energy bin for reaction MT
Definition ReadXSFile.cxx:645
Real * XXS
XXS array (all the 2nd block of the Library)
Definition ReadXSFile.hxx:160
Real * GetEnergy()
returns the Energy array where XS are defined
Definition ReadXSFile.cxx:749
Real ** fXS
Cross-section array[fNReaction][...].
Definition ReadXSFile.hxx:159
ValErr_t SigmaPhi(int N, vector< ValErr_t > &Phi, float *Ephi, int MT, double emin=0, double emax=1e40)
return
Definition ReadXSFile.cxx:794
bool IsXSFound()
Definition ReadXSFile.hxx:123
Real GetInterpolXS(int MT, Real E)
returns linear in (log-log) interpol of XS for reaction MT at energy E
Definition ReadXSFile.cxx:482
the namespace of the Standard C++

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