bug fix for loop stall

This commit is contained in:
Hamidreza Norouzi 2023-02-20 07:53:48 -08:00
parent 30d5d81656
commit 4c0ef16316
5 changed files with 28 additions and 24 deletions

View File

@ -27,6 +27,8 @@ bool pFlow::sphereDEMSystem::loop()
{
Control().timers().start();
//
if(! insertion_().insertParticles(
Control().time().currentTime(),
Control().time().dt() ) )
@ -35,6 +37,7 @@ bool pFlow::sphereDEMSystem::loop()
"particle insertion failed in sphereDFlow solver.\n";
return false;
}
geometry_->beforeIteration();
@ -58,6 +61,7 @@ bool pFlow::sphereDEMSystem::loop()
}while(Control()++);
return true;
}
pFlow::sphereDEMSystem::sphereDEMSystem(
@ -213,7 +217,7 @@ bool pFlow::sphereDEMSystem::iterate(
Control().time().setStopAt(upToTime);
Control().time().setOutputToFile(timeToWrite, timeName);
loop();
return loop();
return true;
}
@ -221,7 +225,7 @@ bool pFlow::sphereDEMSystem::iterate(
bool pFlow::sphereDEMSystem::iterate(real upToTime)
{
Control().time().setStopAt(upToTime);
loop();
return loop();
return true;
}

View File

@ -139,10 +139,6 @@ public:
{
return true;
}
};

View File

@ -147,3 +147,20 @@ void pFlow::timeControl::setSaveTimeFolder(
}
}
bool pFlow::timeControl::operator ++(int)
{
if( reachedStopAt() ) return false;
// increament iteration number
currentIter_++;
currentTime_ += dt_;
if(screenReport())
{
REPORT(0)<<"Time (s): "<<cyanText( currentTimeWord() )<<endREPORT;
}
// switch outputToFile_ on/off
checkForOutputToFile();
return true;
}

View File

@ -182,23 +182,7 @@ public:
return true;
}
bool operator ++(int)
{
if( reachedStopAt() ) return false;
// increament iteration number
currentIter_++;
currentTime_ += dt_;
if(screenReport())
{
REPORT(0)<<"Time (s): "<<cyanText( currentTimeWord() )<<endREPORT;
}
// switch outputToFile_ on/off
checkForOutputToFile();
return true;
}
bool operator ++(int);
void setSaveTimeFolder(
bool saveToFile,

View File

@ -234,6 +234,7 @@ bool pFlow::systemControl::operator ++(int)
{
// skip writing to file for the first iteration
//output<< "time()++"<<endl;
auto finished = time()++;
writeToFileTimer_.start();
@ -256,12 +257,14 @@ bool pFlow::systemControl::operator ++(int)
}
writeToFileTimer_.end();
//output<< "after finalTime()"<<endl;
if( time().timersReportTime() &&
timersReport() )
{
timers_.write(output, true);
}
return finished;
}