bug fix for loop stall
This commit is contained in:
parent
30d5d81656
commit
4c0ef16316
|
@ -27,6 +27,8 @@ bool pFlow::sphereDEMSystem::loop()
|
||||||
{
|
{
|
||||||
Control().timers().start();
|
Control().timers().start();
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
if(! insertion_().insertParticles(
|
if(! insertion_().insertParticles(
|
||||||
Control().time().currentTime(),
|
Control().time().currentTime(),
|
||||||
Control().time().dt() ) )
|
Control().time().dt() ) )
|
||||||
|
@ -36,6 +38,7 @@ bool pFlow::sphereDEMSystem::loop()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
geometry_->beforeIteration();
|
geometry_->beforeIteration();
|
||||||
|
|
||||||
interaction_->beforeIteration();
|
interaction_->beforeIteration();
|
||||||
|
@ -58,6 +61,7 @@ bool pFlow::sphereDEMSystem::loop()
|
||||||
|
|
||||||
}while(Control()++);
|
}while(Control()++);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pFlow::sphereDEMSystem::sphereDEMSystem(
|
pFlow::sphereDEMSystem::sphereDEMSystem(
|
||||||
|
@ -213,7 +217,7 @@ bool pFlow::sphereDEMSystem::iterate(
|
||||||
Control().time().setStopAt(upToTime);
|
Control().time().setStopAt(upToTime);
|
||||||
Control().time().setOutputToFile(timeToWrite, timeName);
|
Control().time().setOutputToFile(timeToWrite, timeName);
|
||||||
|
|
||||||
loop();
|
return loop();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -221,7 +225,7 @@ bool pFlow::sphereDEMSystem::iterate(
|
||||||
bool pFlow::sphereDEMSystem::iterate(real upToTime)
|
bool pFlow::sphereDEMSystem::iterate(real upToTime)
|
||||||
{
|
{
|
||||||
Control().time().setStopAt(upToTime);
|
Control().time().setStopAt(upToTime);
|
||||||
loop();
|
return loop();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,10 +139,6 @@ public:
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
|
@ -182,23 +182,7 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator ++(int)
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setSaveTimeFolder(
|
void setSaveTimeFolder(
|
||||||
bool saveToFile,
|
bool saveToFile,
|
||||||
|
|
|
@ -234,6 +234,7 @@ bool pFlow::systemControl::operator ++(int)
|
||||||
{
|
{
|
||||||
|
|
||||||
// skip writing to file for the first iteration
|
// skip writing to file for the first iteration
|
||||||
|
//output<< "time()++"<<endl;
|
||||||
auto finished = time()++;
|
auto finished = time()++;
|
||||||
|
|
||||||
writeToFileTimer_.start();
|
writeToFileTimer_.start();
|
||||||
|
@ -256,6 +257,8 @@ bool pFlow::systemControl::operator ++(int)
|
||||||
}
|
}
|
||||||
writeToFileTimer_.end();
|
writeToFileTimer_.end();
|
||||||
|
|
||||||
|
//output<< "after finalTime()"<<endl;
|
||||||
|
|
||||||
if( time().timersReportTime() &&
|
if( time().timersReportTime() &&
|
||||||
timersReport() )
|
timersReport() )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue