commit
3bbad4487b
|
@ -21,13 +21,17 @@ Licence:
|
|||
template<class T, class MemorySpace>
|
||||
bool pFlow::Field<T, MemorySpace>::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<class T, class MemorySpace>
|
|||
bool pFlow::Field<T, MemorySpace>::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 )
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -34,6 +34,7 @@ pFlow::boundaryNone::boundaryNone
|
|||
|
||||
bool pFlow::boundaryNone::beforeIteration
|
||||
(
|
||||
uint32 step,
|
||||
uint32 iterNum,
|
||||
real t,
|
||||
real dt
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ pFlow::boundaryReflective::boundaryReflective
|
|||
}
|
||||
|
||||
bool pFlow::boundaryReflective::beforeIteration(
|
||||
uint32 step,
|
||||
uint32 iterNum,
|
||||
real t,
|
||||
real dt)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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()<<endl;
|
||||
|
@ -265,7 +265,7 @@ bool pFlow::triSurface::read(iIstream &is, const IOPattern &iop)
|
|||
}
|
||||
|
||||
vertices_.clear();
|
||||
if(!vertices_.read(is, iop))
|
||||
if(!vertices_.read(is, iop, true))
|
||||
{
|
||||
ioErrorInFile(is.name(), is.lineNumber())<<
|
||||
" when reading field "<< vertices_.name()<<endl;
|
||||
|
|
Loading…
Reference in New Issue