Skip to content
Snippets Groups Projects
Commit 8f15184b authored by mattijs's avatar mattijs
Browse files

ENH: redistributeMeshPar : make it work with master-reading of dictionaries

parent 9afbd680
No related branches found
No related tags found
No related merge requests found
...@@ -86,33 +86,55 @@ autoPtr<fvMesh> createMesh ...@@ -86,33 +86,55 @@ autoPtr<fvMesh> createMesh
if (!haveMesh) if (!haveMesh)
{ {
// Create dummy mesh. Only used on procs that don't have mesh. // Create dummy mesh. Only used on procs that don't have mesh.
// WIP: how to avoid parallel comms when loading IOdictionaries?
// For now just give error message. // Switch timeStamp checking to one which does not do any
if // parallel sync
( regIOobject::fileCheckTypes oldCheckType =
regIOobject::fileModificationChecking regIOobject::fileModificationChecking;
== regIOobject::timeStampMaster regIOobject::fileModificationChecking = regIOobject::timeStamp;
|| regIOobject::fileModificationChecking
== regIOobject::inotifyMaster
)
{ {
FatalErrorIn("createMesh(..)") IOdictionary fvSolution
<< "Cannot use 'fileModificationChecking' mode " (
<< regIOobject::fileCheckTypesNames IOobject
[ (
regIOobject::fileModificationChecking "fvSolution",
] runTime.system(),
<< " since this uses parallel communication." runTime,
<< exit(FatalError); IOobject::NO_READ,
IOobject::NO_WRITE
)
);
Pout<< "Writing dummy " << fvSolution.objectPath() << endl;
fvSolution.regIOobject::write();
}
{
IOdictionary fvSchemes
(
IOobject
(
"fvSchemes",
runTime.system(),
runTime,
IOobject::NO_READ,
IOobject::NO_WRITE
)
);
fvSchemes.add("divSchemes", dictionary());
fvSchemes.add("gradSchemes", dictionary());
fvSchemes.add("laplacianSchemes", dictionary());
Pout<< "Writing dummy " << fvSchemes.objectPath() << endl;
fvSchemes.regIOobject::write();
} }
Pout<< "Creating dummy mesh from " << io.objectPath() << endl;
fvMesh dummyMesh fvMesh dummyMesh
( (
IOobject IOobject
( (
regionName, io.name(),
instDir, io.instance(),
runTime, io.db(),
IOobject::NO_READ IOobject::NO_READ
), ),
xferCopy(pointField()), xferCopy(pointField()),
...@@ -124,6 +146,8 @@ autoPtr<fvMesh> createMesh ...@@ -124,6 +146,8 @@ autoPtr<fvMesh> createMesh
Pout<< "Writing dummy mesh to " << dummyMesh.polyMesh::objectPath() Pout<< "Writing dummy mesh to " << dummyMesh.polyMesh::objectPath()
<< endl; << endl;
dummyMesh.write(); dummyMesh.write();
regIOobject::fileModificationChecking = oldCheckType;
} }
Pout<< "Reading mesh from " << io.objectPath() << endl; Pout<< "Reading mesh from " << io.objectPath() << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment