99#include " openmc/array.h"
1010#include " openmc/cell.h"
1111#include " openmc/openmp_interface.h"
12- #include " openmc/plot.h"
1312#include " openmc/position.h"
1413#include " openmc/tallies/trigger.h"
1514#include " openmc/timer.h"
@@ -78,9 +77,6 @@ class VolumeCalculation {
7877 // ! \brief Online results of calculation specific for each thread
7978 struct CalcResults {
8079 uint64_t n_samples; // !< Number of samples
81- uint64_t n_rays; // !< Number of traced rays
82- uint64_t n_segs; // !< Number of traced ray segments
83- uint64_t n_errors; // !< Number of tracing errors
8480 int iterations; // !< Number of iterations needed to obtain the results
8581 double cost; // !< Product of spent time and number of threads/processes
8682 Timer sampling_time; // Timer for measurment of the simulation
@@ -116,6 +112,9 @@ class VolumeCalculation {
116112 // ! \return Vector of results for each user-specified domain
117113 void execute (CalcResults& results) const ;
118114
115+ // ! \brief Rejection estimator
116+ inline void score_hit (const Particle& p, CalcResults& results) const ;
117+
119118 // ! \brief Check whether a material has already been hit for a given domain.
120119 // ! If not, add new entries to the vectors
121120 //
@@ -166,8 +165,6 @@ class VolumeCalculation {
166165
167166 // Tally filter and map types
168167 enum class TallyDomain { UNIVERSE, MATERIAL, CELL };
169- // Volume estimator type
170- enum class EstMode { REJECTION, RAYTRACE };
171168
172169 // Data members
173170 TallyDomain domain_type_; // !< Type of domain (cell, material, etc.)
@@ -182,7 +179,6 @@ class VolumeCalculation {
182179 Position lower_left_; // !< Lower-left position of bounding box
183180 Position upper_right_; // !< Upper-right position of bounding box
184181 vector<int > domain_ids_; // !< IDs of domains to find volumes of
185- EstMode mode_; // !< Volume estimator type
186182
187183#ifdef OPENMC_MPI
188184 // ! \brief Creates MPI structs for passing data between threads
@@ -197,14 +193,6 @@ class VolumeCalculation {
197193 -999 ; // !< Index of zero-element tally for entire domain totals should be
198194 // !< out of material ID range
199195
200- // ! \brief Computes lengths of the two segments of a bounding box chord
201- //
202- // ! \param[in] r Location inside bounding sphere splits the chord
203- // ! \param[in] u Direction of chord to compute (normalized)
204- // ! \return Array of backward (first) and forward (second) chord segments
205- std::pair<double , double > get_box_chord (
206- const Position& r, const Direction& u) const ;
207-
208196 // ! \brief Computes estimated mean and std.dev. for a tally
209197 //
210198 // ! \param[in] n_samples Statistic's size
@@ -215,63 +203,6 @@ class VolumeCalculation {
215203 const double coeff_norm, const VolTally& vol_tally) const ;
216204};
217205
218- // ==============================================================================
219- // Volume estimator ray class
220- // ==============================================================================
221-
222- class VolEstRay : public Ray {
223- friend class VolumeCalculation ; // for access to the CalcResults struct and
224- // EstMode variable, not sure that this is
225- // a good practice in C++
226-
227- public:
228- // ! \brief Constructs a ray of given length emitted from a given point for the
229- // ! volume track length estimator into given tallies
230- //
231- // ! \param[in] r Coordinates of the ray origin
232- // ! \param[in] u Direction of the ray
233- // ! \param[in] dist Target length of the ray
234- // ! \param[in] coeff_mult Coefficient for scores multiplcation, it should
235- // ! contain the reciprocal chord lenght and may contain stat. weight, etc.
236- // ! \param[in] vol_calc Volume calculation parameters
237- // ! \param[in,out] results Tallies for scoring during tracing etc.
238- VolEstRay (Position& r, Direction& u, const double dist,
239- const double coeff_mult, const VolumeCalculation& vol_calc,
240- VolumeCalculation::CalcResults& results)
241- : Ray(r, u), traversal_distance_max_(dist), coeff_mult_(coeff_mult),
242- vol_calc_ (vol_calc), results_(results)
243- {}
244-
245- // ! \brief Track length estimator on intersection events
246- virtual void on_intersection () override ;
247-
248- private:
249- const double traversal_distance_max_; // !< Target ray length
250- double traversal_distance_last_ =
251- 0 .; // !< One segment beyond traversal_distance
252- const double coeff_mult_; // !< Coefficient for scoring multiplcation
253- const VolumeCalculation& vol_calc_; // !< Parameters of volume calculation
254- VolumeCalculation::CalcResults&
255- results_; // !< Tallies for scoring and other statistics collector
256-
257- // ! \brief Rejection estimator
258- inline void score_hit ();
259-
260- // ! \brief Contributes to volume tallies
261- //
262- // ! \param[in] mode Type of used estimator
263- // ! \param[in] score Contribution value
264- // ! \param[in] id_mat Material ID required due to the material() and
265- // ! material_lst() disagreement (see the on_intersection() body for details)
266- inline void vol_scoring (const VolumeCalculation::EstMode mode,
267- const double score, const int id_mat);
268-
269- // ! \brief Returns a pointer to either current point location cell or last ray
270- // ! segment cell
271- inline std::unique_ptr<Cell>& current_cell (
272- VolumeCalculation::EstMode mode, int level);
273- };
274-
275206// ==============================================================================
276207// Global variables
277208// ==============================================================================
0 commit comments