Remove "tally_" prefix from tally filter files

This commit is contained in:
Sterling Harper 2018-10-22 10:22:55 -04:00
parent 15caa0c1ca
commit e2e813adb8
23 changed files with 181 additions and 185 deletions

View file

@ -27,7 +27,7 @@ extern "C" void assign_temperatures();
//!
//! This function looks for a universe that is not listed in a Cell::fill or in
//! a Lattice.
//! @return The index of the root universe.
//! \return The index of the root universe.
//==============================================================================
extern "C" int32_t find_root_universe();
@ -49,7 +49,7 @@ extern "C" void prepare_distribcell();
//!
//! This function will update the Cell::n_instances value for each cell in the
//! geometry.
//! @param univ_indx The index of the universe to begin searching from (probably
//! \param univ_indx The index of the universe to begin searching from (probably
//! the root universe).
//==============================================================================
@ -57,9 +57,9 @@ extern "C" void count_cell_instances(int32_t univ_indx);
//==============================================================================
//! Recursively search through universes and count universe instances.
//! @param search_univ The index of the universe to begin searching from.
//! @param target_univ_id The ID of the universe to be counted.
//! @return The number of instances of target_univ_id in the geometry tree under
//! \param search_univ The index of the universe to begin searching from.
//! \param target_univ_id The ID of the universe to be counted.
//! \return The number of instances of target_univ_id in the geometry tree under
//! search_univ.
//==============================================================================
@ -68,13 +68,11 @@ count_universe_instances(int32_t search_univ, int32_t target_univ_id);
//==============================================================================
//! Build a character array representing the path to a distribcell instance.
//! @param target_cell The index of the Cell in the global Cell array.
//! @param map The index of the distribcell mapping corresponding to the target
//! \param target_cell The index of the Cell in the global Cell array.
//! \param map The index of the distribcell mapping corresponding to the target
//! cell.
//! @param target_offset An instance number for a distributed cell.
//! @param root_univ The index of the root Universe in the global Universe
//! array.
//! @return The unique traversal through the geometry tree that leads to the
//! \param target_offset An instance number for a distributed cell.
//! \return The unique traversal through the geometry tree that leads to the
//! desired instance of the target cell.
//==============================================================================
@ -83,9 +81,9 @@ distribcell_path(int32_t target_cell, int32_t map, int32_t target_offset);
//==============================================================================
//! Determine the maximum number of nested coordinate levels in the geometry.
//! @param univ The index of the universe to begin seraching from (probably the
//! \param univ The index of the universe to begin seraching from (probably the
//! root universe).
//! @return The number of coordinate levels.
//! \return The number of coordinate levels.
//==============================================================================
extern "C" int maximum_levels(int32_t univ);

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_H
#define OPENMC_TALLY_FILTER_H
#ifndef OPENMC_TALLIES_FILTER_H
#define OPENMC_TALLIES_FILTER_H
#include <cstdint>
#include <string>
@ -18,36 +18,34 @@ namespace openmc {
extern "C" int32_t n_filters;
class TallyFilterMatch;
extern std::vector<TallyFilterMatch> filter_matches;
class FilterMatch;
extern std::vector<FilterMatch> filter_matches;
#pragma omp threadprivate(filter_matches)
class TallyFilter;
extern std::vector<TallyFilter*> tally_filters;
class Filter;
extern std::vector<Filter*> tally_filters;
//==============================================================================
//! Stores bins and weights for filtered tally events.
//==============================================================================
class TallyFilterMatch
class FilterMatch
{
public:
//int i_bin_;
std::vector<int> bins_;
std::vector<double> weights_;
//bool bins_present_;
};
//==============================================================================
//! Modifies tally score events.
//==============================================================================
class TallyFilter
class Filter
{
public:
virtual std::string type() const = 0;
virtual ~TallyFilter() = 0;
virtual ~Filter() = 0;
//! Uses an XML input to fill the filter's data fields.
virtual void from_xml(pugi::xml_node node) = 0;
@ -57,7 +55,7 @@ public:
//! \param[out] match will contain the matching bins and corresponding
//! weights; note that there may be zero matching bins
virtual void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match) const = 0;
get_all_bins(Particle* p, int estimator, FilterMatch& match) const = 0;
//! Writes data describing this filter to an HDF5 statepoint group.
virtual void
@ -78,11 +76,11 @@ public:
int n_bins_;
};
inline TallyFilter::~TallyFilter() {}
inline Filter::~Filter() {}
//==============================================================================
extern "C" void free_memory_tally_c();
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_H
#endif // OPENMC_TALLIES_FILTER_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_AZIMUTHAL_H
#define OPENMC_TALLY_FILTER_AZIMUTHAL_H
#ifndef OPENMC_TALLIES_FILTER_AZIMUTHAL_H
#define OPENMC_TALLIES_FILTER_AZIMUTHAL_H
#include <sstream>
#include <cmath>
@ -7,7 +7,7 @@
#include "openmc/error.h"
#include "openmc/search.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -16,7 +16,7 @@ namespace openmc {
//! Bins the incident neutron azimuthal angle (relative to the global xy-plane).
//==============================================================================
class AzimuthalFilter : public TallyFilter
class AzimuthalFilter : public Filter
{
public:
std::string type() const override {return "azimuthal";}
@ -50,7 +50,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
double phi;
@ -70,7 +70,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
write_dataset(filter_group, "bins", bins_);
}
@ -87,4 +87,4 @@ protected:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_AZIMUTHAL_H
#endif // OPENMC_TALLIES_FILTER_AZIMUTHAL_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_CELL_H
#define OPENMC_TALLY_FILTER_CELL_H
#ifndef OPENMC_TALLIES_FILTER_CELL_H
#define OPENMC_TALLIES_FILTER_CELL_H
#include <cstdint>
#include <sstream>
@ -8,7 +8,7 @@
#include "openmc/cell.h"
#include "openmc/error.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -17,7 +17,7 @@ namespace openmc {
//! Specifies which geometric cells tally events reside in.
//==============================================================================
class CellFilter : public TallyFilter
class CellFilter : public Filter
{
public:
std::string type() const override {return "cell";}
@ -51,7 +51,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
for (int i = 0; i < p->n_coord; i++) {
@ -67,7 +67,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
std::vector<int32_t> cell_ids;
for (auto c : cells_) cell_ids.push_back(cells[c]->id_);
write_dataset(filter_group, "bins", cell_ids);
@ -84,4 +84,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_CELL_H
#endif // OPENMC_TALLIES_FILTER_CELL_H

View file

@ -1,7 +1,7 @@
#ifndef OPENMC_TALLY_FILTER_CELLBORN_H
#define OPENMC_TALLY_FILTER_CELLBORN_H
#ifndef OPENMC_TALLIES_FILTER_CELLBORN_H
#define OPENMC_TALLIES_FILTER_CELLBORN_H
#include "openmc/tallies/tally_filter_cell.h"
#include "openmc/tallies/filter_cell.h"
namespace openmc {
@ -15,7 +15,7 @@ public:
std::string type() const override {return "cellborn";}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
auto search = map_.find(p->cell_born);
@ -34,4 +34,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_CELLBORN_H
#endif // OPENMC_TALLIES_FILTER_CELLBORN_H

View file

@ -1,7 +1,7 @@
#ifndef OPENMC_TALLY_FILTER_CELLFROM_H
#define OPENMC_TALLY_FILTER_CELLFROM_H
#ifndef OPENMC_TALLIES_FILTER_CELLFROM_H
#define OPENMC_TALLIES_FILTER_CELLFROM_H
#include "openmc/tallies/tally_filter_cell.h"
#include "openmc/tallies/filter_cell.h"
namespace openmc {
@ -16,7 +16,7 @@ public:
std::string type() const override {return "cellfrom";}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
for (int i = 0; i < p->last_n_coord; i++) {
@ -37,4 +37,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_CELLFROM_H
#endif // OPENMC_TALLIES_FILTER_CELLFROM_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_DISTRIBCELL_H
#define OPENMC_TALLY_FILTER_DISTRIBCELL_H
#ifndef OPENMC_TALLIES_FILTER_DISTRIBCELL_H
#define OPENMC_TALLIES_FILTER_DISTRIBCELL_H
#include <string>
@ -7,7 +7,7 @@
#include "openmc/error.h"
#include "openmc/geometry_aux.h" // For distribcell_path
#include "openmc/lattice.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -16,7 +16,7 @@ namespace openmc {
//! Specifies which distributed geometric cells tally events reside in.
//==============================================================================
class DistribcellFilter : public TallyFilter
class DistribcellFilter : public Filter
{
public:
std::string type() const override {return "distribcell";}
@ -49,7 +49,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
int offset = 0;
@ -78,7 +78,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
write_dataset(filter_group, "bins", cells[cell_]->id_);
}
@ -95,4 +95,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_DISTRIBCELL_H
#endif // OPENMC_TALLIES_FILTER_DISTRIBCELL_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_ENERGYFUNC_H
#define OPENMC_TALLY_FILTER_ENERGYFUNC_H
#ifndef OPENMC_TALLIES_FILTER_ENERGYFUNC_H
#define OPENMC_TALLIES_FILTER_ENERGYFUNC_H
#include <iomanip> // for setprecision
#include <ios> // for scientific
@ -9,7 +9,7 @@
#include "openmc/error.h"
#include "openmc/search.h"
#include "openmc/settings.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -19,13 +19,13 @@ namespace openmc {
//! described by a piecewise linear-linear interpolation.
//==============================================================================
class EnergyFunctionFilter : public TallyFilter
class EnergyFunctionFilter : public Filter
{
public:
std::string type() const override {return "energyfunction";}
EnergyFunctionFilter()
: TallyFilter {}
: Filter {}
{
n_bins_ = 1;
}
@ -51,7 +51,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
if (p->last_E >= energy_.front() && p->last_E <= energy_.back()) {
@ -70,7 +70,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
write_dataset(filter_group, "energy", energy_);
write_dataset(filter_group, "y", y_);
}
@ -91,4 +91,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_ENERGYFUNC_H
#endif // OPENMC_TALLIES_FILTER_ENERGYFUNC_H

View file

@ -1,12 +1,12 @@
#ifndef OPENMC_TALLY_FILTER_LEGENDRE_H
#define OPENMC_TALLY_FILTER_LEGENDRE_H
#ifndef OPENMC_TALLIES_FILTER_LEGENDRE_H
#define OPENMC_TALLIES_FILTER_LEGENDRE_H
#include <string>
#include "openmc/cell.h"
#include "openmc/error.h"
#include "openmc/math_functions.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -15,7 +15,7 @@ namespace openmc {
//! Gives Legendre moments of the change in scattering angle
//==============================================================================
class LegendreFilter : public TallyFilter
class LegendreFilter : public Filter
{
public:
std::string type() const override {return "legendre";}
@ -30,7 +30,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
double wgt[n_bins_];
@ -44,7 +44,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
write_dataset(filter_group, "order", order_);
}
@ -58,4 +58,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_LEGENDRE_H
#endif // OPENMC_TALLIES_FILTER_LEGENDRE_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_MATERIAL_H
#define OPENMC_TALLY_FILTER_MATERIAL_H
#ifndef OPENMC_TALLIES_FILTER_MATERIAL_H
#define OPENMC_TALLIES_FILTER_MATERIAL_H
#include <cstdint>
#include <sstream>
@ -8,7 +8,7 @@
#include "openmc/error.h"
#include "openmc/material.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -17,7 +17,7 @@ namespace openmc {
//! Specifies which material tally events reside in.
//==============================================================================
class MaterialFilter : public TallyFilter
class MaterialFilter : public Filter
{
public:
std::string type() const override {return "material";}
@ -52,7 +52,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
auto search = map_.find(p->material - 1);
@ -66,7 +66,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
std::vector<int32_t> material_ids;
for (auto c : materials_) material_ids.push_back(materials[c]->id_);
write_dataset(filter_group, "bins", material_ids);
@ -83,4 +83,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_MATERIAL_H
#endif // OPENMC_TALLIES_FILTER_MATERIAL_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_MESH_H
#define OPENMC_TALLY_FILTER_MESH_H
#ifndef OPENMC_TALLIES_FILTER_MESH_H
#define OPENMC_TALLIES_FILTER_MESH_H
#include <cstdint>
#include <sstream>
@ -7,7 +7,7 @@
#include "openmc/capi.h"
#include "openmc/error.h"
#include "openmc/mesh.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -18,7 +18,7 @@ namespace openmc {
//! correspond to the fraction of the track length that lies in that bin.
//==============================================================================
class MeshFilter : public TallyFilter
class MeshFilter : public Filter
{
public:
std::string type() const override {return "mesh";}
@ -49,7 +49,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
if (estimator != ESTIMATOR_TRACKLENGTH) {
@ -66,7 +66,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
write_dataset(filter_group, "bins", meshes[mesh_]->id_);
}
@ -92,4 +92,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_MESH_H
#endif // OPENMC_TALLIES_FILTER_MESH_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_MESHSURFACE_H
#define OPENMC_TALLY_FILTER_MESHSURFACE_H
#ifndef OPENMC_TALLIES_FILTER_MESHSURFACE_H
#define OPENMC_TALLIES_FILTER_MESHSURFACE_H
#include <cstdint>
#include <sstream>
@ -7,7 +7,7 @@
#include "openmc/constants.h"
#include "openmc/error.h"
#include "openmc/mesh.h"
#include "openmc/tallies/tally_filter_mesh.h"
#include "openmc/tallies/filter_mesh.h"
namespace openmc {
@ -26,7 +26,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
meshes[mesh_]->surface_bins_crossed(p, match.bins_);
@ -78,4 +78,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_MESHSURFACE_H
#endif // OPENMC_TALLIES_FILTER_MESHSURFACE_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_MU_H
#define OPENMC_TALLY_FILTER_MU_H
#ifndef OPENMC_TALLIES_FILTER_MU_H
#define OPENMC_TALLIES_FILTER_MU_H
#include <sstream>
#include <cmath>
@ -7,7 +7,7 @@
#include "openmc/error.h"
#include "openmc/search.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -17,7 +17,7 @@ namespace openmc {
//! reactions.
//==============================================================================
class MuFilter : public TallyFilter
class MuFilter : public Filter
{
public:
std::string type() const override {return "mu";}
@ -51,7 +51,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
if (p->mu >= bins_[0] && p->mu <= bins_.back()) {
@ -64,7 +64,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
write_dataset(filter_group, "bins", bins_);
}
@ -81,4 +81,4 @@ protected:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_MU_H
#endif // OPENMC_TALLIES_FILTER_MU_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_POLAR_H
#define OPENMC_TALLY_FILTER_POLAR_H
#ifndef OPENMC_TALLIES_FILTER_POLAR_H
#define OPENMC_TALLIES_FILTER_POLAR_H
#include <sstream>
#include <cmath>
@ -7,7 +7,7 @@
#include "openmc/error.h"
#include "openmc/search.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -16,7 +16,7 @@ namespace openmc {
//! Bins the incident neutron polar angle (relative to the global z-axis).
//==============================================================================
class PolarFilter : public TallyFilter
class PolarFilter : public Filter
{
public:
std::string type() const override {return "polar";}
@ -50,7 +50,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
double theta;
@ -70,7 +70,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
write_dataset(filter_group, "bins", bins_);
}
@ -87,4 +87,4 @@ protected:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_POLAR_H
#endif // OPENMC_TALLIES_FILTER_POLAR_H

View file

@ -1,10 +1,10 @@
#ifndef OPENMC_TALLY_FILTER_SPHERICAL_HARMONICS_H
#define OPENMC_TALLY_FILTER_SPHERICAL_HARMONICS_H
#ifndef OPENMC_TALLIES_FILTER_SPH_HAR_H
#define OPENMC_TALLIES_FILTER_SPH_HAR_H
#include <string>
#include "openmc/error.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -18,7 +18,7 @@ enum class SphericalHarmonicsCosine {
//! Gives spherical harmonics expansion moments of a tally score
//==============================================================================
class SphericalHarmonicsFilter : public TallyFilter
class SphericalHarmonicsFilter : public Filter
{
public:
std::string type() const override {return "sphericalharmonics";}
@ -47,7 +47,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
// Determine cosine term for scatter expansion if necessary
@ -78,7 +78,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
write_dataset(filter_group, "order", order_);
if (cosine_ == SphericalHarmonicsCosine::scatter) {
write_dataset(filter_group, "cosine", "scatter");
@ -105,4 +105,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_SPHERICAL_HARMONICS_H
#endif // OPENMC_TALLIES_FILTER_SPH_HAR_H

View file

@ -1,11 +1,11 @@
#ifndef OPENMC_TALLY_FILTER_SPTL_LEGENDRE_H
#define OPENMC_TALLY_FILTER_SPTL_LEGENDRE_H
#ifndef OPENMC_TALLIES_FILTER_SPTL_LEGENDRE_H
#define OPENMC_TALLIES_FILTER_SPTL_LEGENDRE_H
#include <string>
#include "openmc/error.h"
#include "openmc/math_functions.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -19,7 +19,7 @@ enum class LegendreAxis {
//! Gives Legendre moments of the particle's normalized position along an axis
//==============================================================================
class SpatialLegendreFilter : public TallyFilter
class SpatialLegendreFilter : public Filter
{
public:
std::string type() const override {return "spatiallegendre";}
@ -49,7 +49,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
// Get the coordinate along the axis of interest.
@ -79,7 +79,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
write_dataset(filter_group, "order", order_);
if (axis_ == LegendreAxis::x) {
write_dataset(filter_group, "axis", "x");
@ -114,4 +114,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_SPTL_LEGENDRE_H
#endif // OPENMC_TALLIES_FILTER_SPTL_LEGENDRE_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_SURFACE_H
#define OPENMC_TALLY_FILTER_SURFACE_H
#ifndef OPENMC_TALLIES_FILTER_SURFACE_H
#define OPENMC_TALLIES_FILTER_SURFACE_H
#include <cstdint>
#include <sstream>
@ -8,7 +8,7 @@
#include "openmc/error.h"
#include "openmc/surface.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -17,7 +17,7 @@ namespace openmc {
//! Specifies which surface particles are crossing
//==============================================================================
class SurfaceFilter : public TallyFilter
class SurfaceFilter : public Filter
{
public:
std::string type() const override {return "surface";}
@ -52,7 +52,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
auto search = map_.find(std::abs(p->surface)-1);
@ -69,7 +69,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
std::vector<int32_t> surface_ids;
for (auto c : surfaces_) surface_ids.push_back(surfaces[c]->id_);
write_dataset(filter_group, "bins", surface_ids);
@ -86,4 +86,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_SURFACE_H
#endif // OPENMC_TALLIES_FILTER_SURFACE_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_UNIVERSE_H
#define OPENMC_TALLY_FILTER_UNIVERSE_H
#ifndef OPENMC_TALLIES_FILTER_UNIVERSE_H
#define OPENMC_TALLIES_FILTER_UNIVERSE_H
#include <cstdint>
#include <sstream>
@ -8,7 +8,7 @@
#include "openmc/cell.h"
#include "openmc/error.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -17,7 +17,7 @@ namespace openmc {
//! Specifies which geometric universes tally events reside in.
//==============================================================================
class UniverseFilter : public TallyFilter
class UniverseFilter : public Filter
{
public:
std::string type() const override {return "universe";}
@ -52,7 +52,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
for (int i = 0; i < p->n_coord; i++) {
@ -67,7 +67,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
std::vector<int32_t> universe_ids;
for (auto u : universes_) universe_ids.push_back(universes[u]->id_);
write_dataset(filter_group, "bins", universe_ids);
@ -84,4 +84,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_UNIVERSE_H
#endif // OPENMC_TALLIES_FILTER_UNIVERSE_H

View file

@ -1,5 +1,5 @@
#ifndef OPENMC_TALLY_FILTER_ZERNIKE_H
#define OPENMC_TALLY_FILTER_ZERNIKE_H
#ifndef OPENMC_TALLIES_FILTER_ZERNIKE_H
#define OPENMC_TALLIES_FILTER_ZERNIKE_H
#include <cmath>
#include <sstream>
@ -7,7 +7,7 @@
#include "openmc/error.h"
#include "openmc/math_functions.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
namespace openmc {
@ -16,7 +16,7 @@ namespace openmc {
//! Gives Zernike polynomial moments of a particle's position
//==============================================================================
class ZernikeFilter : public TallyFilter
class ZernikeFilter : public Filter
{
public:
std::string type() const override {return "zernike";}
@ -34,7 +34,7 @@ public:
}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
// Determine the normalized (r,theta) coordinates.
@ -57,7 +57,7 @@ public:
void
to_statepoint(hid_t filter_group) const override
{
TallyFilter::to_statepoint(filter_group);
Filter::to_statepoint(filter_group);
write_dataset(filter_group, "order", order_);
write_dataset(filter_group, "x", x_);
write_dataset(filter_group, "y", y_);
@ -95,7 +95,7 @@ public:
std::string type() const override {return "zernikeradial";}
void
get_all_bins(Particle* p, int estimator, TallyFilterMatch& match)
get_all_bins(Particle* p, int estimator, FilterMatch& match)
const override
{
// Determine the normalized radius coordinate.
@ -124,4 +124,4 @@ public:
};
} // namespace openmc
#endif // OPENMC_TALLY_FILTER_ZERNIKE_H
#endif // OPENMC_TALLIES_FILTER_ZERNIKE_H

View file

@ -12,8 +12,8 @@
#include "openmc/material.h"
#include "openmc/settings.h"
#include "openmc/surface.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/tally_filter_distribcell.h"
#include "openmc/tallies/filter.h"
#include "openmc/tallies/filter_distribcell.h"
namespace openmc {

View file

@ -20,7 +20,7 @@
#include "openmc/hdf5_interface.h"
#include "openmc/message_passing.h"
#include "openmc/search.h"
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
#include "openmc/xml_interface.h"
namespace openmc {

View file

@ -4,8 +4,8 @@
#include "openmc/eigenvalue.h"
#include "openmc/message_passing.h"
#include "openmc/settings.h"
#include "openmc/tallies/filter.h"
#include "openmc/tallies/tally.h"
#include "openmc/tallies/tally_filter.h"
#include <algorithm>

View file

@ -1,27 +1,27 @@
#include "openmc/tallies/tally_filter.h"
#include "openmc/tallies/filter.h"
#include <string>
#include "openmc/capi.h"
#include "openmc/constants.h" // for MAX_LINE_LEN;
#include "openmc/error.h"
#include "openmc/tallies/tally_filter_azimuthal.h"
#include "openmc/tallies/tally_filter_cell.h"
#include "openmc/tallies/tally_filter_cellborn.h"
#include "openmc/tallies/tally_filter_cellfrom.h"
#include "openmc/tallies/tally_filter_distribcell.h"
#include "openmc/tallies/tally_filter_energyfunc.h"
#include "openmc/tallies/tally_filter_legendre.h"
#include "openmc/tallies/tally_filter_material.h"
#include "openmc/tallies/tally_filter_mesh.h"
#include "openmc/tallies/tally_filter_meshsurface.h"
#include "openmc/tallies/tally_filter_mu.h"
#include "openmc/tallies/tally_filter_polar.h"
#include "openmc/tallies/tally_filter_sph_harm.h"
#include "openmc/tallies/tally_filter_sptl_legendre.h"
#include "openmc/tallies/tally_filter_surface.h"
#include "openmc/tallies/tally_filter_universe.h"
#include "openmc/tallies/tally_filter_zernike.h"
#include "openmc/tallies/filter_azimuthal.h"
#include "openmc/tallies/filter_cell.h"
#include "openmc/tallies/filter_cellborn.h"
#include "openmc/tallies/filter_cellfrom.h"
#include "openmc/tallies/filter_distribcell.h"
#include "openmc/tallies/filter_energyfunc.h"
#include "openmc/tallies/filter_legendre.h"
#include "openmc/tallies/filter_material.h"
#include "openmc/tallies/filter_mesh.h"
#include "openmc/tallies/filter_meshsurface.h"
#include "openmc/tallies/filter_mu.h"
#include "openmc/tallies/filter_polar.h"
#include "openmc/tallies/filter_sph_harm.h"
#include "openmc/tallies/filter_sptl_legendre.h"
#include "openmc/tallies/filter_surface.h"
#include "openmc/tallies/filter_universe.h"
#include "openmc/tallies/filter_zernike.h"
namespace openmc {
@ -30,8 +30,8 @@ namespace openmc {
// Global variables
//==============================================================================
std::vector<TallyFilterMatch> filter_matches;
std::vector<TallyFilter*> tally_filters;
std::vector<FilterMatch> filter_matches;
std::vector<Filter*> tally_filters;
//==============================================================================
// Non-member functions
@ -45,7 +45,7 @@ free_memory_tally_c()
filter_matches.clear();
}
for (TallyFilter* filt : tally_filters) {delete filt;}
for (Filter* filt : tally_filters) {delete filt;}
tally_filters.clear();
}
@ -55,7 +55,7 @@ free_memory_tally_c()
// Fortran functions that will be called from C++
extern "C" int verify_filter(int32_t index);
extern "C" TallyFilter* filter_from_f(int32_t index);
extern "C" Filter* filter_from_f(int32_t index);
extern "C" void filter_update_n_bins(int32_t index);
extern "C" {
@ -445,42 +445,42 @@ extern "C" {
//==============================================================================
extern "C" {
TallyFilterMatch* filter_match_pointer(int indx)
FilterMatch* filter_match_pointer(int indx)
{return &filter_matches[indx];}
void
filter_match_bins_push_back(TallyFilterMatch* match, int val)
filter_match_bins_push_back(FilterMatch* match, int val)
{match->bins_.push_back(val);}
void
filter_match_weights_push_back(TallyFilterMatch* match, double val)
filter_match_weights_push_back(FilterMatch* match, double val)
{match->weights_.push_back(val);}
void
filter_match_bins_clear(TallyFilterMatch* match)
filter_match_bins_clear(FilterMatch* match)
{match->bins_.clear();}
void
filter_match_weights_clear(TallyFilterMatch* match)
filter_match_weights_clear(FilterMatch* match)
{match->weights_.clear();}
int
filter_match_bins_size(TallyFilterMatch* match)
filter_match_bins_size(FilterMatch* match)
{return match->bins_.size();}
int
filter_match_bins_data(TallyFilterMatch* match, int indx)
filter_match_bins_data(FilterMatch* match, int indx)
{return match->bins_[indx-1];}
double
filter_match_weights_data(TallyFilterMatch* match, int indx)
filter_match_weights_data(FilterMatch* match, int indx)
{return match->weights_[indx-1];}
void
filter_match_bins_set_data(TallyFilterMatch* match, int indx, int val)
filter_match_bins_set_data(FilterMatch* match, int indx, int val)
{match->bins_[indx-1] = val;}
TallyFilter*
Filter*
allocate_filter(const char* type)
{
std::string type_ {type};
@ -526,20 +526,20 @@ extern "C" {
return tally_filters.back();
}
void filter_from_xml(TallyFilter* filt, pugi::xml_node* node)
void filter_from_xml(Filter* filt, pugi::xml_node* node)
{filt->from_xml(*node);}
void
filter_get_all_bins(TallyFilter* filt, Particle* p, int estimator,
TallyFilterMatch* match)
filter_get_all_bins(Filter* filt, Particle* p, int estimator,
FilterMatch* match)
{
filt->get_all_bins(p, estimator, *match);
}
void filter_to_statepoint(TallyFilter* filt, hid_t group)
void filter_to_statepoint(Filter* filt, hid_t group)
{filt->to_statepoint(group);}
void filter_text_label(TallyFilter* filt, int bin, char* label)
void filter_text_label(Filter* filt, int bin, char* label)
{
std::string label_str = filt->text_label(bin);
int i = 0;
@ -548,9 +548,9 @@ extern "C" {
label[i] = '\0';
}
void filter_initialize(TallyFilter* filt) {filt->initialize();}
void filter_initialize(Filter* filt) {filt->initialize();}
int filter_n_bins(TallyFilter* filt) {return filt->n_bins_;}
int filter_n_bins(Filter* filt) {return filt->n_bins_;}
int mesh_filter_get_mesh(MeshFilter* filt) {return filt->mesh_;}