Skip to content

Commit

Permalink
added some extra commentary in the code to help explain what was chan…
Browse files Browse the repository at this point in the history
…ged in the inner functions with the new nuclide grid mode
  • Loading branch information
jtramm committed Aug 21, 2017
1 parent bccbb1d commit 4a9fa18
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/CalculateXS.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ void calculate_micro_xs( double p_energy, int nuc, long n_isotopes,
double f;
NuclideGridPoint * low, * high;

// If using only the nuclide grid, we must perform a binary search
// to find the energy location in this particular nuclide's grid.
if( grid_type == NUCLIDE )
{
// Perform binary search on the Nuclide Grid to find the index
Expand All @@ -23,7 +25,7 @@ void calculate_micro_xs( double p_energy, int nuc, long n_isotopes,
else
low = &nuclide_grids[nuc][idx];
}
else
else // Unionized Energy Grid - we already know the index, no binary search needed.
{
// pull ptr from energy grid and check to ensure that
// we're not reading off the end of the nuclide's grid
Expand Down Expand Up @@ -83,7 +85,11 @@ void calculate_macro_xs( double p_energy, int mat, long n_isotopes,
for( int k = 0; k < 5; k++ )
macro_xs_vector[k] = 0;

// binary search for energy on unionized energy grid (UEG)
// If we are using the unionized energy grid (UEG), we only
// need to perform 1 binary search per macroscopic lookup.
// If we are using the nuclide grid search, it will have to be
// done inside of the "calculate_micro_xs" function for each different
// nuclide in the material.
if( grid_type == UNIONIZED )
idx = grid_search( n_isotopes * n_gridpoints, p_energy,
energy_grid);
Expand Down

0 comments on commit 4a9fa18

Please sign in to comment.