[Commits] [svn:einsteintoolkit] incoming/PITTNullCode/SphericalHarmonicReconGen/ (Rev. 87)

reisswig at tapir.caltech.edu reisswig at tapir.caltech.edu
Thu Jun 20 06:19:22 CDT 2013


User: reisswig
Date: 2013/06/20 06:19 AM

Modified:
 /PITTNullCode/SphericalHarmonicReconGen/
  param.ccl
 /PITTNullCode/SphericalHarmonicReconGen/src/
  read.cc

Log:
 SphericalHarmonicReconGen: Allow for an initial relaxation time.

File Changes:

Directory: /PITTNullCode/SphericalHarmonicReconGen/
===================================================

File [modified]: param.ccl
Delta lines: +5 -0
===================================================================
--- PITTNullCode/SphericalHarmonicReconGen/param.ccl	2013-06-06 17:45:00 UTC (rev 86)
+++ PITTNullCode/SphericalHarmonicReconGen/param.ccl	2013-06-20 11:19:22 UTC (rev 87)
@@ -44,7 +44,12 @@
   *:* :: "anything"
 } 0.0
 
+REAL initial_relaxation_time "A time intervall for which we just use the initial set of metric data in order to relax the characteristic slice towards our initial data"
+{
+  0:* :: "A psoitive timescale"
+} 0.0
 
+
 BOOLEAN verbose "turn verbosity on/off"
 {
 } no

Directory: /PITTNullCode/SphericalHarmonicReconGen/src/
=======================================================

File [modified]: read.cc
Delta lines: +9 -7
===================================================================
--- PITTNullCode/SphericalHarmonicReconGen/src/read.cc	2013-06-06 17:45:00 UTC (rev 86)
+++ PITTNullCode/SphericalHarmonicReconGen/src/read.cc	2013-06-20 11:19:22 UTC (rev 87)
@@ -119,9 +119,11 @@
 	 
 	 it_off += SHR::starting_iteration;
 	 
+	 const int my_iteration = cctk_iteration - (cctk_time < initial_relaxation_time ? cctk_iteration : initial_relaxation_time / CCTK_DELTA_TIME);
+	 
 	 //if ((cctk_iteration == 0 && static_components) || cctk_iteration == 0 || cctk_time >= initial_relaxation_time)
 	 {
-	    if (cctk_iteration == 0 || cctk_iteration*CCTK_DELTA_TIME >= SHR::iteration_in_file*SHR::db[0]->delta_t())
+	    if (my_iteration == 0 || my_iteration*CCTK_DELTA_TIME >= SHR::iteration_in_file*SHR::db[0]->delta_t())
 	    {
 	       if (verbose)
 	          CCTK_INFO("Cycling timesteps...");
@@ -138,20 +140,20 @@
 	          CCTK_INFO("Loading decomposed variables for current timestep...");
 	       
 	       for (int i=0; i < 3*NUM_METRIC_COMPONENTS; ++i) {
-		  if ((cctk_iteration+it_off) >= SHR::db[i]->n_timesteps())
+		  if ((my_iteration+it_off) >= SHR::db[i]->n_timesteps())
 		     CCTK_WARN(0, "The input file does not contain more iterations. Stopping.");
 	       }
 	       
 	       // we always read n timesteps ahead (timelevel==0 corresponds to cctk_iteration+it_off) because we need it for time-derivatives!
 	       for (int i=0; i < NUM_METRIC_COMPONENTS; ++i) {
-		  SHR::C[i]->set_modes_from_file(0, (cctk_iteration+it_off));
-		  SHR::Cr[i]->set_modes_from_file(0, (cctk_iteration+it_off));
+		  SHR::C[i]->set_modes_from_file(0, (my_iteration+it_off));
+		  SHR::Cr[i]->set_modes_from_file(0, (my_iteration+it_off));
 		  if (time_derivative_in_file)
-		     SHR::Ct[i]->set_modes_from_file(0, (cctk_iteration+it_off));
+		     SHR::Ct[i]->set_modes_from_file(0, (my_iteration+it_off));
 	       }
 	       
-	       SHR::iteration_in_file += 1;
-	       
+	       if (initial_relaxation_time < cctk_time)
+	          SHR::iteration_in_file += 1;
 	    }
 	 }
 	 



More information about the Commits mailing list