Docs added

This commit is contained in:
Adam G Nelson 2018-06-17 10:10:53 -04:00
parent 1343ef2000
commit 8c2a88243b
6 changed files with 420 additions and 102 deletions

View file

@ -46,7 +46,7 @@ Mgxs::init(const std::string& in_name, const double in_awr,
//==============================================================================
void
Mgxs::_metadata_from_hdf5(const hid_t xs_id, const int in_num_groups,
Mgxs::metadata_from_hdf5(const hid_t xs_id, const int in_num_groups,
const int in_num_delayed_groups, double_1dvec& temperature, int& method,
const double tolerance, int_1dvec& temps_to_read, int& order_dim,
const int n_threads)
@ -267,7 +267,7 @@ Mgxs::from_hdf5(hid_t xs_id, const int energy_groups,
// Call generic data gathering routine (will populate the metadata)
int order_data;
int_1dvec temps_to_read;
_metadata_from_hdf5(xs_id, energy_groups, delayed_groups, temperature,
metadata_from_hdf5(xs_id, energy_groups, delayed_groups, temperature,
method, tolerance, temps_to_read, order_data, n_threads);
// Set number of energy and delayed groups

View file

@ -42,6 +42,7 @@ struct CacheData {
class Mgxs {
private:
double_1dvec kTs; // temperature in eV (k * T)
int scatter_format; // flag for if this is legendre, histogram, or tabular
int num_delayed_groups; // number of delayed neutron groups
@ -53,43 +54,174 @@ class Mgxs {
int n_azi;
double_1dvec polar;
double_1dvec azimuthal;
void _metadata_from_hdf5(const hid_t xs_id, const int in_num_groups,
//! \brief Initializes the Mgxs object metadata from the HDF5 file
//!
//! @param xs_id HDF5 group id for the cross section data.
//! @param in_num_groups Number of energy groups.
//! @param in_num_delayed_groups Number of delayed groups.
//! @param temperature Temperatures to read.
//! @param method Method of choosing nearest temperatures.
//! @param tolerance Tolerance of temperature selection method.
//! @param temps_to_read Resultant list of temperatures in the library
//! to read which correspond to the requested temperatures.
//! @param order_dim Resultant dimensionality of the scattering order.
//! @param n_threads Number of threads at runtime.
void
metadata_from_hdf5(const hid_t xs_id, const int in_num_groups,
const int in_num_delayed_groups, double_1dvec& temperature,
int& method, const double tolerance, int_1dvec& temps_to_read,
int& order_dim, const int n_threads);
bool equiv(const Mgxs& that);
public:
std::string name; // name of dataset, e.g., UO2
double awr; // atomic weight ratio
bool fissionable; // Is this fissionable
// TODO: The following attributes be private when Fortran is fully replaced
std::vector<CacheData> cache; // index and data cache
void init(const std::string& in_name, const double in_awr,
//! \brief Initializes the Mgxs object metadata
//!
//! @param in_name Name of the object.
//! @param in_awr atomic-weight ratio.
//! @param in_kTs temperatures (in units of eV) that data is available.
//! @param in_fissionable Is this item fissionable or not.
//! @param in_scatter_format Denotes whether Legendre, Tabular, or
//! Histogram scattering is used.
//! @param in_num_groups Number of energy groups.
//! @param in_num_delayed_groups Number of delayed groups.
//! @param in_is_isotropic Is this an isotropic or angular with respect to
//! the incoming particle.
//! @param in_polar Polar angle grid.
//! @param in_azimuthal Azimuthal angle grid.
//! @param n_threads Number of threads at runtime.
void
init(const std::string& in_name, const double in_awr,
const double_1dvec& in_kTs, const bool in_fissionable,
const int in_scatter_format, const int in_num_groups,
const int in_num_delayed_groups, const bool in_is_isotropic,
const double_1dvec& in_polar, const double_1dvec& in_azimuthal,
const int n_threads);
void build_macro(const std::string& in_name, double_1dvec& mat_kTs,
std::vector<Mgxs*>& micros, double_1dvec& atom_densities,
int& method, const double tolerance, const int n_threads);
void combine(std::vector<Mgxs*>& micros, double_1dvec& scalars,
int_1dvec& micro_ts, int this_t);
void from_hdf5(hid_t xs_id, const int energy_groups,
//! \brief Performs the actual act of combining the microscopic data for a
//! single temperature.
//!
//! @param micros Microscopic objects to combine.
//! @param scalars Scalars to multiply the microscopic data by.
//! @param micro_ts The temperature index of the microscopic objects that
//! corresponds to the temperature of interest.
//! @param this_t The temperature index of the macroscopic object.
void
combine(std::vector<Mgxs*>& micros, double_1dvec& scalars,
int_1dvec& micro_ts, int this_t);
//! \brief Checks to see if this and that are able to be combined
//!
//! This comparison is used when building macroscopic cross sections
//! from microscopic cross sections.
//! @param that The other Mgxs to compare to this one.
//! @return True if they can be combined, False otherwise.
bool equiv(const Mgxs& that);
public:
std::string name; // name of dataset, e.g., UO2
double awr; // atomic weight ratio
bool fissionable; // Is this fissionable
std::vector<CacheData> cache; // index and data cache
//! \brief Initializes and populates all data to build a macroscopic
//! cross section from microscopic cross section.
//!
//! @param in_name Name of the object.
//! @param mat_kTs temperatures (in units of eV) that data is needed.
//! @param micros Microscopic objects to combine.
//! @param atom_densities Atom densities of those microscopic quantities.
//! @param method Method of choosing nearest temperatures.
//! @param tolerance Tolerance of temperature selection method.
//! @param n_threads Number of threads at runtime.
void
build_macro(const std::string& in_name, double_1dvec& mat_kTs,
std::vector<Mgxs*>& micros, double_1dvec& atom_densities,
int& method, const double tolerance, const int n_threads);
//! \brief Loads the Mgxs object from the HDF5 file
//!
//! @param xs_id HDF5 group id for the cross section data.
//! @param energy_groups Number of energy groups.
//! @param delayed_groups Number of delayed groups.
//! @param temperature Temperatures to read.
//! @param method Method of choosing nearest temperatures.
//! @param tolerance Tolerance of temperature selection method.
//! @param max_order Maximum order requested by the user;
//! this is only used for Legendre scattering.
//! @param legendre_to_tabular Flag to denote if any Legendre provided
//! should be converted to a Tabular representation.
//! @param legendre_to_tabular_points If a conversion is requested, this
//! provides the number of points to use in the tabular representation.
//! @param n_threads Number of threads at runtime.
void
from_hdf5(hid_t xs_id, const int energy_groups,
const int delayed_groups, double_1dvec& temperature, int& method,
const double tolerance, const int max_order,
const bool legendre_to_tabular, const int legendre_to_tabular_points,
const int n_threads);
double get_xs(const int tid, const int xstype, const int gin, int* gout,
//! \brief Provides a cross section value given certain parameters
//!
//! @param xstype Type of cross section requested, according to the
//! enumerated constants.
//! @param gin Incoming energy group.
//! @param gout Outgoing energy group; use nullptr if irrelevant, or if a
//! sum is requested.
//! @param mu Cosine of the change-in-angle, for scattering quantities;
//! use nullptr if irrelevant.
//! @param dg delayed group index; use nullptr if irrelevant.
//! @return Requested cross section value.
double
get_xs(const int tid, const int xstype, const int gin, int* gout,
double* mu, int* dg);
void sample_fission_energy(const int tid, const int gin, int& dg, int& gout);
void sample_scatter(const int tid, const int gin, int& gout, double& mu,
//! \brief Samples the fission neutron energy and if prompt or delayed.
//!
//! @param tid Thread id to use when using the index cache.
//! @param gin Incoming energy group.
//! @param dg Sampled delayed group index.
//! @param gout Sampled outgoing energy group.
void
sample_fission_energy(const int tid, const int gin, int& dg, int& gout);
//! \brief Samples the outgoing energy and angle from a scatter event.
//!
//! @param tid Thread id to use when using the index cache.
//! @param gin Incoming energy group.
//! @param gout Sampled outgoing energy group.
//! @param mu Sampled cosine of the change-in-angle.
//! @param wgt Weight of the particle to be adjusted.
void
sample_scatter(const int tid, const int gin, int& gout, double& mu,
double& wgt);
void calculate_xs(const int tid, const int gin, const double sqrtkT,
const double uvw[3], double& total_xs, double& abs_xs, double& nu_fiss_xs);
void set_temperature_index(const int tid, const double sqrtkT);
void set_angle_index(const int tid, const double uvw[3]);
//! \brief Calculates cross section quantities needed for tracking.
//!
//! @param tid Thread id to use when using the index cache.
//! @param gin Incoming energy group.
//! @param sqrtkT Temperature of the material.
//! @param uvw Incoming particle direction.
//! @param total_xs Resultant total cross section.
//! @param abs_xs Resultant absorption cross section.
//! @param nu_fiss_xs Resultant nu-fission cross section.
void
calculate_xs(const int tid, const int gin, const 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 tid Thread id to use when setting the index cache.
//! @param sqrtkT Temperature of the material.
void
set_temperature_index(const int tid, const double sqrtkT);
//! \brief Sets the angle index in cache given a direction
//!
//! @param tid Thread id to use when setting the index cache.
//! @param uvw Incoming particle direction.
void
set_angle_index(const int tid, const double uvw[3]);
};
} // namespace openmc

View file

@ -7,7 +7,7 @@ namespace openmc {
//==============================================================================
void
ScattData::generic_init(int order, int_1dvec& in_gmin, int_1dvec& in_gmax,
ScattData::base_init(int order, int_1dvec& in_gmin, int_1dvec& in_gmax,
double_2dvec& in_energy, double_2dvec& in_mult)
{
int groups = in_energy.size();
@ -42,7 +42,7 @@ ScattData::generic_init(int order, int_1dvec& in_gmin, int_1dvec& in_gmax,
//==============================================================================
void
ScattData::generic_combine(const int max_order,
ScattData::base_combine(const int max_order,
const std::vector<ScattData*>& those_scatts, const double_1dvec& scalars,
int_1dvec& in_gmin, int_1dvec& in_gmax, double_2dvec& sparse_mult,
double_3dvec& sparse_scatter)
@ -277,7 +277,7 @@ ScattDataLegendre::init(int_1dvec& in_gmin, int_1dvec& in_gmax,
}
// Initialize the base class attributes
ScattData::generic_init(order, in_gmin, in_gmax, in_energy, in_mult);
ScattData::base_init(order, in_gmin, in_gmax, in_energy, in_mult);
// Set the distribution (sdata.dist) values and initialize max_val
max_val.resize(groups);
@ -407,7 +407,7 @@ ScattDataLegendre::combine(const std::vector<ScattData*>& those_scatts,
// The rest of the steps do not depend on the type of angular representation
// so we use a base class method to sum up xs and create new energy and mult
// matrices
ScattData::generic_combine(max_order, those_scatts, scalars, in_gmin, in_gmax,
ScattData::base_combine(max_order, those_scatts, scalars, in_gmin, in_gmax,
sparse_mult, sparse_scatter);
// Got everything we need, store it.
@ -479,7 +479,7 @@ ScattDataHistogram::init(int_1dvec& in_gmin, int_1dvec& in_gmax,
}
// Initialize the base class attributes
ScattData::generic_init(order, in_gmin, in_gmax, in_energy,
ScattData::base_init(order, in_gmin, in_gmax, in_energy,
in_mult);
// Build the angular distribution mu values
@ -631,7 +631,7 @@ ScattDataHistogram::combine(const std::vector<ScattData*>& those_scatts,
// The rest of the steps do not depend on the type of angular representation
// so we use a base class method to sum up xs and create new energy and mult
// matrices
ScattData::generic_combine(max_order, those_scatts, scalars, in_gmin, in_gmax,
ScattData::base_combine(max_order, those_scatts, scalars, in_gmin, in_gmax,
sparse_mult, sparse_scatter);
// Got everything we need, store it.
@ -691,7 +691,7 @@ ScattDataTabular::init(int_1dvec& in_gmin, int_1dvec& in_gmax,
}
// Initialize the base class attributes
ScattData::generic_init(order, in_gmin, in_gmax, in_energy, in_mult);
ScattData::base_init(order, in_gmin, in_gmax, in_energy, in_mult);
// Calculate f(mu) and integrate it so we can avoid rejection sampling
fmu.resize(groups);
@ -855,7 +855,7 @@ ScattDataTabular::combine(const std::vector<ScattData*>& those_scatts,
// The rest of the steps do not depend on the type of angular representation
// so we use a base class method to sum up xs and create new energy and mult
// matrices
ScattData::generic_combine(max_order, those_scatts, scalars, in_gmin, in_gmax,
ScattData::base_combine(max_order, those_scatts, scalars, in_gmin, in_gmax,
sparse_mult, sparse_scatter);
// Got everything we need, store it.
@ -881,7 +881,7 @@ convert_legendre_to_tabular(ScattDataLegendre& leg, ScattDataTabular& tab,
}
}
tab.generic_init(n_mu, leg.gmin, leg.gmax, leg.energy, leg.mult);
tab.base_init(n_mu, leg.gmin, leg.gmax, leg.energy, leg.mult);
tab.scattxs = leg.scattxs;
// Build mu and dmu

View file

@ -27,31 +27,104 @@ class ScattDataTabular;
class ScattData {
protected:
void generic_init(int order, int_1dvec& in_gmin, int_1dvec& in_gmax,
double_2dvec& in_energy, double_2dvec& in_mult);
void generic_combine(const int max_order,
const std::vector<ScattData*>& those_scatts,
const double_1dvec& scalars, int_1dvec& in_gmin,
int_1dvec& in_gmax, double_2dvec& sparse_mult,
double_3dvec& sparse_scatter);
//! \brief Initializes the attributes of the base class.
void
base_init(int order, int_1dvec& in_gmin, int_1dvec& in_gmax,
double_2dvec& in_energy, double_2dvec& in_mult);
//! \brief Combines microscopic ScattDatas into a macroscopic one.
void
base_combine(const int max_order,
const std::vector<ScattData*>& those_scatts,
const double_1dvec& scalars, int_1dvec& in_gmin, int_1dvec& in_gmax,
double_2dvec& sparse_mult, double_3dvec& sparse_scatter);
public:
double_2dvec energy; // Normalized p0 matrix for sampling Eout
double_2dvec mult; // nu-scatter multiplication (nu-scatt/scatt)
double_3dvec dist; // Angular distribution
int_1dvec gmin; // minimum outgoing group
int_1dvec gmax; // maximum outgoing group
double_1dvec scattxs; // Isotropic Sigma_{s,g_{in}}
virtual double calc_f(const int gin, const int gout, const double mu) = 0;
virtual void sample(const int gin, int& gout, double& mu, double& wgt) = 0;
virtual void init(int_1dvec& in_gmin, int_1dvec& in_gmax,
double_2dvec& in_mult, double_3dvec& coeffs) = 0;
void sample_energy(int gin, int& gout, int& i_gout);
double get_xs(const int xstype, const int gin, const int* gout,
const double* mu);
virtual void combine(const std::vector<ScattData*>& those_scatts,
const double_1dvec& scalars) = 0;
virtual int get_order() = 0;
virtual double_3dvec get_matrix(const int max_order) = 0;
//! \brief Calculates the value of normalized f(mu).
//!
//! The value of f(mu) is normalized as in the integral of f(mu)dmu across
//! [-1,1] is 1.
//!
//! @param gin Incoming energy group of interest.
//! @param gout Outgoing energy group of interest.
//! @param mu Cosine of the change-in-angle of interest.
//! @return The value of f(mu).
virtual double
calc_f(const int gin, const int gout, const double mu) = 0;
//! \brief Samples the outgoing energy and angle from the ScattData info.
//!
//! @param gin Incoming energy group.
//! @param gout Sampled outgoing energy group.
//! @param mu Sampled cosine of the change-in-angle.
//! @param wgt Weight of the particle to be adjusted.
virtual void
sample(const int gin, int& gout, double& mu, double& wgt) = 0;
//! \brief Initializes the ScattData object from a given scatter and
//! multiplicity matrix.
//!
//! @param in_gmin List of minimum outgoing groups for every incoming group
//! @param in_gmax List of maximum outgoing groups for every incoming group
//! @param in_mult Input sparse multiplicity matrix
//! @param coeffs Input sparse scattering matrix
virtual void
init(int_1dvec& in_gmin, int_1dvec& in_gmax, double_2dvec& in_mult,
double_3dvec& coeffs) = 0;
//! \brief Combines the microscopic data.
//!
//! @param those_scatts Microscopic objects to combine.
//! @param scalars Scalars to multiply the microscopic data by.
virtual void
combine(const std::vector<ScattData*>& those_scatts,
const double_1dvec& scalars) = 0;
//! \brief Getter for the dimensionality of the scattering order.
//!
//! If Legendre this is the "n" in "Pn"; for Tabular, this is the number
//! of points, and for Histogram this is the number of bins.
//!
//! @return The order.
virtual int
get_order() = 0;
//! \brief Builds a dense scattering matrix from the constituent parts
//!
//! @param max_order If Legendre this is the maximum value of "n" in "Pn"
//! requested; ignored otherwise.
//! @return The dense scattering matrix.
virtual double_3dvec
get_matrix(const int max_order) = 0;
//! \brief Samples the outgoing energy from the ScattData info.
//!
//! @param gin Incoming energy group.
//! @param gout Sampled outgoing energy group.
//! @param i_gout Sampled outgoing energy group index.
void
sample_energy(int gin, int& gout, int& i_gout);
//! \brief Provides a cross section value given certain parameters
//!
//! @param xstype Type of cross section requested, according to the
//! enumerated constants.
//! @param gin Incoming energy group.
//! @param gout Outgoing energy group; use nullptr if irrelevant, or if a
//! sum is requested.
//! @param mu Cosine of the change-in-angle, for scattering quantities;
//! use nullptr if irrelevant.
//! @return Requested cross section value.
double
get_xs(const int xstype, const int gin, const int* gout, const double* mu);
};
//==============================================================================
@ -59,21 +132,44 @@ class ScattData {
//==============================================================================
class ScattDataLegendre: public ScattData {
protected:
// Maximal value for rejection sampling from a rectangle
double_2dvec max_val;
friend void convert_legendre_to_tabular(ScattDataLegendre& leg,
ScattDataTabular& tab, int n_mu);
// Friend convert_legendre_to_tabular so it has access to protected
// parameters
friend void
convert_legendre_to_tabular(ScattDataLegendre& leg, ScattDataTabular& tab,
int n_mu);
public:
void init(int_1dvec& in_gmin, int_1dvec& in_gmax, double_2dvec& in_mult,
double_3dvec& coeffs);
void update_max_val();
double calc_f(const int gin, const int gout, const double mu);
void sample(const int gin, int& gout, double& mu, double& wgt);
void combine(const std::vector<ScattData*>& those_scatts,
const double_1dvec& scalars);
int get_order() {return dist[0][0].size() - 1;};
double_3dvec get_matrix(const int max_order);
void
init(int_1dvec& in_gmin, int_1dvec& in_gmax, double_2dvec& in_mult,
double_3dvec& coeffs);
void
combine(const std::vector<ScattData*>& those_scatts,
const double_1dvec& scalars);
//! \brief Find the maximal value of the angular distribution to use as a
// bounding box with rejection sampling.
void
update_max_val();
double
calc_f(const int gin, const int gout, const double mu);
void
sample(const int gin, int& gout, double& mu, double& wgt);
int
get_order() {return dist[0][0].size() - 1;};
double_3dvec
get_matrix(const int max_order);
};
//==============================================================================
@ -82,19 +178,34 @@ class ScattDataLegendre: public ScattData {
//==============================================================================
class ScattDataHistogram: public ScattData {
protected:
double_1dvec mu;
double dmu;
double_3dvec fmu;
double_1dvec mu; // Angle distribution mu bin boundaries
double dmu; // Quick storage of the spacing between the mu bin points
double_3dvec fmu; // The angular distribution histogram
public:
void init(int_1dvec& in_gmin, int_1dvec& in_gmax, double_2dvec& in_mult,
double_3dvec& coeffs);
double calc_f(const int gin, const int gout, const double mu);
void sample(const int gin, int& gout, double& mu, double& wgt);
void combine(const std::vector<ScattData*>& those_scatts,
const double_1dvec& scalars);
int get_order() {return dist[0][0].size();};
double_3dvec get_matrix(const int max_order);
void
init(int_1dvec& in_gmin, int_1dvec& in_gmax, double_2dvec& in_mult,
double_3dvec& coeffs);
void
combine(const std::vector<ScattData*>& those_scatts,
const double_1dvec& scalars);
double
calc_f(const int gin, const int gout, const double mu);
void
sample(const int gin, int& gout, double& mu, double& wgt);
int
get_order() {return dist[0][0].size();};
double_3dvec
get_matrix(const int max_order);
};
//==============================================================================
@ -103,20 +214,38 @@ class ScattDataHistogram: public ScattData {
//==============================================================================
class ScattDataTabular: public ScattData {
protected:
double_1dvec mu;
double dmu;
double_3dvec fmu;
friend void convert_legendre_to_tabular(ScattDataLegendre& leg,
ScattDataTabular& tab, int n_mu);
double_1dvec mu; // Angle distribution mu grid points
double dmu; // Quick storage of the spacing between the mu points
double_3dvec fmu; // The angular distribution function
// Friend convert_legendre_to_tabular so it has access to protected
// parameters
friend void
convert_legendre_to_tabular(ScattDataLegendre& leg, ScattDataTabular& tab,
int n_mu);
public:
void init(int_1dvec& in_gmin, int_1dvec& in_gmax, double_2dvec& in_mult,
double_3dvec& coeffs);
double calc_f(const int gin, const int gout, const double mu);
void sample(const int gin, int& gout, double& mu, double& wgt);
void combine(const std::vector<ScattData*>& those_scatts,
const double_1dvec& scalars);
int get_order() {return dist[0][0].size();};
void
init(int_1dvec& in_gmin, int_1dvec& in_gmax, double_2dvec& in_mult,
double_3dvec& coeffs);
void
combine(const std::vector<ScattData*>& those_scatts,
const double_1dvec& scalars);
double
calc_f(const int gin, const int gout, const double mu);
void
sample(const int gin, int& gout, double& mu, double& wgt);
int
get_order() {return dist[0][0].size();};
double_3dvec get_matrix(const int max_order);
};
@ -124,6 +253,12 @@ class ScattDataTabular: public ScattData {
// Function to convert Legendre functions to tabular
//==============================================================================
//! \brief Converts a ScattDatalegendre to a ScattDataHistogram
//!
//! @param leg The initial ScattDataLegendre object.
//! @param leg The resultant ScattDataTabular object.
//! @param n_mu The number of mu points to use when building the
//! ScattDataTabular object.
void
convert_legendre_to_tabular(ScattDataLegendre& leg, ScattDataTabular& tab,
int n_mu);

View file

@ -73,8 +73,8 @@ XsData::from_hdf5(const hid_t xsdata_grp, const bool fissionable,
// Set the fissionable-specific data
if (fissionable) {
_fissionable_from_hdf5(xsdata_grp, n_pol, n_azi, energy_groups,
delayed_groups, is_isotropic);
fission_from_hdf5(xsdata_grp, n_pol, n_azi, energy_groups, delayed_groups,
is_isotropic);
}
// Get the non-fission-specific data
read_nd_vector(xsdata_grp, "decay_rate", decay_rate);
@ -82,7 +82,7 @@ XsData::from_hdf5(const hid_t xsdata_grp, const bool fissionable,
read_nd_vector(xsdata_grp, "inverse-velocity", inverse_velocity);
// Get scattering data
_scatter_from_hdf5(xsdata_grp, n_pol, n_azi, energy_groups, scatter_format,
scatter_from_hdf5(xsdata_grp, n_pol, n_azi, energy_groups, scatter_format,
final_scatter_format, order_data, max_order,
legendre_to_tabular_points);
@ -116,7 +116,7 @@ XsData::from_hdf5(const hid_t xsdata_grp, const bool fissionable,
//==============================================================================
void
XsData::_fissionable_from_hdf5(const hid_t xsdata_grp, const int n_pol,
XsData::fission_from_hdf5(const hid_t xsdata_grp, const int n_pol,
const int n_azi, const int energy_groups, const int delayed_groups,
const bool is_isotropic)
{
@ -485,7 +485,7 @@ XsData::_fissionable_from_hdf5(const hid_t xsdata_grp, const int n_pol,
//==============================================================================
void
XsData::_scatter_from_hdf5(const hid_t xsdata_grp, const int n_pol,
XsData::scatter_from_hdf5(const hid_t xsdata_grp, const int n_pol,
const int n_azi, const int energy_groups, int scatter_format,
const int final_scatter_format, const int order_data, const int max_order,
const int legendre_to_tabular_points)

View file

@ -23,15 +23,23 @@ namespace openmc {
//==============================================================================
class XsData {
private:
void _scatter_from_hdf5(const hid_t xsdata_grp, const int n_pol,
const int n_azi, const int energy_groups, int scatter_format,
//! \brief Reads scattering data from the HDF5 file
void
scatter_from_hdf5(const hid_t xsdata_grp, const int n_pol, const int n_azi,
const int energy_groups, int scatter_format,
const int final_scatter_format, const int order_data,
const int max_order, const int legendre_to_tabular_points);
void _fissionable_from_hdf5(const hid_t xsdata_grp, const int n_pol,
const int n_azi, const int energy_groups, const int delayed_groups,
//! \brief Reads fission data from the HDF5 file
void
fission_from_hdf5(const hid_t xsdata_grp, const int n_pol, const int n_azi,
const int energy_groups, const int delayed_groups,
const bool is_isotropic);
public:
// The following quantities have the following dimensions:
// [angle][incoming group]
double_2dvec total;
@ -58,17 +66,60 @@ class XsData {
std::vector<ScattData*> scatter;
XsData() = default;
//! \brief Constructs the XsData object metadata.
//!
//! @param num_groups Number of energy groups.
//! @param num_delayed_groups Number of delayed groups.
//! @param fissionable Is this a fissionable data set or not.
//! @param scatter_format The scattering representation of the file.
//! @param n_pol Number of polar angles.
//! @param n_azi Number of azimuthal angles.
XsData(const int num_groups, const int num_delayed_groups,
const bool fissionable, const int scatter_format, const int n_pol,
const int n_azi);
void from_hdf5(const hid_t xsdata_grp, const bool fissionable,
const int scatter_format, const int final_scatter_format,
const int order_data, const int max_order,
const int legendre_to_tabular_points,
const bool is_isotropic, const int n_pol, const int n_azi);
void combine(const std::vector<XsData*>& those_xs,
const double_1dvec& scalars);
bool equiv(const XsData& that);
//! \brief Loads the XsData object from the HDF5 file
//!
//! @param xs_id HDF5 group id for the cross section data.
//! @param fissionable Is this a fissionable data set or not.
//! @param scatter_format The scattering representation of the file.
//! @param final_scatter_format The scattering representation after reading;
//! this is different from scatter_format if converting a Legendre to
//! a tabular representation.
//! @param order_data The dimensionality of the scattering data in the file.
//! @param max_order Maximum order requested by the user;
//! this is only used for Legendre scattering.
//! @param legendre_to_tabular Flag to denote if any Legendre provided
//! should be converted to a Tabular representation.
//! @param legendre_to_tabular_points If a conversion is requested, this
//! provides the number of points to use in the tabular representation.
//! @param is_isotropic Is this an isotropic or angular with respect to
//! the incoming particle.
//! @param n_pol Number of polar angles.
//! @param n_azi Number of azimuthal angles.
void
from_hdf5(const hid_t xsdata_grp, const bool fissionable,
const int scatter_format, const int final_scatter_format,
const int order_data, const int max_order,
const int legendre_to_tabular_points, const bool is_isotropic,
const int n_pol, const int n_azi);
//! \brief Combines the microscopic data to a macroscopic object.
//!
//! @param micros Microscopic objects to combine.
//! @param scalars Scalars to multiply the microscopic data by.
void
combine(const std::vector<XsData*>& those_xs, const double_1dvec& scalars);
//! \brief Checks to see if this and that are able to be combined
//!
//! This comparison is used when building macroscopic cross sections
//! from microscopic cross sections.
//! @param that The other XsData to compare to this one.
//! @return True if they can be combined.
bool
equiv(const XsData& that);
};