mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Filter weight implementation (#3345)
Co-authored-by: Grego01-biot <grego01@pc-neutronic-06.psfc.mit.edu> Co-authored-by: Patrick Shriwise <pshriwise@gmail.com> Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
9942269a91
commit
dc619eac17
12 changed files with 215 additions and 2 deletions
|
|
@ -44,6 +44,7 @@ enum class FilterType {
|
|||
SURFACE,
|
||||
TIME,
|
||||
UNIVERSE,
|
||||
WEIGHT,
|
||||
ZERNIKE,
|
||||
ZERNIKE_RADIAL
|
||||
};
|
||||
|
|
|
|||
51
include/openmc/tallies/filter_weight.h
Normal file
51
include/openmc/tallies/filter_weight.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#ifndef OPENMC_TALLIES_FILTER_WEIGHT_H
|
||||
#define OPENMC_TALLIES_FILTER_WEIGHT_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "openmc/span.h"
|
||||
#include "openmc/tallies/filter.h"
|
||||
#include "openmc/vector.h"
|
||||
|
||||
namespace openmc {
|
||||
|
||||
//==============================================================================
|
||||
//! Bins the weights of the particles.
|
||||
//==============================================================================
|
||||
|
||||
class WeightFilter : public Filter {
|
||||
public:
|
||||
//----------------------------------------------------------------------------
|
||||
// Constructors, destructors
|
||||
|
||||
~WeightFilter() = default;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Methods
|
||||
|
||||
std::string type_str() const override { return "weight"; }
|
||||
FilterType type() const override { return FilterType::WEIGHT; }
|
||||
|
||||
void from_xml(pugi::xml_node node) override;
|
||||
|
||||
void get_all_bins(const Particle& p, TallyEstimator estimator,
|
||||
FilterMatch& match) const override;
|
||||
|
||||
void to_statepoint(hid_t filter_group) const override;
|
||||
|
||||
std::string text_label(int bin) const override;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Accessors
|
||||
|
||||
const vector<double>& bins() const { return bins_; }
|
||||
void set_bins(span<const double> bins);
|
||||
|
||||
protected:
|
||||
//----------------------------------------------------------------------------
|
||||
// Data members
|
||||
vector<double> bins_;
|
||||
};
|
||||
|
||||
} // namespace openmc
|
||||
#endif // OPENMC_TALLIES_FILTER_WEIGHT_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue