mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: redistributeMeshPar : make it work with master-reading of dictionaries
This commit is contained in:
@ -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
|
|||||||
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user