diff --git a/src/phasicFlow/containers/Field/Field.cpp b/src/phasicFlow/containers/Field/Field.cpp index 335fbe49..10e14df8 100644 --- a/src/phasicFlow/containers/Field/Field.cpp +++ b/src/phasicFlow/containers/Field/Field.cpp @@ -21,13 +21,17 @@ Licence: template bool pFlow::Field::read ( - iIstream& is + iIstream& is, + bool resume ) { bool tokenFound = true; - tokenFound = is.findToken(fieldKey_); + if(resume) + tokenFound = is.findTokenResume(fieldKey_); + else + tokenFound = is.findToken(fieldKey_); if( !tokenFound ) { @@ -53,14 +57,21 @@ template bool pFlow::Field::read ( iIstream& is, - const IOPattern& iop + const IOPattern& iop, + bool resume ) { bool tokenFound = true; if(iop.thisProcReadData()) - tokenFound = is.findToken(fieldKey_); + { + if(resume) + tokenFound = is.findTokenResume(fieldKey_); + else + tokenFound = is.findToken(fieldKey_); + } + if( !tokenFound ) { diff --git a/src/phasicFlow/containers/Field/Field.hpp b/src/phasicFlow/containers/Field/Field.hpp index 738811bc..b38d3017 100644 --- a/src/phasicFlow/containers/Field/Field.hpp +++ b/src/phasicFlow/containers/Field/Field.hpp @@ -197,12 +197,12 @@ public: //// - IO operations - bool read(iIstream& is); + bool read(iIstream& is, bool resume = false); bool write(iOstream& os)const; - bool read(iIstream& is, const IOPattern& iop); + bool read(iIstream& is, const IOPattern& iop, bool resume = false); bool write(iOstream& os, const IOPattern& iop )const; diff --git a/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp b/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp index 978f674b..b1f8008a 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp @@ -339,7 +339,7 @@ public: virtual - bool beforeIteration(uint32 iterNum, real t, real dt) = 0 ; + bool beforeIteration(uint32 step, uint32 iterNum, real t, real dt) = 0 ; virtual bool iterate(uint32 iterNum, real t, real dt) = 0; diff --git a/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.cpp b/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.cpp index 9937433c..ce874e67 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.cpp @@ -42,12 +42,14 @@ pFlow::boundaryExit::boundaryExit bool pFlow::boundaryExit::beforeIteration ( + uint32 step, uint32 iterNum, real t, real dt ) { - + if(step!= 2 )return true; + if( !boundaryListUpdate(iterNum))return true; // nothing have to be done diff --git a/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.hpp b/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.hpp index f8aa61c5..b4763e26 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.hpp @@ -63,7 +63,7 @@ public: dictionary ); - bool beforeIteration(uint32 iterNum, real t, real dt) override; + bool beforeIteration(uint32 step, uint32 iterNum, real t, real dt) override; bool iterate(uint32 iterNum, real t, real dt) override; diff --git a/src/phasicFlow/structuredData/boundaries/boundaryList.cpp b/src/phasicFlow/structuredData/boundaries/boundaryList.cpp index 0e5ddfed..707e00ea 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryList.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryList.cpp @@ -172,7 +172,17 @@ pFlow::boundaryList::beforeIteration(uint32 iter, real t, real dt, bool force) for (auto bdry : *this) { - if (!bdry->beforeIteration(iter, t, dt)) + if (!bdry->beforeIteration(1, iter, t, dt)) + { + fatalErrorInFunction << "Error in beforeIteration in boundary " + << bdry->name() << endl; + return false; + } + } + + for (auto bdry : *this) + { + if (!bdry->beforeIteration(2, iter, t, dt)) { fatalErrorInFunction << "Error in beforeIteration in boundary " << bdry->name() << endl; diff --git a/src/phasicFlow/structuredData/boundaries/boundaryNone/boundaryNone.cpp b/src/phasicFlow/structuredData/boundaries/boundaryNone/boundaryNone.cpp index 327330dd..7f228562 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryNone/boundaryNone.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryNone/boundaryNone.cpp @@ -34,6 +34,7 @@ pFlow::boundaryNone::boundaryNone bool pFlow::boundaryNone::beforeIteration ( + uint32 step, uint32 iterNum, real t, real dt diff --git a/src/phasicFlow/structuredData/boundaries/boundaryNone/boundaryNone.hpp b/src/phasicFlow/structuredData/boundaries/boundaryNone/boundaryNone.hpp index 8e103d39..68ddf33f 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryNone/boundaryNone.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryNone/boundaryNone.hpp @@ -52,7 +52,7 @@ public: dictionary ); - bool beforeIteration(uint32 iterNum, real t, real dt) final; + bool beforeIteration(uint32 step, uint32 iterNum, real t, real dt) final; bool iterate(uint32 iterNum, real t, real dt) final; diff --git a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp index cbdecf71..cf111eb5 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp @@ -51,10 +51,12 @@ pFlow::realx3 pFlow::boundaryPeriodic::boundaryExtensionLength() const bool pFlow::boundaryPeriodic::beforeIteration( + uint32 step, uint32 iterNum, real t, real dt) { + if(step!=2)return true; // nothing have to be done if(empty()) { diff --git a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp index 88983fa3..69b0413a 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp @@ -64,7 +64,7 @@ public: //const plane& boundaryPlane()const override;*/ - bool beforeIteration(uint32 iterNum, real t, real dt) override; + bool beforeIteration(uint32 step, uint32 iterNum, real t, real dt) override; bool iterate(uint32 iterNum, real t, real dt) override; diff --git a/src/phasicFlow/structuredData/boundaries/boundaryReflective/boundaryReflective.cpp b/src/phasicFlow/structuredData/boundaries/boundaryReflective/boundaryReflective.cpp index 74ee4d75..8de9b74f 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryReflective/boundaryReflective.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryReflective/boundaryReflective.cpp @@ -46,6 +46,7 @@ pFlow::boundaryReflective::boundaryReflective } bool pFlow::boundaryReflective::beforeIteration( + uint32 step, uint32 iterNum, real t, real dt) diff --git a/src/phasicFlow/structuredData/boundaries/boundaryReflective/boundaryReflective.hpp b/src/phasicFlow/structuredData/boundaries/boundaryReflective/boundaryReflective.hpp index 43e1ce13..3f3bc64c 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryReflective/boundaryReflective.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryReflective/boundaryReflective.hpp @@ -59,7 +59,7 @@ public: dictionary ); - bool beforeIteration(uint32 iterNum, real t, real dt) override; + bool beforeIteration(uint32 step, uint32 iterNum, real t, real dt) override; bool iterate(uint32 iterNum, real t, real dt) override; diff --git a/src/phasicFlow/triSurface/triSurface.cpp b/src/phasicFlow/triSurface/triSurface.cpp index 4daf1387..ab18bb36 100644 --- a/src/phasicFlow/triSurface/triSurface.cpp +++ b/src/phasicFlow/triSurface/triSurface.cpp @@ -257,7 +257,7 @@ pFlow::triSurface::triSurface bool pFlow::triSurface::read(iIstream &is, const IOPattern &iop) { points_.clear(); - if(!points_.read(is, iop)) + if(!points_.read(is, iop, true)) { ioErrorInFile(is.name(), is.lineNumber())<< " when reading field "<< points_.name()<