ENH: glboal file handling: initial commit

Moved file path handling to regIOobject and made it type specific so
now every object can have its own rules. Examples:
- faceZones are now processor local (and don't search up anymore)
- timeStampMaster is now no longer hardcoded inside IOdictionary
  (e.g. uniformDimensionedFields support it as well)
- the distributedTriSurfaceMesh is properly processor-local; no need
  for fileModificationChecking manipulation.
This commit is contained in:
mattijs
2016-01-25 13:03:15 +00:00
parent 9fd840c12a
commit e424059208
188 changed files with 3487 additions and 1364 deletions

View File

@ -16,6 +16,6 @@ for (label n1=0; n1<Times.size() && variableGood; ++n1)
Times[n1].name(),
mesh,
IOobject::NO_READ
).headerOk();
).typeHeaderOk<volScalarField>(false);
}
}

View File

@ -17,7 +17,7 @@ if (Times.size() > 1)
mesh,
IOobject::NO_READ
);
if (io.headerOk())
if (io.typeHeaderOk<pointIOField>(true))
{
meshMoving = true;
break;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,6 +28,7 @@ License
#include "IOField.H"
#include "OFstream.H"
#include "IOmanip.H"
#include "ensightPTraits.H"
using namespace Foam;
@ -105,8 +106,10 @@ void ensightCloudField
v = pTraits<Type>::zero;
}
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
for (direction i=0; i < pTraits<Type>::nComponents; ++i)
{
label cmpt = ensightPTraits<Type>::componentOrder[i];
ensightFile << setw(12) << component(v, cmpt);
if (++count % 6 == 0)
{

View File

@ -584,7 +584,10 @@ int main(int argc, char *argv[])
IOobject::MUST_READ
);
bool fieldExists = fieldObject.headerOk();
bool fieldExists = fieldObject.typeHeaderOk<IOField<scalar> >
(
false
);
if (fieldType == scalarIOField::typeName)
{
ensightCloudField<scalar>

View File

@ -13,6 +13,6 @@ if (timeDirs.size() > 1)
polyMesh::meshSubDir,
mesh,
IOobject::NO_READ
).headerOk();
).typeHeaderOk<pointIOField>(true);
}
}

View File

@ -24,7 +24,7 @@
false
);
if (io.headerOk())
if (io.typeHeaderOk<IOdictionary>(true))
{
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
IOdictionary timeObject(io);

View File

@ -7,7 +7,7 @@
mesh
);
if (io.headerOk())
if (io.typeHeaderOk<pointIOField>(true))
{
// Read new points
io.readOpt() = IOobject::MUST_READ;

View File

@ -71,7 +71,13 @@ for (label i=0; i < nTypes; i++)
IOobject::NO_READ
);
if (lagrangianHeader.headerOk())
if
(
lagrangianHeader.typeHeaderOk<IOPosition<Cloud<passiveParticle> > >
(
false
)
)
{
Cloud<passiveParticle> particles(mesh);

View File

@ -6,7 +6,7 @@ IOobject ioPoints
mesh
);
if (ioPoints.headerOk())
if (ioPoints.typeHeaderOk<pointIOField>(true))
{
Info<< "new points available" << endl;
// Reading new points