Replacing the next_cell call in tracking. Moving it to geometry.cpp was a mistake.

This commit is contained in:
shriwise 2018-09-06 16:01:11 -05:00 committed by pshriwise
parent 146d700222
commit 7b453312c3
2 changed files with 16 additions and 20 deletions

View file

@ -55,26 +55,6 @@ find_cell(Particle* p, int search_surf) {
for (int i = p->n_coord; i < MAX_COORD; i++) {
p->coord[i].reset();
}
#ifdef CAD
// if (dagmc) then
// i_cell = next_cell(cells(p % last_cell(1)), surfaces(ABS(p % surface)))
// p % last_material = p % material
// p % last_sqrtKT = p % sqrtKT
// p % coord(1) % cell = i_cell
// p % cell_instance = 1
// p % material = cells(i_cell) % material(1)
// p % sqrtKT = cells(i_cell) % sqrtKT(1)
// ! Show cell information on trace
// if (verbosity >= 10 .or. trace) then
// call write_message(" Entering cell " // trim(to_str(&
// cells(i_cell) % id())))
// end if
// return
// end if
#endif
// Determine universe (if not yet set, use root universe)
int i_universe = p->coord[p->n_coord-1].universe;

View file

@ -318,6 +318,7 @@ contains
class(Surface), pointer :: surf
class(Surface), pointer :: surf2 ! periodic partner surface
i_surface = abs(p % surface)
surf => surfaces(i_surface)
if (verbosity >= 10 .or. trace) then
@ -471,6 +472,21 @@ contains
! ==========================================================================
! SEARCH NEIGHBOR LISTS FOR NEXT CELL
#ifdef CAD
if (dagmc) then
i_cell = next_cell(cells(p % last_cell(1) + 1), surfaces(ABS(p % surface)))
! save material and temp
p % last_material = p % material
p % last_sqrtkT = p % sqrtKT
! set new cell value
p % coord(1) % cell = i_cell-1 ! decrement for C++ indexing
p % cell_instance = 1
p % material = cells(i_cell) % material(1)
p % sqrtKT = cells(i_cell) % sqrtKT(1)
return
end if
#endif
call find_cell(p, found, p % surface)
if (found) return