[Commits] [svn:einsteintoolkit] incoming/PITTNullCode/SphericalHarmonicReconGen/ (Rev. 103)
bela at caltech.edu
bela at caltech.edu
Fri Nov 22 13:43:28 CST 2013
User: szilagyi
Date: 2013/11/22 01:43 PM
Modified:
/PITTNullCode/SphericalHarmonicReconGen/
param.ccl
/PITTNullCode/SphericalHarmonicReconGen/src/
read.cc, startup.cc
Log:
allow for not setting a time-offset automatically
File Changes:
Directory: /PITTNullCode/SphericalHarmonicReconGen/
===================================================
File [modified]: param.ccl
Delta lines: +4 -0
===================================================================
--- PITTNullCode/SphericalHarmonicReconGen/param.ccl 2013-11-12 20:08:47 UTC (rev 102)
+++ PITTNullCode/SphericalHarmonicReconGen/param.ccl 2013-11-22 19:43:28 UTC (rev 103)
@@ -12,6 +12,10 @@
SpEC-H5-v2 :: "SpEC-HDF5 format (v2): Data is stored in HDF5 files grouped according to new SpEC output."
} "ASCII"
+BOOLEAN disable_auto_time_offset "Should the automatically determined time-offset be diabled?"
+{
+} no
+
CCTK_INT sphere_number "the sphere number (if multiple spheres are present in one file) that corresponds to the worldtube radius NullSHRExtract::cr"
{
0:* :: "positive"
Directory: /PITTNullCode/SphericalHarmonicReconGen/src/
=======================================================
File [modified]: read.cc
Delta lines: +15 -9
===================================================================
--- PITTNullCode/SphericalHarmonicReconGen/src/read.cc 2013-11-12 20:08:47 UTC (rev 102)
+++ PITTNullCode/SphericalHarmonicReconGen/src/read.cc 2013-11-22 19:43:28 UTC (rev 103)
@@ -24,20 +24,21 @@
extern "C"
{
- void load_modes(const CCTK_REAL time, const bool time_derivative_in_file)
+ void load_modes(const CCTK_REAL time, const bool time_derivative_in_file, const bool allow_offcentered_time_stencils)
{
// identify iteration which corresponds to the time just before the target time "time"
- const int iteration = SHR::C[0]->get_iteration(time + SHR::initial_time_in_file);
+ int iteration = SHR::C[0]->get_iteration(time + SHR::initial_time_in_file);
//cout << "Target-Time = " << time + SHR::initial_time_in_file << ". Iteration (time) just before target time: " << iteration << " (" << SHR::db[0]->time(iteration) << ")" << endl;
if (iteration < 0) {
- cout << "Error: iteration = -1" << endl;
+ cout << "Error: iteration = -1. time = "<<time << ", SHR::initial_time_in_file="<<SHR::initial_time_in_file << endl;
assert(iteration >= 0);
}
-
+
if (iteration < 2) {
- cout << "Error: there are not enough iterations before interpolation target time to do the interpolation!" << endl;
+ if(allow_offcentered_time_stencils) iteration=2;
+ else cout << "Error: there are not enough iterations before interpolation target time to do the interpolation!" << endl;
assert(iteration >= 2);
}
@@ -175,7 +176,12 @@
initial_time+cctk_time,
initial_time+cctk_time+cctk_delta_time,
initial_time+cctk_time+2*cctk_delta_time };
-
+
+ // If the automatically computed time-offset is disabled,
+ // we allow for off-centered stencils at the beginning.
+ // so that, when the data in the file starts at t=t0,
+ // the evolution can also start at t=t0, implying off-centered
+ // time-stencils very early in the run.
if (!time_derivative_in_file)
{
// interpolate coefficients to all stencil points given by u[...]
@@ -183,14 +189,14 @@
if (time_fd_order == 2)
for (int i=0; i < 3; ++i)
{
- load_modes(u[i], false);
+ load_modes(u[i], false, disable_auto_time_offset);
interpolate(u[i], 2-i, false);
}
if (time_fd_order == 4)
for (int i=0; i < 5; ++i)
{
- load_modes(u[i], false);
+ load_modes(u[i], false, disable_auto_time_offset);
interpolate(u[i], 4-i, false);
}
@@ -200,7 +206,7 @@
// just time interpolate coefficients to u[2]
// load all modes centered around time u[2] to internal "coeff_in_file" array...
- load_modes(u[2], true);
+ load_modes(u[2], true, disable_auto_time_offset);
// ...and use these coeffs to setup internal interpolated coeffs "coeff"
// and copy obtained value to timelevel 0
File [modified]: startup.cc
Delta lines: +4 -3
===================================================================
--- PITTNullCode/SphericalHarmonicReconGen/src/startup.cc 2013-11-12 20:08:47 UTC (rev 102)
+++ PITTNullCode/SphericalHarmonicReconGen/src/startup.cc 2013-11-22 19:43:28 UTC (rev 103)
@@ -196,15 +196,16 @@
if (time_interpolate)
{
n_timelevels_for_coeffs_in_file = 6; // 6 for 5th-order interpolation
-
- SHR::initial_time_in_file = SHR::db[0]->time(timelevel+2);
+ if(disable_auto_time_offset==0)
+ SHR::initial_time_in_file = SHR::db[0]->time(timelevel+2);
ostringstream s;
s << "Initial nominal time found in file is t_0 = " << SHR::initial_time_in_file << " corresponding to timestep n = " << timelevel+2 << " (counting from 0).";
CCTK_INFO(s.str().c_str());
}
else
{
- SHR::initial_time_in_file = SHR::db[0]->time(timelevel);
+ if(disable_auto_time_offset==0)
+ SHR::initial_time_in_file = SHR::db[0]->time(timelevel);
ostringstream s;
s << "Initial nominal time found in file is t_0 = " << SHR::initial_time_in_file << " corresponding to timestep n = " << timelevel << " (counting from 0).";
CCTK_INFO(s.str().c_str());
More information about the Commits
mailing list