Cleaning up code, resolving @paulromano comments

This commit is contained in:
Adam G Nelson 2018-09-05 20:46:33 -04:00
parent cd1dfc0d19
commit 4b56c86c50
7 changed files with 27 additions and 59 deletions

View file

@ -11,9 +11,9 @@
namespace openmc {
typedef std::vector<std::vector<double> > double_2dvec;
typedef std::vector<std::vector<std::vector<double> > > double_3dvec;
typedef std::vector<std::vector<std::vector<std::vector<double> > > > double_4dvec;
using double_2dvec = std::vector<std::vector<double>>;
using double_3dvec = std::vector<std::vector<std::vector<double>>>;
using double_4dvec = std::vector<std::vector<std::vector<std::vector<double>>>>;
// ============================================================================
// VERSIONING NUMBERS

View file

@ -70,9 +70,6 @@ void
read_nd_vector(hid_t obj_id, const char* name, xt::xtensor<double, 4>& result,
bool must_have = false);
void
read_nd_vector(hid_t obj_id, const char* name, xt::xtensor<double, 5>& result,
bool must_have = false);
std::vector<hsize_t> attribute_shape(hid_t obj_id, const char* name);
std::vector<std::string> dataset_names(hid_t group_id);

View file

@ -159,7 +159,7 @@ class Mgxs {
//! @param dg delayed group index; use nullptr if irrelevant.
//! @return Requested cross section value.
double
get_xs(const int xstype, const int gin, int* gout, double* mu, int* dg);
get_xs(int xstype, int gin, int* gout, double* mu, int* dg);
//! \brief Samples the fission neutron energy and if prompt or delayed.
//!
@ -167,7 +167,7 @@ class Mgxs {
//! @param dg Sampled delayed group index.
//! @param gout Sampled outgoing energy group.
void
sample_fission_energy(const int gin, int& dg, int& gout);
sample_fission_energy(int gin, int& dg, int& gout);
//! \brief Samples the outgoing energy and angle from a scatter event.
//!
@ -176,7 +176,7 @@ class Mgxs {
//! @param mu Sampled cosine of the change-in-angle.
//! @param wgt Weight of the particle to be adjusted.
void
sample_scatter(const int gin, int& gout, double& mu, double& wgt);
sample_scatter(int gin, int& gout, double& mu, double& wgt);
//! \brief Calculates cross section quantities needed for tracking.
//!
@ -187,14 +187,14 @@ class Mgxs {
//! @param abs_xs Resultant absorption cross section.
//! @param nu_fiss_xs Resultant nu-fission cross section.
void
calculate_xs(const int gin, const double sqrtkT, const double uvw[3],
calculate_xs(int gin, double sqrtkT, const double uvw[3],
double& total_xs, double& abs_xs, double& nu_fiss_xs);
//! \brief Sets the temperature index in cache given a temperature
//!
//! @param sqrtkT Temperature of the material.
void
set_temperature_index(const double sqrtkT);
set_temperature_index(double sqrtkT);
//! \brief Sets the angle index in cache given a direction
//!

View file

@ -94,7 +94,7 @@ class XsData {
// [angle][incoming group][outgoing group][delayed group]
xt::xtensor<double, 4> chi_delayed;
// scatter has the following dimensions: [angle]
std::vector<std::shared_ptr<ScattData> > scatter;
std::vector<std::shared_ptr<ScattData>> scatter;
XsData() = default;