Skip to content

Commit

Permalink
added density floor for levden array in macro_pops; see #425 and #438
Browse files Browse the repository at this point in the history
  • Loading branch information
jhmatthews committed Nov 22, 2018
1 parent 2fb29e6 commit 0a05836
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/macro_gov.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,8 @@ macro_pops (xplasma, xne)
index_lvl++)
{
/* JM Nov 18 -- if statement to prevent nan in fractional populations */
if (this_ion_density == 0.0)
xplasma->levden[config[index_lvl].nden] = 0.0;
if (this_ion_density <= DENSITY_MIN || populations[conf_to_matrix[index_lvl]] <= DENSITY_MIN)
xplasma->levden[config[index_lvl].nden] = DENSITY_MIN;
else
xplasma->levden[config[index_lvl].nden] = populations[conf_to_matrix[index_lvl]] / this_ion_density;
}
Expand Down

0 comments on commit 0a05836

Please sign in to comment.