formatting cleanup

This commit is contained in:
John Tramm 2020-01-14 19:30:18 +00:00
parent a44e355ff0
commit d6d804600f
10 changed files with 17 additions and 37 deletions

View file

@ -8,6 +8,7 @@
#include "openmc/particle.h"
namespace openmc {
//==============================================================================

View file

@ -161,7 +161,7 @@ public:
//! \param[in] bank Array of bank sites
//! \param[out] Whether any bank sites are outside the mesh
//! \return Array indicating number of sites in each mesh/energy bin
xt::xtensor<double, 1> count_sites(const Particle::Bank* bank, uint64_t length,
xt::xtensor<double, 1> count_sites(const Particle::Bank* bank, int64_t length,
bool* outside) const;
// Data members

View file

@ -53,9 +53,6 @@ void score_collision_derivative(Particle* p);
//! \param distance The distance in [cm] traveled by the particle
void score_track_derivative(Particle* p, double distance);
//! Set the flux derivatives on differential tallies to zero.
void zero_flux_derivs(std::vector<double> v);
} // namespace openmc
//==============================================================================

View file

@ -2,8 +2,8 @@
#define OPENMC_TALLIES_TALLY_SCORING_H
#include "openmc/particle.h"
#include "openmc/tallies/tally.h"
#include "openmc/tallies/filter.h"
#include "openmc/tallies/tally.h"
namespace openmc {
@ -23,12 +23,14 @@ class FilterBinIter
public:
//! Construct an iterator over bins that match a given particle's state.
FilterBinIter(const Tally& tally, const Particle* p, std::vector<FilterMatch>* particle_filter_matches);
FilterBinIter(const Tally& tally, const Particle* p,
std::vector<FilterMatch>* particle_filter_matches);
//! Construct an iterator over all filter bin combinations.
//
//! \param end if true, the returned iterator indicates the end of a loop.
FilterBinIter(const Tally& tally, bool end, std::vector<FilterMatch>* particle_filter_matches);
FilterBinIter(const Tally& tally, bool end,
std::vector<FilterMatch>* particle_filter_matches);
bool operator==(const FilterBinIter& other) const
{return index_ == other.index_;}

View file

@ -1,12 +1,9 @@
#include "openmc/bank.h"
#include "openmc/capi.h"
#include "openmc/error.h"
#include <cstdint>
// Explicit template instantiation definition
//template class std::vector<openmc::Particle::Bank>;
namespace openmc {

View file

@ -119,12 +119,6 @@ find_cell_inner(Particle* p, const NeighborList* neighbor_list)
}
// Announce the cell that the particle is entering.
if( p->trace_ )
{
std::stringstream msg;
msg << "p->trace = " << p->trace_;
write_message(msg, 1);
}
if (found && (settings::verbosity >= 10 || p->trace_)) {
std::stringstream msg;
msg << " Entering cell " << model::cells[i_cell]->id_;

View file

@ -790,7 +790,7 @@ void RegularMesh::to_hdf5(hid_t group) const
}
xt::xtensor<double, 1>
RegularMesh::count_sites(const Particle::Bank* bank, uint64_t length,
RegularMesh::count_sites(const Particle::Bank* bank, int64_t length,
bool* outside) const
{
// Determine shape of array for counts
@ -801,7 +801,7 @@ RegularMesh::count_sites(const Particle::Bank* bank, uint64_t length,
xt::xarray<double> cnt {shape, 0.0};
bool outside_ = false;
for (uint64_t i = 0; i < length; i++) {
for (int64_t i = 0; i < length; i++) {
const auto& site = bank[i];
// determine scoring bin for entropy mesh

View file

@ -10,8 +10,8 @@
#include "openmc/random_lcg.h"
#include "openmc/settings.h"
#include "openmc/simulation.h"
#include "openmc/tallies/tally.h"
#include "openmc/tallies/derivative.h"
#include "openmc/tallies/tally.h"
#include "openmc/track_output.h"
#include <algorithm> // for copy

View file

@ -33,12 +33,7 @@
#include <algorithm>
#include <string>
#include <chrono>
namespace openmc {
} // namespace openmc
//==============================================================================
// C API functions
@ -426,7 +421,6 @@ void finalize_generation()
// For fixed-source mode, we need to sample the external source
fill_source_bank_fixedsource();
}
}
void initialize_history(Particle* p, int64_t index_source)

View file

@ -115,8 +115,8 @@ apply_derivative_to_score(const Particle* p, int i_tally, int i_nuclide,
// where (1/f * d_f/d_p) is the (logarithmic) flux derivative and p is the
// perturbated variable.
const auto& deriv {model::tally_derivs[tally.deriv_]};
const double& flux_deriv {p->flux_derivs_[tally.deriv_]};
const auto& deriv = model::tally_derivs[tally.deriv_];
const auto& flux_deriv = p->flux_derivs_[tally.deriv_];
// Handle special cases where we know that d_c/d_p must be zero.
if (score_bin == SCORE_FLUX) {
@ -569,9 +569,9 @@ score_track_derivative(Particle* p, double distance)
if (p->material_ == MATERIAL_VOID) return;
const Material& material {*model::materials[p->material_]};
for (int idx = 0; idx < model::tally_derivs.size(); idx++) {
const auto& deriv {model::tally_derivs[idx]};
double& flux_deriv = p->flux_derivs_[idx];
for (auto idx = 0; idx < model::tally_derivs.size(); idx++) {
const auto& deriv = model::tally_derivs[idx];
auto& flux_deriv = p->flux_derivs_[idx];
if (deriv.diff_material != material.id_) continue;
switch (deriv.variable) {
@ -620,8 +620,8 @@ void score_collision_derivative(Particle* p)
//for (auto& deriv : model::tally_derivs) {
for (int idx = 0; idx < model::tally_derivs.size(); idx++) {
const auto& deriv = model::tally_derivs[idx];
double& flux_deriv = p->flux_derivs_[idx];
const auto& deriv = model::tally_derivs[idx];
auto& flux_deriv = p->flux_derivs_[idx];
if (deriv.diff_material != material.id_) continue;
@ -682,9 +682,4 @@ void score_collision_derivative(Particle* p)
}
}
void zero_flux_derivs(std::vector<double> v)
{
std::fill(v.begin(), v.end(), 0);
}
}// namespace openmc