Address @paulromano comments on #1186

This commit is contained in:
amandalund 2019-03-05 09:05:09 -06:00
parent 49832db80b
commit 9e8e5a08b5
3 changed files with 16 additions and 18 deletions

View file

@ -95,7 +95,7 @@ public:
std::unique_ptr<Bremsstrahlung> 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<double>& f, std::vector<double>&
e_b_sq, double e_p_sq, double n_conduction, double log_I, double tol, int
max_iter);
double sternheimer_adjustment(const std::vector<double>& f, const
std::vector<double>& 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<double>& f, std::vector<double>& 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<double>& f, const std::vector<double>&
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();

View file

@ -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<double>& f, std::vector<double>&
e_b_sq, double e_p_sq, double n_conduction, double log_I, double tol, int
max_iter)
double sternheimer_adjustment(const std::vector<double>& f, const
std::vector<double>& 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<double>& f, std::vector<double>&
return rho;
}
double density_effect(std::vector<double>& f, std::vector<double>& 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<double>& f, const std::vector<double>&
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();

View file

@ -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