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

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,7 +50,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
IOobject::MUST_READ
);
if (phiHeader.headerOk())
if (phiHeader.typeHeaderOk<surfaceScalarField>(true))
{
volScalarField Co
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,7 +48,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
IOobject::MUST_READ
);
if (Uheader.headerOk())
if (Uheader.typeHeaderOk<volVectorField>(true))
{
Info<< " Reading U" << endl;
volVectorField U(Uheader, mesh);

View File

@ -58,7 +58,11 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
);
// Check U and T exists
if (Uheader.headerOk() && Theader.headerOk())
if
(
Uheader.typeHeaderOk<volVectorField>(true)
&& Theader.typeHeaderOk<volScalarField>(true)
)
{
autoPtr<volScalarField> MachPtr;
@ -71,7 +75,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
basicThermo::dictName,
runTime.constant(),
mesh
).headerOk()
).typeHeaderOk<IOdictionary>(false)
)
{
// thermophysical Mach

View File

@ -24,7 +24,11 @@
// Check U exists
if (Uheader.headerOk() && Theader.headerOk())
if
(
Uheader.typeHeaderOk<volVectorField>(true)
&& Theader.typeHeaderOk<volScalarField>(true)
)
{
mesh.readUpdate();

View File

@ -14,7 +14,7 @@
IOobject::MUST_READ
);
if (Uheader.headerOk())
if (Uheader.typeHeaderOk<volVectorField>(true))
{
volVectorField U(Uheader, mesh);

View File

@ -55,7 +55,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
IOobject::MUST_READ
);
if (phiHeader.headerOk())
if (phiHeader.typeHeaderOk<surfaceScalarField>(true))
{
autoPtr<surfaceScalarField> PePtr;
@ -87,7 +87,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
{
if (turbulencePropertiesHeader.headerOk())
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(true))
{
singlePhaseTransportModel laminarTransport(U, phi);
@ -144,7 +144,8 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
(
"Pef",
runTime.timeName(),
mesh
mesh,
IOobject::NO_READ
),
mag(phi)
/(
@ -158,7 +159,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
}
else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
{
if (turbulencePropertiesHeader.headerOk())
if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(true))
{
autoPtr<fluidThermo> thermo(fluidThermo::New(mesh));
@ -274,6 +275,8 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " No phi" << endl;
}
Info<< "\nEnd\n" << endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,7 +51,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
IOobject::MUST_READ
);
if (Uheader.headerOk())
if (Uheader.typeHeaderOk<volVectorField>(true))
{
Info<< " Reading U" << endl;
volVectorField U(Uheader, mesh);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,7 +49,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
IOobject::MUST_READ
);
if (Uheader.headerOk())
if (Uheader.typeHeaderOk<volVectorField>(true))
{
Info<< " Reading U" << endl;
volVectorField U(Uheader, mesh);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,7 +57,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
IOobject::MUST_READ
);
if (Uheader.headerOk())
if (Uheader.typeHeaderOk<volVectorField>(true))
{
Info<< " Reading U" << endl;
volVectorField U(Uheader, mesh);

View File

@ -86,7 +86,7 @@ int main(int argc, char *argv[])
IOobject::NO_READ
);
if (phiHeader.headerOk())
if (phiHeader.typeHeaderOk<surfaceScalarField>(true))
{
mesh.readUpdate();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,7 +49,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
IOobject::MUST_READ
);
if (kheader.headerOk())
if (kheader.typeHeaderOk<volScalarField>(true))
{
Info<< " Reading k" << endl;
volScalarField k(kheader, mesh);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,7 +49,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
IOobject::MUST_READ
);
if (Uheader.headerOk())
if (Uheader.typeHeaderOk<volVectorField>(true))
{
Info<< " Reading U" << endl;
volVectorField U(Uheader, mesh);