f71stream.hh 5.72 KB
Newer Older
LEFEBVREJP email's avatar
LEFEBVREJP email committed
1
2
3
4
5
6
#ifndef RADIX_RADIXIO_F71STREAM_HH_
#define RADIX_RADIXIO_F71STREAM_HH_

#include <algorithm>
#include <cmath>
#include <iomanip>
7
#include <memory>
LEFEBVREJP email's avatar
LEFEBVREJP email committed
8
9
10
11
12
13
#include <sstream>
#include <string>
#include <vector>

#include "radixio/eafstream.hh"

14
#include "radixcore/visibility.hh"
LEFEBVREJP email's avatar
LEFEBVREJP email committed
15
16
17

namespace radix
{
18
class RADIX_PUBLIC F71Stream
LEFEBVREJP email's avatar
LEFEBVREJP email committed
19
20
21
22
23
24
25
26
27
{
 private:
  std::string mFile;
  eafstream mStream;

 public:
  F71Stream() = delete;
  F71Stream(const std::string& mFile);

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  /**
   * @brief read_case Reads a single case from the stream
   * @param f71case_type& inventory
   *
   * Requires the f71case_type to have the following methods:
   *
   * setLightElementNuclides(const std::vector<int>& zaids)
   * setActinideNuclides(const std::vector<int>& zaids)
   * setFissionProductNuclides(const std::vector<int>& zaids)
   *
   * setLightElementNuclideAbundances(const std::vector<float>& abs)
   * setActinideNuclideAbundances(const std::vector<float>& abs)
   * setFissionProductNuclideAbundances(const std::vector<float>& abs)
   *
   * setTitle(const std::string& title)
   * setBasis(const std::string& basis)
   *
   * setLightElementGammaEnergyBounds(const std::vector<float>& bounds)
   * setActinideGammaEnergyBounds(const std::vector<float>& bounds)
   * setFissionProductGammaEnergyBounds(const std::vector<float>& bounds)
   *
   * setLightElementSpectrum(const std::vector<float>& spectrum)
   * setActinideSpectrum(const std::vector<float>& spectrum)
   * setFissionProductSpectrum(const std::vector<float>& spectrum)
   *
   * setGammaEnergyBounds(const std::vector<float>& bounds)
   * setPhotonPerSSpectrum(const std::vector<float>& spectrum)
   * setMevPerSSpectrum(const std::vector<float>& spectrum)
   *
   * setPhotonSpectrumTitle(const std::string& title)
   * setSpontFissionNeutronSource(const std::vector<float>& source)
   * setActinideAlphaNSource(const std::vector<float>& source)
   * setTotalNeutronSpectrum(const std::vector<float>& spectrum)
   * setAlphaNSpectrum(const std::vector<float>& spectrum)
   * setSpontaneousFissionSpectrum(const std::vector<float>& spectrum)
   * setNeutronEnergyBounds(const std::vector<float>& bounds)
   *
   * setTime(double seconds)
   * setPower(float power)
   * setFlux(float flux)
   * @return bool on if inventory was populated
   */
LEFEBVREJP email's avatar
LEFEBVREJP email committed
70
  template <typename f71case_type>
71
  bool read_case(f71case_type& inventory);
LEFEBVREJP email's avatar
LEFEBVREJP email committed
72
73

};  // class F71Stream
74

75
class RADIX_PUBLIC F71Case
76
77
78
79
80
81
82
83
84
85
{
  // forward declare private implementation
  class PImpl;
  // unique pointer to private implmentation
  std::unique_ptr<PImpl, void (*)(PImpl*)> p;

 public:
  F71Case();
  F71Case(const F71Case& orig);

86
  const std::vector<int>& lightElementNuclides() const;
87
  void setLightElementNuclides(const std::vector<int>& zaids);
88
89

  const std::vector<int>& actinideNuclides() const;
90
  void setActinideNuclides(const std::vector<int>& zaids);
91
92

  const std::vector<int>& fissionProductNuclides() const;
93
94
  void setFissionProductNuclides(const std::vector<int>& zaids);

95
  const std::vector<float>& lightElementNuclideAbundances() const;
96
  void setLightElementNuclideAbundances(const std::vector<float>& abs);
97
98

  const std::vector<float>& actinideNuclideAbundances() const;
99
  void setActinideNuclideAbundances(const std::vector<float>& abs);
100
101

  const std::vector<float>& fissionProductNuclideAbundances() const;
102
  void setFissionProductNuclideAbundances(const std::vector<float>& abs);
103
104

  std::string title() const;
105
  void setTitle(const std::string& title);
106
107

  std::string basis() const;
108
109
  void setBasis(const std::string& basis);

110
  const std::vector<float>& lightElementGammaEnergyBounds() const;
111
  void setLightElementGammaEnergyBounds(const std::vector<float>& bounds);
112
113

  const std::vector<float>& actinideGammaEnergyBounds() const;
114
  void setActinideGammaEnergyBounds(const std::vector<float>& bounds);
115
116

  const std::vector<float>& fissionProductGammaEnergyBounds() const;
117
118
  void setFissionProductGammaEnergyBounds(const std::vector<float>& bounds);

119
  const std::vector<float>& lightElementSpectrum() const;
120
  void setLightElementSpectrum(const std::vector<float>& spectrum);
121
122

  const std::vector<float>& actinitdeSpectrum() const;
123
  void setActinideSpectrum(const std::vector<float>& spectrum);
124
125

  const std::vector<float>& fissionProductSpectrum() const;
126
127
  void setFissionProductSpectrum(const std::vector<float>& spectrum);

128
  const std::vector<float>& gammaEnergyBounds() const;
129
  void setGammaEnergyBounds(const std::vector<float>& bounds);
130
131

  const std::vector<float>& photonPerSSpectrum() const;
132
  void setPhotonPerSSpectrum(const std::vector<float>& spectrum);
133
134

  const std::vector<float>& mevPerSSpectrum() const;
135
  void setMevPerSSpectrum(const std::vector<float>& spectrum);
136
137

  std::string photonSpectrumTitle() const;
138
  void setPhotonSpectrumTitle(const std::string& title);
139
140

  const std::vector<float>& spontaneousFissionNeutronSource() const;
141
  void setSpontaneousFissionNeutronSource(const std::vector<float>& source);
142
143

  const std::vector<float>& actinideAlphaNSource() const;
144
  void setActinideAlphaNSource(const std::vector<float>& source);
145
146

  const std::vector<float>& totalNeutronSpectrum() const;
147
  void setTotalNeutronSpectrum(const std::vector<float>& spectrum);
148
149

  const std::vector<float>& alphaNSpectrum() const;
150
  void setAlphaNSpectrum(const std::vector<float>& spectrum);
151
152

  const std::vector<float>& spontaneousFissionSpectrum() const;
153
  void setSpontaneousFissionSpectrum(const std::vector<float>& spectrum);
154
155

  const std::vector<float>& neutronEnergyBounds() const;
156
157
  void setNeutronEnergyBounds(const std::vector<float>& bounds);

158
  double time() const;
159
  void setTime(double seconds);
160
161

  float power() const;
162
  void setPower(float power);
163
164

  float flux() const;
165
166
  void setFlux(float flux);
};  // F71Case
LEFEBVREJP email's avatar
LEFEBVREJP email committed
167
168
169
170
}  // namespace radix

#include "radixio/f71stream.i.hh"
#endif /** RADIX_RADIXIO_F71STREAM_HH_ */