mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: renumberMesh: have -dict option to read renumberMeshDict
This commit is contained in:
@ -459,6 +459,11 @@ autoPtr<mapPolyMesh> reorderMesh
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
argList::addNote
|
||||||
|
(
|
||||||
|
"Renumber mesh to minimise bandwidth"
|
||||||
|
);
|
||||||
|
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"blockSize",
|
"blockSize",
|
||||||
@ -479,6 +484,11 @@ int main(int argc, char *argv[])
|
|||||||
# include "addRegionOption.H"
|
# include "addRegionOption.H"
|
||||||
# include "addOverwriteOption.H"
|
# include "addOverwriteOption.H"
|
||||||
# include "addTimeOptions.H"
|
# include "addTimeOptions.H"
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"dict",
|
||||||
|
"renumber according to system/renumberMeshDict"
|
||||||
|
);
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -495,6 +505,9 @@ int main(int argc, char *argv[])
|
|||||||
# include "createNamedMesh.H"
|
# include "createNamedMesh.H"
|
||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
|
|
||||||
|
const bool readDict = args.optionFound("dict");
|
||||||
|
|
||||||
|
|
||||||
label blockSize = 0;
|
label blockSize = 0;
|
||||||
args.optionReadIfPresent("blockSize", blockSize, 0);
|
args.optionReadIfPresent("blockSize", blockSize, 0);
|
||||||
|
|
||||||
@ -539,28 +552,29 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
// Construct renumberMethod
|
// Construct renumberMethod
|
||||||
IOobject io
|
|
||||||
(
|
|
||||||
"renumberMeshDict",
|
|
||||||
runTime.system(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
);
|
|
||||||
|
|
||||||
autoPtr<renumberMethod> renumberPtr;
|
autoPtr<renumberMethod> renumberPtr;
|
||||||
|
|
||||||
if (io.headerOk())
|
if (readDict)
|
||||||
{
|
{
|
||||||
Info<< "Detected local " << runTime.system()/io.name() << "." << nl
|
Info<< "Renumber according to renumberMeshDict." << nl << endl;
|
||||||
<< "Using this to select renumberMethod." << nl << endl;
|
|
||||||
renumberPtr = renumberMethod::New(IOdictionary(io));
|
IOdictionary renumberDict
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"renumberMeshDict",
|
||||||
|
runTime.system(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
renumberPtr = renumberMethod::New(renumberDict);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< "No local " << runTime.system()/io.name()
|
Info<< "Using default renumberMethod." << nl << endl;
|
||||||
<< " dictionary found. Using default renumberMethod." << nl
|
|
||||||
<< endl;
|
|
||||||
dictionary renumberDict;
|
dictionary renumberDict;
|
||||||
renumberPtr.reset(new CuthillMcKeeRenumber(renumberDict));
|
renumberPtr.reset(new CuthillMcKeeRenumber(renumberDict));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user