Add normalize_density, set_density, set_densities on C++ side

This commit is contained in:
Paul Romano 2019-01-22 16:11:39 -06:00
parent 06c5431f2c
commit fe9f774d31
6 changed files with 191 additions and 453 deletions

View file

@ -48,12 +48,16 @@ public:
// Methods
void calculate_xs(const Particle& p) const;
//! Initialize bremsstrahlung data
void init_bremsstrahlung();
//! Initialize thermal scattering mapping
//! Assign thermal scattering tables to specific nuclides within the material
//! so the code knows when to apply bound thermal scattering data
void init_thermal();
//! Finalize the material, assigning tables, normalize density, etc.
void finalize();
//! Set total density of the material
int set_density(double density, std::string units);
// Data
int32_t id_; //!< Unique ID
std::string name_; //!< Name of material
@ -61,6 +65,7 @@ public:
std::vector<int> element_; //!< Indices in elements vector
xt::xtensor<double, 1> atom_density_; //!< Nuclide atom density in [atom/b-cm]
double density_; //!< Total atom density in [atom/b-cm]
double density_gpcc_; //!< Total atom density in [g/cm^3]
double volume_ {-1.0}; //!< Volume in [cm^3]
bool fissionable_ {false}; //!< Does this material contain fissionable nuclides
bool depletable_ {false}; //!< Is the material depletable?
@ -78,6 +83,12 @@ public:
std::unique_ptr<Bremsstrahlung> ttb_;
private:
//! Initialize bremsstrahlung data
void init_bremsstrahlung();
//! Normalize density
void normalize_density();
void calculate_neutron_xs(const Particle& p) const;
void calculate_photon_xs(const Particle& p) const;
};

View file

@ -30,7 +30,7 @@ extern "C" double keff_std; //!< standard deviation of average k
extern "C" double k_col_abs; //!< sum over batches of k_collision * k_absorption
extern "C" double k_col_tra; //!< sum over batches of k_collision * k_tracklength
extern "C" double k_abs_tra; //!< sum over batches of k_absorption * k_tracklength
extern "C" double log_spacing; //!< lethargy spacing for energy grid searches
extern double log_spacing; //!< lethargy spacing for energy grid searches
extern "C" int n_lost_particles; //!< cumulative number of lost particles
extern "C" bool need_depletion_rx; //!< need to calculate depletion rx?
extern "C" int restart_batch; //!< batch at which a restart job resumed