MIDSX 0.1
A x-ray transport code system for dosimetry
Loading...
Searching...
No Matches
surface_quantity.h
1#ifndef MIDSX_SURFACE_QUANTITY_H
2#define MIDSX_SURFACE_QUANTITY_H
3
4#include <memory>
5#include "quantity.h"
6#include <Eigen/Dense>
7#include "photon.h"
8#include "tally_data.h"
9
13enum class VectorSurfaceQuantityType {
14 IncidentEnergy,
15 EntranceCosine,
16};
17
18
19namespace VectorSurfaceQuantityHelper {
20 std::string toString(VectorSurfaceQuantityType type);
21}
22
26enum class CountSurfaceQuantityType {
27 NumberOfPhotons
28};
29
30namespace CountSurfaceQuantityHelper {
31 std::string toString(CountSurfaceQuantityType type);
32}
33
40public:
48 using ValueExtractor = std::function<double(const TempSurfaceTallyData&)>;
49
55 explicit VectorSurfaceQuantity(VectorSurfaceQuantityType type);
56
65
71 void measure(TempSurfaceTallyData& temp_surface_tally_data);
72
78 VectorSurfaceQuantityType getType() const;
79
80 // Wrapper functions for VectorValue. Self-explanatory.
81 VectorValue& getTotalValues();
82 VectorValue& getPrimaryValues();
83 VectorValue& getSingleIncoherentScatterValues();
84 VectorValue& getSingleCoherentScatterValues();
85 VectorValue& getMultipleScatterValues();
86private:
87 VectorSurfaceQuantityType type_;
88 bool totaled_ = false;
89 VectorValue total_values_;
90 VectorValue primary_values_;
91 VectorValue single_incoherent_scatter_values_;
92 VectorValue single_coherent_scatter_values_;
93 VectorValue multiple_scatter_values_;
94 ValueExtractor valueExtractor_;
95};
96
103public:
110 using ValueExtractor = std::function<bool(const TempSurfaceTallyData&)>;
111
117 explicit CountSurfaceQuantity(CountSurfaceQuantityType type);
118
126
132 void measure(TempSurfaceTallyData& temp_surface_tally_data);
133
139 CountSurfaceQuantityType getType() const;
140
141 // Wrapper functions for CountValue. Self-explanatory.
142 CountValue getTotalValues();
143 CountValue getPrimaryValues() const;
144 CountValue getSingleIncoherentScatterValues() const;
145 CountValue getSingleCoherentScatterValues() const;
146 CountValue getMultipleScatterValues() const;
147private:
148 CountSurfaceQuantityType type_;
149 bool totaled_ = false;
150 CountValue total_values_;
151 CountValue primary_values_;
152 CountValue single_incoherent_scatter_values_;
153 CountValue single_coherent_scatter_values_;
154 CountValue multiple_scatter_values_;
155 ValueExtractor valueExtractor_;
156};
157
158#endif //MIDSX_SURFACE_QUANTITY_H
Class which represents a count quantity for a surface tally.
CountSurfaceQuantity(CountSurfaceQuantityType type)
Constructor for the CountSurfaceQuantity class.
void measure(TempSurfaceTallyData &temp_surface_tally_data)
Measures the CountSurfaceQuantity for a TempSurfaceTallyData object.
std::function< bool(const TempSurfaceTallyData &)> ValueExtractor
ValueExtractor is a function that extracts necessary values from a TempSurfaceTallyData object for a ...
CountSurfaceQuantity operator+(const CountSurfaceQuantity &other) const
Overloads the + operator for CountSurfaceQuantity.
CountSurfaceQuantityType getType() const
Returns the type of the CountSurfaceQuantity.
Class which represents a count quantity. Used by the Tally classes to store simulation data.
Definition quantity.h:37
Class which represents a vector quantity for a surface tally.
void measure(TempSurfaceTallyData &temp_surface_tally_data)
Measures the VectorSurfaceQuantity for a TempSurfaceTallyData object.
VectorSurfaceQuantity operator+(VectorSurfaceQuantity &other) const
Overloads the + operator for VectorSurfaceQuantity.
VectorSurfaceQuantityType getType() const
Returns the type of the VectorSurfaceQuantity.
VectorSurfaceQuantity(VectorSurfaceQuantityType type)
Constructor for the VectorSurfaceQuantity class.
std::function< double(const TempSurfaceTallyData &)> ValueExtractor
ValueExtractor is a function that extracts necessary values from a TempSurfaceTallyData object for a ...
Class which represents a vector quantity. Used by the Tally classes to store simulation data.
Definition quantity.h:10
Struct which represents the temporary data for a surface tally.
Definition tally_data.h:24