diff --git a/include/openmc/material.h b/include/openmc/material.h index 3497d0f387..6a3461e0b1 100644 --- a/include/openmc/material.h +++ b/include/openmc/material.h @@ -95,7 +95,7 @@ public: std::unique_ptr ttb_; private: - //! Calculate density effect correction + //! Calculate the collision stopping power void collision_stopping_power(double* s_col, bool positron); //! Initialize bremsstrahlung data @@ -113,14 +113,14 @@ private: //============================================================================== //! Calculate Sternheimer adjustment factor -double sternheimer_adjustment(std::vector& f, std::vector& - e_b_sq, double e_p_sq, double n_conduction, double log_I, double tol, int - max_iter); +double sternheimer_adjustment(const std::vector& f, const + std::vector& e_b_sq, double e_p_sq, double n_conduction, double + log_I, double tol, int max_iter); //! Calculate density effect correction -double density_effect(std::vector& f, std::vector& e_b_sq, - double e_p_sq, double n_conduction, double rho, double E, double tol, int - max_iter); +double density_effect(const std::vector& f, const std::vector& + e_b_sq, double e_p_sq, double n_conduction, double rho, double E, double tol, + int max_iter); //! Read material data from materials.xml void read_materials_xml(); diff --git a/src/material.cpp b/src/material.cpp index 277a568ea5..7b000db7d2 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -573,7 +573,7 @@ void Material::init_bremsstrahlung() double sum_density = 0.0; // Get the collision stopping power of the material - this->collision_stopping_power(&stopping_power_collision(0), positron); + this->collision_stopping_power(stopping_power_collision.data(), positron); // Calculate the molecular DCS and the molecular radiative stopping power using // Bragg's additivity rule. @@ -948,9 +948,9 @@ void Material::to_hdf5(hid_t group) const // Non-method functions //============================================================================== -double sternheimer_adjustment(std::vector& f, std::vector& - e_b_sq, double e_p_sq, double n_conduction, double log_I, double tol, int - max_iter) +double sternheimer_adjustment(const std::vector& f, const + std::vector& e_b_sq, double e_p_sq, double n_conduction, double + log_I, double tol, int max_iter) { // Get the total number of oscillators int n = f.size(); @@ -993,9 +993,9 @@ double sternheimer_adjustment(std::vector& f, std::vector& return rho; } -double density_effect(std::vector& f, std::vector& e_b_sq, - double e_p_sq, double n_conduction, double rho, double E, double tol, int - max_iter) +double density_effect(const std::vector& f, const std::vector& + e_b_sq, double e_p_sq, double n_conduction, double rho, double E, double tol, + int max_iter) { // Get the total number of oscillators int n = f.size(); diff --git a/src/physics.cpp b/src/physics.cpp index 6e76200204..8a16c2ae6a 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -271,10 +271,8 @@ void sample_photon_reaction(Particle* p) if (E_electron >= settings::energy_cutoff[electron]) { double mu_electron = (alpha - alpha_out*mu) / std::sqrt(alpha*alpha + alpha_out*alpha_out - 2.0*alpha*alpha_out*mu); - double uvw[3]; - std::copy(p->coord[0].uvw, p->coord[0].uvw + 3, uvw); - rotate_angle_c(uvw, mu_electron, &phi); - p->create_secondary(uvw, E_electron, electron, true); + Direction u = rotate_angle(p->u(), mu_electron, &phi); + p->create_secondary(u, E_electron, Particle::Type::electron, true); } // TODO: Compton subshell data does not match atomic relaxation data