mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -16,6 +16,6 @@ for (label n1=0; n1<Times.size() && variableGood; ++n1)
|
||||
Times[n1].name(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
).headerOk();
|
||||
).typeHeaderOk<volScalarField>(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ if (Times.size() > 1)
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
);
|
||||
if (io.headerOk())
|
||||
if (io.typeHeaderOk<pointIOField>(true))
|
||||
{
|
||||
meshMoving = true;
|
||||
break;
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -13,6 +13,6 @@ if (timeDirs.size() > 1)
|
||||
polyMesh::meshSubDir,
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
).headerOk();
|
||||
).typeHeaderOk<pointIOField>(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
false
|
||||
);
|
||||
|
||||
if (io.headerOk())
|
||||
if (io.typeHeaderOk<IOdictionary>(true))
|
||||
{
|
||||
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
|
||||
IOdictionary timeObject(io);
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
mesh
|
||||
);
|
||||
|
||||
if (io.headerOk())
|
||||
if (io.typeHeaderOk<pointIOField>(true))
|
||||
{
|
||||
// Read new points
|
||||
io.readOpt() = IOobject::MUST_READ;
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ IOobject ioPoints
|
||||
mesh
|
||||
);
|
||||
|
||||
if (ioPoints.headerOk())
|
||||
if (ioPoints.typeHeaderOk<pointIOField>(true))
|
||||
{
|
||||
Info<< "new points available" << endl;
|
||||
// Reading new points
|
||||
|
||||
Reference in New Issue
Block a user