aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiener <diener@2a26948c-0e4f-0410-aee8-f1d3e353619c>2004-03-03 16:43:25 +0000
committerdiener <diener@2a26948c-0e4f-0410-aee8-f1d3e353619c>2004-03-03 16:43:25 +0000
commit564c15048d03894c2dd2315c54cebeb07ebf70be (patch)
tree73844ef28b7d9836867bdbedc2e4e72daec65232
parentcc166f4d2e715bdfdef04e217602a18acdbef1ae (diff)
Added a cheat parameter to enable the reuse of the final data set for a
number of iterations before starting the real backwards evolution of the level set function. If everything is stationary this should be okay. If it is only approximately stationary, the evolution of the level set function is dubious but the trial surfaces might get closer to the real event horizon. Testing is definitely necessary. Don't use it unless you really know what you are doing. The implementation is also slightly dubious, since I modify cctk_iteration to start out with negative iteration numbers. There might be a more elegant way of doing this. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/EHFinder/trunk@167 2a26948c-0e4f-0410-aee8-f1d3e353619c
-rw-r--r--param.ccl9
-rw-r--r--src/EHFinder_Init.F9014
-rw-r--r--src/EHFinder_ReadData.F9032
3 files changed, 39 insertions, 16 deletions
diff --git a/param.ccl b/param.ccl
index 0007865..7c2a3b2 100644
--- a/param.ccl
+++ b/param.ccl
@@ -30,6 +30,15 @@ BOOLEAN read_conformal_factor_once "Should the conformal factor only be read onc
{
} "yes"
+BOOLEAN cheat "Should we cheat and evolve using the last data set for a while?"
+{
+} "no"
+
+CCTK_INT cheat_iterations "For how many iterations should we cheat"
+{
+0:* :: "Positive please"
+} 0
+
KEYWORD initial_f[10] "Initial surface choice"
{
"sphere" :: "spherical surface"
diff --git a/src/EHFinder_Init.F90 b/src/EHFinder_Init.F90
index d9aa13e..478839f 100644
--- a/src/EHFinder_Init.F90
+++ b/src/EHFinder_Init.F90
@@ -36,9 +36,17 @@ subroutine EHFinder_Init_F(CCTK_ARGUMENTS)
! chosen to be consistent with the run producing the numerical data.
! F.ex. if dt was 0.1 but the data was only stored every 4 iterations, the
! parameters should be chosen so that dt now is 0.4.
- last_time = abs(cctk_delta_time) * last_iteration_number / &
- saved_iteration_every
-
+ last_time = abs(cctk_delta_time) * ( last_iteration_number + &
+ cheat_iterations ) / saved_iteration_every
+
+ if ( cheat == 1 ) then
+ last_time = abs(cctk_delta_time) * ( last_iteration_number + &
+ cheat_iterations ) / saved_iteration_every
+ cctk_iteration = -cheat_iterations
+ else
+ last_time = abs(cctk_delta_time) * last_iteration_number &
+ / saved_iteration_every
+ end if
cctk_time = last_time
! Allocate the logical array containing the flag determining if the
diff --git a/src/EHFinder_ReadData.F90 b/src/EHFinder_ReadData.F90
index 23357d7..89067d5 100644
--- a/src/EHFinder_ReadData.F90
+++ b/src/EHFinder_ReadData.F90
@@ -26,8 +26,9 @@ subroutine EHFinder_Read_Metric(CCTK_ARGUMENTS)
! last_iteration_number (the last iteration in the numerical evolution
! producing the metric) and saved_iteration_every (how often was the metric
! saved) and the current iteration and save it in a string variable.
- write(iteration_string,'(i10)') last_iteration_number - &
- saved_iteration_every * cctk_iteration
+ i = min ( last_iteration_number - saved_iteration_every * cctk_iteration, &
+ last_iteration_number )
+ write(iteration_string,'(i10)') i
! Trim the string variable.
iteration_string = adjustl(iteration_string)
@@ -76,14 +77,15 @@ subroutine EHFinder_Read_Lapse(CCTK_ARGUMENTS)
character(len=128) :: in_files, in_vars
character(len=10) :: iteration_string
- CCTK_INT :: nc, res
+ CCTK_INT :: i, nc, res
! Figure out which iteration number to read, based on the parameters
! last_iteration_number (the last iteration in the numerical evolution
! producing the metric) and saved_iteration_every (how often was the lapse
! saved) and the current iteration and save it in a string variable.
- write(iteration_string,'(i10)') last_iteration_number - &
- saved_iteration_every * cctk_iteration
+ i = min ( last_iteration_number - saved_iteration_every * cctk_iteration, &
+ last_iteration_number )
+ write(iteration_string,'(i10)') i
! Trim the string variable.
iteration_string = adjustl(iteration_string)
@@ -125,8 +127,10 @@ subroutine EHFinder_Read_Shift(CCTK_ARGUMENTS)
! last_iteration_number (the last iteration in the numerical evolution
! producing the metric) and saved_iteration_every (how often was the metric
! saved) and the current iteration and save it in a string variable.
- write(iteration_string,'(i10)') last_iteration_number - &
- saved_iteration_every * cctk_iteration
+ i = min ( last_iteration_number - saved_iteration_every * cctk_iteration, &
+ last_iteration_number )
+ write(iteration_string,'(i10)') i
+
! Trim the string variable.
iteration_string = adjustl(iteration_string)
nc = len_trim(iteration_string)
@@ -171,7 +175,7 @@ subroutine EHFinder_Read_Conformal(CCTK_ARGUMENTS)
character(len=128) :: in_files, in_vars
character(len=10) :: iteration_string
- CCTK_INT :: nc, res
+ CCTK_INT :: i, nc, res
! Figure out which iteration number to read, based on the parameters
! last_iteration_number (the last iteration in the numerical evolution
@@ -182,8 +186,9 @@ subroutine EHFinder_Read_Conformal(CCTK_ARGUMENTS)
if ( read_conformal_factor_once .gt. 0 ) then
write(iteration_string,'(i10)') 0
else
- write(iteration_string,'(i10)') last_iteration_number - &
- saved_iteration_every * cctk_iteration
+ i = min ( last_iteration_number - saved_iteration_every * cctk_iteration, &
+ last_iteration_number )
+ write(iteration_string,'(i10)') i
end if
! Trim the string variable.
@@ -219,14 +224,15 @@ subroutine EHFinder_Read_Mask(CCTK_ARGUMENTS)
character(len=128) :: in_files, in_vars
character(len=10) :: iteration_string
- CCTK_INT :: nc, res
+ CCTK_INT :: i, nc, res
! Figure out which iteration number to read, based on the parameters
! last_iteration_number (the last iteration in the numerical evolution
! producing the metric) and saved_iteration_every (how often was the metric
! saved) and the current iteration and save it in a string variable.
- write(iteration_string,'(i10)') last_iteration_number - &
- saved_iteration_every * cctk_iteration
+ i = min ( last_iteration_number - saved_iteration_every * cctk_iteration, &
+ last_iteration_number )
+ write(iteration_string,'(i10)') i
! Trim the string variable.
iteration_string = adjustl(iteration_string)