diff options
author | diener <diener@a2659f00-0f4f-0410-9214-a4596bbb8a4f> | 2007-10-03 15:05:34 +0000 |
---|---|---|
committer | diener <diener@a2659f00-0f4f-0410-9214-a4596bbb8a4f> | 2007-10-03 15:05:34 +0000 |
commit | 3a76c87e57fd6d7229d6e6bc527435d24e28a0ef (patch) | |
tree | e676a07aff33b3d9fb3b8b852084cc74e1ca80a5 | |
parent | 089b9bb92e880503fbbc0f96a110ab71a06b3e87 (diff) |
Add the option of changing the number of refinement levels using the distance
between two punctures. This is useful when turning off the fine(st) refinement
levels after the merger of two black holes and is independent of whether
you actually find the common horizon. Of course the distance between
punctures has to be chosen so that a common horizon is actually present when
the punctures are that close.
git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/PunctureTracker/trunk@8 a2659f00-0f4f-0410-9214-a4596bbb8a4f
-rw-r--r-- | param.ccl | 15 | ||||
-rw-r--r-- | src/puncture_tracker.c | 42 |
2 files changed, 57 insertions, 0 deletions
@@ -22,3 +22,18 @@ REAL initial_z[10] "Initial z coordinate positions of punctures" { *:* :: "" } 0.0 + +INT modify_puncture[2] "Punctures to use for modification criteria" +{ + -1:9 :: "One of the tracking punctures or negative for no modification" +} -1 + +REAL modify_distance "Modify levels when the distance is less than this" +{ + 0.0:* :: "zero or positive" +} 0.0 + +INT new_reflevel_number[2] "The new number of refinement levels" +{ + -1:* :: "Negative for no change" +} -1 diff --git a/src/puncture_tracker.c b/src/puncture_tracker.c index d3da795..341b6d4 100644 --- a/src/puncture_tracker.c +++ b/src/puncture_tracker.c @@ -263,6 +263,8 @@ PunctureTracker_SetPositions (CCTK_ARGUMENTS) DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; + CCTK_REAL dist; + for (int n = 0; n < max_num_tracked; ++ n) { if (track[n]) { @@ -282,4 +284,44 @@ PunctureTracker_SetPositions (CCTK_ARGUMENTS) } } + + if ( modify_puncture[0]>=0 && modify_puncture[0]<max_num_tracked && + modify_puncture[1]>=0 && modify_puncture[1]<max_num_tracked && + modify_puncture[0]!=modify_puncture[1] ) { + + if (track[modify_puncture[0]] && track[modify_puncture[1]]) { + + dist = sqrt ( pow ( pt_loc_x[modify_puncture[0]] + - pt_loc_x[modify_puncture[1]], 2 ) + + pow ( pt_loc_y[modify_puncture[0]] + - pt_loc_y[modify_puncture[1]], 2 ) + + pow ( pt_loc_z[modify_puncture[0]] + - pt_loc_z[modify_puncture[1]], 2 ) ); + + if ( dist < modify_distance ) { + + if ( new_reflevel_number[0] > -1 ) { + if (verbose) { + CCTK_VInfo (CCTK_THORNSTRING, + "Setting the number of refinement levels to %d for refinemenet region #%d", + new_reflevel_number[0],modify_puncture[0]); + } + num_levels[modify_puncture[0]] = new_reflevel_number[0]; + } + + if ( new_reflevel_number[1] > -1 ) { + if (verbose) { + CCTK_VInfo (CCTK_THORNSTRING, + "Setting the number of refinement levels to %d for refinemenet region #%d", + new_reflevel_number[1],modify_puncture[1]); + } + num_levels[modify_puncture[1]] = new_reflevel_number[1]; + } + + } + + } + + } + } |