ENH: parallel: added -decomposeParDict option to

- foamyHexMesh
- snappyHexMesh
- decomposePar
This commit is contained in:
mattijs
2015-11-24 17:35:18 +00:00
parent 251839df0d
commit f0bc2d9faa
22 changed files with 265 additions and 202 deletions

View File

@ -2,6 +2,8 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
@ -9,4 +11,5 @@ EXE_LIBS = \
-lmeshTools \
-llagrangian \
-lfiniteVolume \
-ldecompose \
-lgenericPatchFields

View File

@ -36,9 +36,48 @@ Description
#include "meshToMesh0.H"
#include "processorFvPatch.H"
#include "MapMeshes.H"
#include "decompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int readNumProcs
(
const argList& args,
const word& optionName,
const Time& runTime
)
{
fileName dictFile;
if (args.optionReadIfPresent(optionName, dictFile))
{
if (isDir(dictFile))
{
dictFile = dictFile/"decomposeParDict";
}
}
return readInt
(
IOdictionary
(
decompositionModel::selectIO
(
IOobject
(
"decomposeParDict",
runTime.system(),
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
),
dictFile
)
).lookup("numberOfSubdomains")
);
}
void mapConsistentMesh
(
const fvMesh& meshSource,
@ -225,6 +264,19 @@ int main(int argc, char *argv[])
"subtract",
"subtract mapped source from target"
);
argList::addOption
(
"sourceDecomposeParDict",
"file",
"read decomposePar dictionary from specified location"
);
argList::addOption
(
"targetDecomposeParDict",
"file",
"read decomposePar dictionary from specified location"
);
argList args(argc, argv);
@ -320,20 +372,13 @@ int main(int argc, char *argv[])
if (parallelSource && !parallelTarget)
{
IOdictionary decompositionDict
int nProcs = readNumProcs
(
IOobject
(
"decomposeParDict",
runTimeSource.system(),
runTimeSource,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
args,
"sourceDecomposeParDict",
runTimeSource
);
int nProcs(readInt(decompositionDict.lookup("numberOfSubdomains")));
Info<< "Create target mesh\n" << endl;
fvMesh meshTarget
@ -399,19 +444,13 @@ int main(int argc, char *argv[])
}
else if (!parallelSource && parallelTarget)
{
IOdictionary decompositionDict
int nProcs = readNumProcs
(
IOobject
(
"decomposeParDict",
runTimeTarget.system(),
runTimeTarget,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
args,
"targetDecomposeParDict",
runTimeTarget
);
int nProcs(readInt(decompositionDict.lookup("numberOfSubdomains")));
Info<< "Create source mesh\n" << endl;
@ -478,39 +517,17 @@ int main(int argc, char *argv[])
}
else if (parallelSource && parallelTarget)
{
IOdictionary decompositionDictSource
int nProcsSource = readNumProcs
(
IOobject
(
"decomposeParDict",
runTimeSource.system(),
runTimeSource,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
args,
"sourceDecomposeParDict",
runTimeSource
);
int nProcsSource
int nProcsTarget = readNumProcs
(
readInt(decompositionDictSource.lookup("numberOfSubdomains"))
);
IOdictionary decompositionDictTarget
(
IOobject
(
"decomposeParDict",
runTimeTarget.system(),
runTimeTarget,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
int nProcsTarget
(
readInt(decompositionDictTarget.lookup("numberOfSubdomains"))
args,
"targetDecomposeParDict",
runTimeTarget
);
List<boundBox> bbsTarget(nProcsTarget);