diff options
Diffstat (limited to 'src/fixedsphere.F90')
-rw-r--r-- | src/fixedsphere.F90 | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/fixedsphere.F90 b/src/fixedsphere.F90 index 7d2294d..dafca7d 100644 --- a/src/fixedsphere.F90 +++ b/src/fixedsphere.F90 @@ -2,7 +2,6 @@ #include "cctk.h" #include "cctk_Parameters.h" #include "cctk_Arguments.h" - #include "cctk_Functions.h" subroutine Lego_FixedSphere(CCTK_ARGUMENTS) @@ -12,20 +11,30 @@ subroutine Lego_FixedSphere(CCTK_ARGUMENTS) DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS DECLARE_CCTK_FUNCTIONS + + integer ierr + + if (CCTK_IsThornActive(CCTK_THORNSTRING) == 0) then + call CCTK_WARN (0, "The routine Lego_FixedSphere was called, but thorn " // CCTK_THORNSTRING // " is not active") + end if + + ! Only excise if there would be more than a single grid point excised + if (fixed_size < 2*minval(CCTK_DELTA_SPACE(:))) return if (CCTK_EQUALS(fixed_excision,"sphere")) then - where (r < fixed_size) + where ((x - fixed_origin_x)**2 + (y - fixed_origin_y)**2 + (z - fixed_origin_z)**2 < fixed_size**2) emask = 0.d0 elsewhere emask = 1.d0 end where else if (CCTK_EQUALS(fixed_excision,"cube")) then - where ((abs(x) < fixed_size).and.(abs(z) < fixed_size).and.& - (abs(y) < fixed_size)) + where (max(abs(x - fixed_origin_x), abs(y - fixed_origin_y), abs(z - fixed_origin_z)) < fixed_size) emask = 0.d0 elsewhere emask = 1.d0 end where end if + call excision_findboundary (ierr, emask, cctk_lsh(1), cctk_lsh(2), cctk_lsh(3)) + end subroutine Lego_FixedSphere |