-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Patrick Shriwise <[email protected]> Co-authored-by: Paul Romano <[email protected]>
- Loading branch information
1 parent
910d1df
commit a3695c7
Showing
12 changed files
with
99 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ enum class FilterType { | |
ENERGY_OUT, | ||
LEGENDRE, | ||
MATERIAL, | ||
MATERIALFROM, | ||
MESH, | ||
MESH_SURFACE, | ||
MU, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef OPENMC_TALLIES_FILTER_MATERIALFROM_H | ||
#define OPENMC_TALLIES_FILTER_MATERIALFROM_H | ||
|
||
#include <string> | ||
|
||
#include "openmc/tallies/filter_material.h" | ||
|
||
namespace openmc { | ||
|
||
//============================================================================== | ||
//! Specifies which material particles exit when crossing a surface. | ||
//============================================================================== | ||
|
||
class MaterialFromFilter : public MaterialFilter { | ||
public: | ||
//---------------------------------------------------------------------------- | ||
// Methods | ||
|
||
std::string type_str() const override { return "materialfrom"; } | ||
FilterType type() const override { return FilterType::MATERIALFROM; } | ||
|
||
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_MATERIALFROM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "openmc/tallies/filter_materialfrom.h" | ||
|
||
#include "openmc/cell.h" | ||
#include "openmc/material.h" | ||
|
||
namespace openmc { | ||
|
||
void MaterialFromFilter::get_all_bins( | ||
const Particle& p, TallyEstimator estimator, FilterMatch& match) const | ||
{ | ||
auto search = map_.find(p.material_last()); | ||
if (search != map_.end()) { | ||
match.bins_.push_back(search->second); | ||
match.weights_.push_back(1.0); | ||
} | ||
} | ||
|
||
std::string MaterialFromFilter::text_label(int bin) const | ||
{ | ||
return "Material from " + | ||
std::to_string(model::materials[materials_[bin]]->id_); | ||
} | ||
|
||
} // namespace openmc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters