diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/puncture_tracker.c | 42 |
1 files changed, 42 insertions, 0 deletions
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]; + } + + } + + } + + } + } |