Skip to content

Commit

Permalink
Removed print statements for debugging of -start_stop times file opti…
Browse files Browse the repository at this point in the history
…on from monitor (ORNL-Fusion#185)
  • Loading branch information
LP-Nick committed Oct 11, 2024
1 parent ec9ace5 commit 47ca687
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions xolotl/solver/src/monitor/PetscMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,8 @@ PetscMonitor::startStop(TS ts, PetscInt timestep, PetscReal time, Vec solution)
//if file of times for hdf5 write is give with -start_stop option
else{
double objTime;
std::cout<<"starting time check"<<std::endl;
(h5Times.size() == 0) ? (objTime = 1e20) : (objTime = h5Times[0]); //get objective time for writing to hdf5 file
std::cout<<"objTime is: "<<objTime<<std::endl;
double objDiff = objTime - time;
std::cout<<"objDiff is: "<<objDiff<<std::endl;
if (objDiff > 0)
PetscFunctionReturn(0);

Expand Down Expand Up @@ -388,7 +385,6 @@ PetscMonitor::startStop(TS ts, PetscInt timestep, PetscReal time, Vec solution)
tsGroup.get(), speciesNames);

h5Times.erase(h5Times.begin()); //remove time from list
std::cout<<"next objTime is: "<<h5Times[0]<<std::endl;
//check if next time is also less than current time
(h5Times.size() == 0) ? (objTime = 1e20) : (objTime = h5Times[0]);
while (objTime - time < 0){
Expand Down
4 changes: 0 additions & 4 deletions xolotl/solver/src/monitor/PetscMonitor0D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,20 +259,17 @@ PetscMonitor0D::setup(int loop)
if (h5TimesFile == "holder"){
PetscCallVoid(PetscOptionsGetString(NULL, NULL, "-start_stop", cstr, 20, &flag));
if ((flag) && (h5TimesFile.find(".dat"))) {
std::cout<<"We should only be here once"<<std::endl;
// Open file h5Times.dat containing list of times to write data
std::ifstream inputFile(h5TimesFile.c_str());
std::string line;

//Read file and store values in a vector
while (getline(inputFile, line)) {
std::cout<<line<<std::endl;
if (!line.length() || line[0] == '#')
continue;
double saveTime = 0.0;
sscanf(line.c_str(), "%lf", &saveTime);
h5Times.push_back(saveTime);
std::cout<<saveTime<<std::endl;
}
_hdf5Stride = 1.0;
}
Expand All @@ -284,7 +281,6 @@ PetscMonitor0D::setup(int loop)
_hdf5Stride = 1.0;
}
}
std::cout<<"made it out of start_stop checker"<<std::endl;
// Compute the correct _hdf5Previous for a restart
// Get the last time step written in the HDF5 file
if (hasConcentrations) {
Expand Down

0 comments on commit 47ca687

Please sign in to comment.