From a002c5b06022bfe7d0add2a0f47ccfdfe8539c03 Mon Sep 17 00:00:00 2001 From: shriwise Date: Tue, 29 May 2018 00:36:29 -0500 Subject: [PATCH] Adding ifdefs to keep stable CAD-free build. --- src/geometry.F90 | 21 +++++++++++++++++++-- src/tracking.F90 | 5 ++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/geometry.F90 b/src/geometry.F90 index b6212d73ab..f83bd902ed 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -56,6 +56,8 @@ module geometry subroutine neighbor_lists() bind(C) end subroutine neighbor_lists +#ifdef CAD + function next_cell_c(current_cell, surface_crossed) & bind(C, name="next_cell") result(new_cell) import C_PTR, C_INT32_T @@ -63,17 +65,30 @@ module geometry type(C_PTR), intent(in), value :: surface_crossed integer(C_INT32_T) :: new_cell end function next_cell_c - + function is_implicit_complement_C(cell) & bind(C, name="is_implicit_complement") result(res) import C_PTR, C_BOOL type(C_PTR), intent(in), value :: cell logical(C_BOOL) :: res end function is_implicit_complement_C - end interface +#endif + + end interface + contains + function cell_contains(c, p) result(in_cell) + type(Cell), intent(in) :: c + type(Particle), intent(in) :: p + logical :: in_cell + in_cell = cell_contains_c(c%ptr, p%coord(p%n_coord)%xyz, & + p%coord(p%n_coord)%uvw, p%surface) + end function cell_contains + +#ifdef CAD + function next_cell(c, s) result(new_cell) type(Cell), intent(in) :: c type(Surface), intent(in) :: s @@ -86,6 +101,8 @@ contains logical:: res res = is_implicit_complement_c(c%ptr) end function is_implicit_complement + +#endif !=============================================================================== ! FIND_CELL determines what cell a source particle is in within a particular diff --git a/src/tracking.F90 b/src/tracking.F90 index 67c76f1837..487ab4372a 100644 --- a/src/tracking.F90 +++ b/src/tracking.F90 @@ -6,7 +6,10 @@ module tracking use error, only: warning, write_message use geometry_header, only: cells use geometry, only: find_cell, distance_to_boundary, cross_lattice,& - check_cell_overlap, next_cell, is_implicit_complement + check_cell_overlap +#ifdef CAD + use geometry, only: next_cell, is_implicit_complement +#endif use material_header, only: materials, Material use message_passing use mgxs_interface