Skip to content

Commit

Permalink
Update gammapkt.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Mar 1, 2024
1 parent ddaec6a commit 633bd5f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gammapkt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,12 @@ static auto get_chi_photo_electric_rf(const struct packet *pkt_ptr) -> double {
// Start by working out the x-section in the co-moving frame.

const int mgi = grid::get_cell_modelgridindex(pkt_ptr->where);

if (mgi >= grid::get_npts_model()) {
// empty cell
return 0.;
}

const double rho = grid::get_rho(mgi);

if (globals::gamma_kappagrey < 0) {
Expand Down Expand Up @@ -602,9 +608,6 @@ static auto get_chi_photo_electric_rf(const struct packet *pkt_ptr) -> double {
} else {
const double hnu_over_1MeV = pkt_ptr->nu_cmf / 2.41326e+20;
const double log10_hnu_over_1MeV = log10(hnu_over_1MeV);
assert_testmodeonly(mgi >= 0);
assert_testmodeonly(mgi < grid::get_npts_model());
assert_testmodeonly(grid::get_numassociatedcells(mgi) > 0);
for (int i = 0; i < get_nelements(); i++) {
// determine charge number:
int Z = get_atomicnumber(i);
Expand Down

0 comments on commit 633bd5f

Please sign in to comment.