mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: multi-region support for reconstructParMesh (#2072)
This commit is contained in:
@ -71,7 +71,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
|
|
||||||
const auto decompFile = args.get<fileName>(1);
|
const auto decompFile = args.get<fileName>(1);
|
||||||
const bool region = args.found("region");
|
|
||||||
const bool verbose = args.found("verbose");
|
const bool verbose = args.found("verbose");
|
||||||
|
|
||||||
// Set time from database
|
// Set time from database
|
||||||
@ -87,23 +86,17 @@ int main(int argc, char *argv[])
|
|||||||
// Get region names
|
// Get region names
|
||||||
#include "getAllRegionOptions.H"
|
#include "getAllRegionOptions.H"
|
||||||
|
|
||||||
wordList regionDirs(regionNames);
|
|
||||||
if (regionDirs.size() == 1 && regionDirs[0] == polyMesh::defaultRegion)
|
|
||||||
{
|
|
||||||
regionDirs[0].clear();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< "Decomposing regions: "
|
|
||||||
<< flatOutput(regionNames) << nl << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
labelList cellToProc;
|
labelList cellToProc;
|
||||||
|
|
||||||
forAll(regionNames, regioni)
|
forAll(regionNames, regioni)
|
||||||
{
|
{
|
||||||
const word& regionName = regionNames[regioni];
|
const word& regionName = regionNames[regioni];
|
||||||
const word& regionDir = regionDirs[regioni];
|
// const word& regionDir =
|
||||||
|
// (
|
||||||
|
// regionName != polyMesh::defaultRegion
|
||||||
|
// ? regionName
|
||||||
|
// : word::null
|
||||||
|
// );
|
||||||
|
|
||||||
Info<< "\n\nDecomposing mesh " << regionName << nl << endl;
|
Info<< "\n\nDecomposing mesh " << regionName << nl << endl;
|
||||||
Info<< "Create mesh..." << flush;
|
Info<< "Create mesh..." << flush;
|
||||||
|
|||||||
@ -52,7 +52,7 @@ void Foam::domainDecomposition::writeVolField
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
this->mesh(),
|
this->mesh(),
|
||||||
dimensionedScalar("cellDist", dimless, -1),
|
dimensionedScalar(dimless, Zero),
|
||||||
zeroGradientFvPatchScalarField::typeName
|
zeroGradientFvPatchScalarField::typeName
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -167,28 +167,34 @@ int main(int argc, char *argv[])
|
|||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool newTimes = args.found("newTimes");
|
const bool newTimes = args.found("newTimes");
|
||||||
|
|
||||||
// Get region names
|
// Get region names
|
||||||
#include "getAllRegionOptions.H"
|
#include "getAllRegionOptions.H"
|
||||||
|
|
||||||
wordList regionDirs(regionNames);
|
// Determine the processor count
|
||||||
|
label nProcs{0};
|
||||||
|
|
||||||
if (regionNames.size() == 1)
|
if (regionNames.empty())
|
||||||
{
|
{
|
||||||
if (regionNames[0] == polyMesh::defaultRegion)
|
FatalErrorInFunction
|
||||||
{
|
<< "No regions specified or detected."
|
||||||
regionDirs[0].clear();
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
else
|
else if (regionNames[0] == polyMesh::defaultRegion)
|
||||||
|
{
|
||||||
|
nProcs = fileHandler().nProcs(args.path());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nProcs = fileHandler().nProcs(args.path(), regionNames[0]);
|
||||||
|
|
||||||
|
if (regionNames.size() == 1)
|
||||||
{
|
{
|
||||||
Info<< "Using region: " << regionNames[0] << nl << endl;
|
Info<< "Using region: " << regionNames[0] << nl << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine the processor count
|
|
||||||
label nProcs = fileHandler().nProcs(args.path(), regionDirs[0]);
|
|
||||||
|
|
||||||
if (!nProcs)
|
if (!nProcs)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -261,16 +267,21 @@ int main(int argc, char *argv[])
|
|||||||
forAll(regionNames, regioni)
|
forAll(regionNames, regioni)
|
||||||
{
|
{
|
||||||
const word& regionName = regionNames[regioni];
|
const word& regionName = regionNames[regioni];
|
||||||
const word& regionDir = regionDirs[regioni];
|
const word& regionDir =
|
||||||
|
(
|
||||||
|
regionName != polyMesh::defaultRegion
|
||||||
|
? regionName
|
||||||
|
: word::null
|
||||||
|
);
|
||||||
|
|
||||||
Info<< "\n\nReconstructing fields for mesh " << regionName << nl
|
Info<< "\n\nReconstructing fields" << nl
|
||||||
<< endl;
|
<< "region=" << regionName << nl << endl;
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
newTimes
|
newTimes
|
||||||
&& regionNames.size() == 1
|
&& regionNames.size() == 1
|
||||||
&& regionDirs[0].empty()
|
&& regionDir.empty()
|
||||||
&& haveAllTimes(masterTimeDirSet, timeDirs)
|
&& haveAllTimes(masterTimeDirSet, timeDirs)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user