diff options
author | schnetter <schnetter@f75ba9e5-694f-0410-ac2c-87ea7ce7132b> | 2004-02-14 15:04:53 +0000 |
---|---|---|
committer | schnetter <schnetter@f75ba9e5-694f-0410-ac2c-87ea7ce7132b> | 2004-02-14 15:04:53 +0000 |
commit | d25673061d63055b0e2eef0175c73a84fda9d328 (patch) | |
tree | c2f8c96577677293aa20ab46378de8df44dc0dac /src/fixedsphere.F90 | |
parent | ebfba39ca547292af7cb28501756fa0b1c766eeb (diff) |
Add parameters to set the origin of the excision region for "fixed
excision".
When checking for (real-valued) mask values, do not check for
equality, but instead allow for a fudge factor.
Check that the thorn is activated when any of its routines are called.
When there is only a single point excised, do not abort with an
internal error, but pretend the normal extends into the x direction.
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/LegoExcision/trunk@42 f75ba9e5-694f-0410-ac2c-87ea7ce7132b
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 |