Meshborn filter (#2925)

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Joffrey Dorville 2024-04-04 16:32:21 -05:00 committed by GitHub
parent 1a34ddf121
commit cc848effe7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 720 additions and 11 deletions

View file

@ -262,6 +262,10 @@ public:
int& cell_last(int i) { return cell_last_[i]; }
const int& cell_last(int i) const { return cell_last_[i]; }
// Coordinates at birth
Position& r_born() { return r_born_; }
const Position& r_born() const { return r_born_; }
// Coordinates of last collision or reflective/periodic surface
// crossing for current tallies
Position& r_last_current() { return r_last_current_; }
@ -323,6 +327,7 @@ private:
int n_coord_last_ {1}; //!< number of current coordinates
vector<int> cell_last_; //!< coordinates for all levels
Position r_born_; //!< coordinates at birth
Position r_last_current_; //!< coordinates of the last collision or
//!< reflective/periodic surface crossing for
//!< current tallies

View file

@ -33,6 +33,7 @@ enum class FilterType {
MATERIAL,
MATERIALFROM,
MESH,
MESHBORN,
MESH_SURFACE,
MU,
PARTICLE,

View file

@ -0,0 +1,26 @@
#ifndef OPENMC_TALLIES_FILTER_MESHBORN_H
#define OPENMC_TALLIES_FILTER_MESHBORN_H
#include <cstdint>
#include "openmc/position.h"
#include "openmc/tallies/filter_mesh.h"
namespace openmc {
class MeshBornFilter : public MeshFilter {
public:
//----------------------------------------------------------------------------
// Methods
std::string type_str() const override { return "meshborn"; }
FilterType type() const override { return FilterType::MESHBORN; }
void get_all_bins(const Particle& p, TallyEstimator estimator,
FilterMatch& match) const override;
std::string text_label(int bin) const override;
};
} // namespace openmc
#endif // OPENMC_TALLIES_FILTER_MESHBORN_H