diff options
author | miguel <miguel@f75ba9e5-694f-0410-ac2c-87ea7ce7132b> | 2001-03-29 16:02:03 +0000 |
---|---|---|
committer | miguel <miguel@f75ba9e5-694f-0410-ac2c-87ea7ce7132b> | 2001-03-29 16:02:03 +0000 |
commit | 081df995153f249fc86c04972692d43b2f7450dd (patch) | |
tree | b98e9ca18a5bbdddae4a37e6d6c2767ace87210a /src/findboundary.F90 | |
parent | 60fbb40f73b2b7393881cd557aa7deffc59120fe (diff) |
Removed the original file that handled extrapolation directly.
There are now three files for three purposes:
findboundary takes a mask with only 0s and 1s and marks the boundary
with 0.5s.
findnormals takes a mask where the boundary has been marked and
returns the normal directions to the mask for these locations.
extrapolate takes a mask the normals and extrapolates a grid function.
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/LegoExcision/trunk@6 f75ba9e5-694f-0410-ac2c-87ea7ce7132b
Diffstat (limited to 'src/findboundary.F90')
-rw-r--r-- | src/findboundary.F90 | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/findboundary.F90 b/src/findboundary.F90 new file mode 100644 index 0000000..1e16e97 --- /dev/null +++ b/src/findboundary.F90 @@ -0,0 +1,57 @@ +! $Header$ + +! Take a mask that contains only the values 0 and 1. +! Return a mask where the outermost 0s have been replaced by 0.5s. + +#include "cctk.h" +#include "cctk_Parameters.h" + +#include "maskvalues.h" + +subroutine excision_findboundary (ierr, cctkgh, mask, ni, nj, nk) + + implicit none + + DECLARE_CCTK_FUNCTIONS + DECLARE_CCTK_PARAMETERS + + ! Arguments + + ! out: zero for success, nonzero for error + integer :: ierr + + ! in: pointer to Cactus GH + CCTK_POINTER :: cctkgh + + ! in: array sizes for grid functions + ! (you can pass in cctk_lsh(:) for these) + integer :: ni,nj,nk + + ! inout: mask + CCTK_REAL :: mask(ni,nj,nk) + + integer i,j,k + integer ii,jj,kk + logical bnd + + do k=2,nk-1 + do j=2,nj-1 + do i=2,ni-1 + if (mask(i,j,k)==MASK_EXCISED) then + bnd = .false. + do kk=k-1,k+1 + do jj=j-1,j+1 + do ii=i-1,i+1 + bnd = bnd .or. mask(i,j,k)/=MASK_EXCISED + end do + end do + end do + if (bnd) mask(i,j,k) = MASK_BOUNDARY + end if + end do + end do + end do + + ierr = 0 + +end subroutine excision_findboundary |