mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-12 16:26:23 +00:00
Merge pull request #64 from PhasicFlow/coupling
coupling modifictions for timeControl and iterate
This commit is contained in:
@ -102,19 +102,27 @@ pFlow::timeControl::timeControl(
|
||||
void pFlow::timeControl::checkForOutputToFile()
|
||||
{
|
||||
|
||||
if(managedExternaly_) return;
|
||||
|
||||
bool save = false;
|
||||
|
||||
if ( abs(currentTime_ - lastSaved_ - saveInterval_) < 0.5 * dt_ )
|
||||
{
|
||||
lastSaved_ = currentTime_;
|
||||
save = true;
|
||||
}
|
||||
else if( abs(currentTime_ - lastSaved_) < min( pow(10.0,-1.0*timePrecision_), 0.5 *dt_) )
|
||||
if(managedExternaly_)
|
||||
{
|
||||
lastSaved_ = currentTime_;
|
||||
save = true;
|
||||
if( abs(currentTime_-writeTime_) < 0.5*dt_)
|
||||
{
|
||||
save = true;
|
||||
lastSaved_ = currentTime_;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( abs(currentTime_ - lastSaved_ - saveInterval_) < 0.5 * dt_ )
|
||||
{
|
||||
lastSaved_ = currentTime_;
|
||||
save = true;
|
||||
}
|
||||
else if( abs(currentTime_ - lastSaved_) < min( pow(10.0,-1.0*timePrecision_), 0.5 *dt_) )
|
||||
{
|
||||
lastSaved_ = currentTime_;
|
||||
save = true;
|
||||
}
|
||||
}
|
||||
|
||||
outputToFile_ = save;
|
||||
|
@ -67,7 +67,9 @@ protected:
|
||||
|
||||
bool managedExternaly_ = false;
|
||||
|
||||
word timeName_ = "wrongSettings";
|
||||
word timeName_ = "wrongSettings"; // for managedExternamly
|
||||
|
||||
real writeTime_ = 0; // for managedExternamly
|
||||
|
||||
realStridedRange timersReportInterval_;
|
||||
|
||||
@ -108,6 +110,15 @@ public:
|
||||
return tmp;
|
||||
}
|
||||
|
||||
void setEndTime(real eT)
|
||||
{
|
||||
if(managedExternaly_)
|
||||
{
|
||||
endTime_ = eT;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
real startTime()const
|
||||
{
|
||||
return startTime_;
|
||||
@ -141,6 +152,7 @@ public:
|
||||
bool finished()const
|
||||
{
|
||||
if( currentTime_ >= endTime_ ) return true;
|
||||
if( abs(currentTime_-endTime_) < 0.5*dt_ )return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -151,6 +163,15 @@ public:
|
||||
|
||||
bool timersReportTime()const;
|
||||
|
||||
bool setOutputToFile(real writeTime, const word& timeName)
|
||||
{
|
||||
if(managedExternaly_)
|
||||
{
|
||||
timeName_ = timeName;
|
||||
writeTime_ = writeTime;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool operator ++(int)
|
||||
{
|
||||
|
Reference in New Issue
Block a user