mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Add TODO comments for 1-based indexing in filters
This commit is contained in:
parent
009e1548d5
commit
773e73b323
17 changed files with 19 additions and 1 deletions
|
|
@ -66,6 +66,7 @@ std::string
|
|||
AzimuthalFilter::text_label(int bin) const
|
||||
{
|
||||
std::stringstream out;
|
||||
//TODO: off-by-one
|
||||
out << "Azimuthal Angle [" << bins_[bin-1] << ", " << bins_[bin] << ")";
|
||||
return out.str();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ CellFilter::to_statepoint(hid_t filter_group) const
|
|||
std::string
|
||||
CellFilter::text_label(int bin) const
|
||||
{
|
||||
//TODO: off-by-one
|
||||
return "Cell " + std::to_string(cells[cells_[bin-1]]->id_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ CellbornFilter::get_all_bins(const Particle* p, int estimator,
|
|||
std::string
|
||||
CellbornFilter::text_label(int bin) const
|
||||
{
|
||||
//TODO: off-by-one
|
||||
return "Birth Cell " + std::to_string(cells[cells_[bin-1]]->id_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ CellFromFilter::get_all_bins(const Particle* p, int estimator,
|
|||
std::string
|
||||
CellFromFilter::text_label(int bin) const
|
||||
{
|
||||
//TODO: off-by-one
|
||||
return "Cell from " + std::to_string(cells[cells_[bin-1]]->id_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ DelayedGroupFilter::to_statepoint(hid_t filter_group) const
|
|||
std::string
|
||||
DelayedGroupFilter::text_label(int bin) const
|
||||
{
|
||||
//TODO: off-by-one
|
||||
return "Delayed Group " + std::to_string(groups_[bin-1]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ std::string
|
|||
DistribcellFilter::text_label(int bin) const
|
||||
{
|
||||
auto map = cells[cell_]->distribcell_index_;
|
||||
//TODO: off-by-one
|
||||
auto path = distribcell_path(cell_, map, bin-1);
|
||||
return "Distributed Cell " + path;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ LegendreFilter::to_statepoint(hid_t filter_group) const
|
|||
std::string
|
||||
LegendreFilter::text_label(int bin) const
|
||||
{
|
||||
//TODO: off-by-one
|
||||
return "Legendre expansion, P" + std::to_string(bin - 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ MaterialFilter::to_statepoint(hid_t filter_group) const
|
|||
std::string
|
||||
MaterialFilter::text_label(int bin) const
|
||||
{
|
||||
//TODO: off-by-one
|
||||
return "Material " + std::to_string(materials[materials_[bin-1]]->id_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ MeshSurfaceFilter::text_label(int bin) const
|
|||
int n_dim = mesh.n_dimension_;
|
||||
|
||||
// Get flattend mesh index and surface index.
|
||||
//TODO: off-by-one
|
||||
int i_mesh = (bin - 1) / (4 * n_dim) + 1;
|
||||
int i_surf = ((bin - 1) % (4 * n_dim)) + 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ std::string
|
|||
MuFilter::text_label(int bin) const
|
||||
{
|
||||
std::stringstream out;
|
||||
//TODO: off-by-one
|
||||
out << "Change-in-Angle [" << bins_[bin-1] << ", " << bins_[bin] << ")";
|
||||
return out.str();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ ParticleFilter::to_statepoint(hid_t filter_group) const
|
|||
std::string
|
||||
ParticleFilter::text_label(int bin) const
|
||||
{
|
||||
//TODO: off-by-one
|
||||
return "Particle " + std::to_string(particles_[bin-1]);
|
||||
}
|
||||
|
||||
|
|
@ -42,6 +43,6 @@ ParticleFilter::text_label(int bin) const
|
|||
//==============================================================================
|
||||
|
||||
extern "C" int particle_filter_particles(ParticleFilter* filt, int i)
|
||||
{return filt->particles_[i];}
|
||||
{return filt->particles_[i-1];}
|
||||
|
||||
} // namespace openmc
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ std::string
|
|||
PolarFilter::text_label(int bin) const
|
||||
{
|
||||
std::stringstream out;
|
||||
//TODO: off-by-one
|
||||
out << "Polar Angle [" << bins_[bin-1] << ", " << bins_[bin] << ")";
|
||||
return out.str();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ SphericalHarmonicsFilter::text_label(int bin) const
|
|||
std::stringstream out;
|
||||
for (int n = 0; n < order_ + 1; n++) {
|
||||
if (bin <= (n + 1) * (n + 1)) {
|
||||
//TODO: off-by-one
|
||||
int m = (bin - n*n - 1) - n;
|
||||
out << "Spherical harmonic expansion, Y" << n << "," << m;
|
||||
return out.str();
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ SpatialLegendreFilter::text_label(int bin) const
|
|||
} else {
|
||||
out << "z";
|
||||
}
|
||||
//TODO: off-by-one
|
||||
out << " axis, P" << std::to_string(bin - 1);
|
||||
return out.str();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ SurfaceFilter::to_statepoint(hid_t filter_group) const
|
|||
std::string
|
||||
SurfaceFilter::text_label(int bin) const
|
||||
{
|
||||
//TODO: off-by-one
|
||||
return "Surface " + std::to_string(surfaces[surfaces_[bin-1]]->id_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ UniverseFilter::to_statepoint(hid_t filter_group) const
|
|||
std::string
|
||||
UniverseFilter::text_label(int bin) const
|
||||
{
|
||||
//TODO: off-by-one
|
||||
return "Universe " + std::to_string(universes[universes_[bin-1]]->id_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ ZernikeFilter::text_label(int bin) const
|
|||
std::stringstream out;
|
||||
for (int n = 0; n < order_+1; n++) {
|
||||
int last = (n + 1) * (n + 2) / 2;
|
||||
//TODO: off-by-one
|
||||
if (bin <= last) {
|
||||
int first = last - n;
|
||||
int m = -n + (bin - first) * 2;
|
||||
|
|
@ -106,6 +107,7 @@ ZernikeRadialFilter::get_all_bins(const Particle* p, int estimator,
|
|||
std::string
|
||||
ZernikeRadialFilter::text_label(int bin) const
|
||||
{
|
||||
//TODO: off-by-one
|
||||
return "Zernike expansion, Z" + std::to_string(2*(bin-1)) + ",0";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue