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:
@ -74,7 +74,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (Uheader.headerOk())
|
||||
if (Uheader.typeHeaderOk<volVectorField>(true))
|
||||
{
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
@ -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
|
||||
@ -62,7 +62,6 @@ int main(int argc, char *argv[])
|
||||
"merge two meshes"
|
||||
);
|
||||
|
||||
argList::noParallel();
|
||||
#include "addOverwriteOption.H"
|
||||
|
||||
argList::validArgs.append("masterCase");
|
||||
@ -97,6 +96,18 @@ int main(int argc, char *argv[])
|
||||
word addRegion = polyMesh::defaultRegion;
|
||||
args.optionReadIfPresent("addRegion", addRegion);
|
||||
|
||||
// Since we don't use argList processor directory detection, add it to
|
||||
// the casename ourselves so it triggers the logic inside TimePath.
|
||||
const fileName& cName = args.caseName();
|
||||
std::string::size_type pos = cName.find("processor");
|
||||
if (pos != string::npos && pos != 0)
|
||||
{
|
||||
fileName processorName = cName.substr(pos, cName.size()-pos);
|
||||
masterCase += '/' + processorName;
|
||||
addCase += '/' + processorName;
|
||||
}
|
||||
|
||||
|
||||
getRootCase(masterCase);
|
||||
getRootCase(addCase);
|
||||
|
||||
|
||||
@ -187,7 +187,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
if (!dictIO.headerOk())
|
||||
if (!dictIO.typeHeaderOk<IOdictionary>(true))
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Cannot open specified refinement dictionary "
|
||||
@ -209,7 +209,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
if (dictIO.headerOk())
|
||||
if (dictIO.typeHeaderOk<IOdictionary>(true))
|
||||
{
|
||||
Info<< "Refining according to " << dictName << nl << endl;
|
||||
|
||||
|
||||
@ -601,7 +601,7 @@ autoPtr<mapPolyMesh> createRegionMesh
|
||||
|
||||
Info<< "Testing:" << io.objectPath() << endl;
|
||||
|
||||
if (!io.headerOk())
|
||||
if (!io.typeHeaderOk<IOdictionary>(true))
|
||||
// if (!exists(io.objectPath()))
|
||||
{
|
||||
Info<< "Writing dummy " << regionName/io.name() << endl;
|
||||
@ -628,7 +628,7 @@ autoPtr<mapPolyMesh> createRegionMesh
|
||||
false
|
||||
);
|
||||
|
||||
if (!io.headerOk())
|
||||
if (!io.typeHeaderOk<IOdictionary>(true))
|
||||
//if (!exists(io.objectPath()))
|
||||
{
|
||||
Info<< "Writing dummy " << regionName/io.name() << endl;
|
||||
|
||||
Reference in New Issue
Block a user