f71stream.hh 4.29 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
14
15
16
17
#include <sstream>
#include <string>
#include <vector>

#include "radixio/eafstream.hh"

#include "radixdl/visibility.hh"

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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118

class F71Case
{
  // forward declare private implementation
  class PImpl;
  // unique pointer to private implmentation
  std::unique_ptr<PImpl, void (*)(PImpl*)> p;

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

  void setLightElementNuclides(const std::vector<int>& zaids);
  void setActinideNuclides(const std::vector<int>& zaids);
  void setFissionProductNuclides(const std::vector<int>& zaids);

  void setLightElementNuclideAbundances(const std::vector<float>& abs);
  void setActinideNuclideAbundances(const std::vector<float>& abs);
  void setFissionProductNuclideAbundances(const std::vector<float>& abs);
  void setTitle(const std::string& title);
  void setBasis(const std::string& basis);

  void setLightElementGammaEnergyBounds(const std::vector<float>& bounds);
  void setActinideGammaEnergyBounds(const std::vector<float>& bounds);
  void setFissionProductGammaEnergyBounds(const std::vector<float>& bounds);

  void setLightElementSpectrum(const std::vector<float>& spectrum);
  void setActinideSpectrum(const std::vector<float>& spectrum);
  void setFissionProductSpectrum(const std::vector<float>& spectrum);

  void setGammaEnergyBounds(const std::vector<float>& bounds);
  void setPhotonPerSSpectrum(const std::vector<float>& spectrum);
  void setMevPerSSpectrum(const std::vector<float>& spectrum);
  void setPhotonSpectrumTitle(const std::string& title);
  void setSpontaneousFissionNeutronSource(const std::vector<float>& source);
  void setActinideAlphaNSource(const std::vector<float>& source);
  void setTotalNeutronSpectrum(const std::vector<float>& spectrum);
  void setAlphaNSpectrum(const std::vector<float>& spectrum);
  void setSpontaneousFissionSpectrum(const std::vector<float>& spectrum);
  void setNeutronEnergyBounds(const std::vector<float>& bounds);

  void setTime(double seconds);
  void setPower(float power);
  void setFlux(float flux);
};  // F71Case
LEFEBVREJP email's avatar
LEFEBVREJP email committed
119
120
121
122
}  // namespace radix

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