Skip to content

Commit

Permalink
Another small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgrote committed Jan 13, 2025
1 parent 0808815 commit 21eaf31
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,12 @@ public:
}
}

amrex::ParticleReal const f_i = kdsigdk_im1/koT1_grid_im1;
amrex::ParticleReal const f_ip1 = kdsigdk_i/m_koT1_grid[i];
amrex::ParticleReal const result = ((std::sqrt(f_i*f_i + 2._prt*(f_ip1 - f_i)*(random_number*sigma_total - sigma)/dk)
- f_i)/(f_ip1 - f_i))*dk + koT1_grid_im1;
// k will be between k_im1 and k_i
amrex::ParticleReal const f_im1 = kdsigdk_im1/koT1_grid_im1;
amrex::ParticleReal const fi = kdsigdk_i/m_koT1_grid[i];
amrex::ParticleReal const x = (std::sqrt(f_im1*f_im1 + 2._prt*(fi - f_im1)*(random_number*sigma_total - sigma)/dk)
- f_im1)/(fi - f_im1);
amrex::ParticleReal const result = x*dk + koT1_grid_im1;

return result;
}
Expand Down

0 comments on commit 21eaf31

Please sign in to comment.