decomposePar, reconstructPar: Renamed cellDist to cellProc

The cellProc field is the field of cell-processor labels.

The names "distribution" and "dist" have been removed as these are
ambiguous in relation to other forms of distribution and to distance.
This commit is contained in:
Will Bainbridge
2022-07-20 15:36:31 +01:00
parent 52f262859a
commit dafe3fa004
12 changed files with 55 additions and 60 deletions

View File

@ -59,32 +59,29 @@ Description
using namespace Foam;
// Create named field from labelList for postprocessing
tmp<volScalarField> createScalarField
void writeCellLabels
(
const fvMesh& mesh,
const word& name,
const labelList& elems
)
{
tmp<volScalarField> tfld
volScalarField::Internal fld
(
volScalarField::New
IOobject
(
name,
mesh.time().timeName(),
mesh,
dimensionedScalar(dimless, 0),
zeroGradientFvPatchScalarField::typeName
)
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimless,
scalarField(scalarList(elems))
);
volScalarField& fld = tfld.ref();
forAll(fld, celli)
{
fld[celli] = elems[celli];
}
return tfld;
fld.write();
}
@ -850,18 +847,16 @@ int main(int argc, char *argv[])
UPstream::parRun() = oldParRun;
// For debugging: write out region
createScalarField
writeCellLabels
(
mesh,
"cellDist",
"cellProc",
cellToRegion
)().write();
Info<< nl << "Written decomposition as volScalarField to "
<< "cellDist for use in postprocessing."
);
Info<< nl << "Written decomposition as volScalarField::Internal to "
<< "cellProc for use in postprocessing."
<< nl << endl;
cellOrder = regionRenumber(renumberPtr(), mesh, cellToRegion);
// Determine new to old face order with new cell numbering
@ -1237,19 +1232,19 @@ int main(int argc, char *argv[])
if (writeMaps)
{
// For debugging: write out region
createScalarField
writeCellLabels
(
mesh,
"origCellID",
map().cellMap()
)().write();
);
createScalarField
writeCellLabels
(
mesh,
"cellID",
identity(mesh.nCells())
)().write();
);
Info<< nl << "Written current cellID and origCellID as volScalarField"
<< " for use in postprocessing."

View File

@ -32,9 +32,9 @@ Usage
\b decomposePar [OPTION]
Options:
- \par -cellDist
Write the cell distribution as a labelList, for use with 'manual'
decomposition method or as a volScalarField for post-processing.
- \par -cellProc
Write cell processor indices as a volScalarField::Internal for
post-processing.
- \par -region \<regionName\> \n
Decompose named region. Does not check for existence of processor*.
@ -164,7 +164,7 @@ void decomposeUniform
void writeDecomposition(const domainDecomposition& meshes)
{
// Write as volScalarField for postprocessing.
// Write as volScalarField::Internal for postprocessing.
volScalarField::Internal cellProc
(
IOobject
@ -182,7 +182,7 @@ void writeDecomposition(const domainDecomposition& meshes)
cellProc.write();
Info<< "Wrote decomposition as volScalarField to "
Info<< "Wrote decomposition as volScalarField::Internal to "
<< cellProc.name() << " for use in postprocessing."
<< nl << endl;
}
@ -206,9 +206,9 @@ int main(int argc, char *argv[])
#include "addAllRegionsOption.H"
argList::addBoolOption
(
"cellDist",
"write cell distribution as a labelList - for use with 'manual' "
"decomposition method or as a volScalarField for post-processing."
"cellProc",
"write cell processor indices as a volScalarField::Internal for "
"post-processing."
);
argList::addBoolOption
(
@ -247,7 +247,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
bool region = args.optionFound("region");
bool writeCellDist = args.optionFound("cellDist");
bool writeCellProc = args.optionFound("cellProc");
bool copyZero = args.optionFound("copyZero");
bool copyUniform = args.optionFound("copyUniform");
bool decomposeFieldsOnly = args.optionFound("fields");
@ -396,7 +396,7 @@ int main(int argc, char *argv[])
domainDecomposition meshes(runTimes, regionName);
if (!decomposeFieldsOnly || !copyZero)
{
if (meshes.readDecompose(decomposeSets) && writeCellDist)
if (meshes.readDecompose(decomposeSets) && writeCellProc)
{
writeDecomposition(meshes);
fileHandler().flush();
@ -445,7 +445,7 @@ int main(int argc, char *argv[])
// Write the decomposition, if necessary
if
(
writeCellDist
writeCellProc
&& meshes.completeMesh().facesInstance()
== runTimes.completeTime().timeName()
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,11 +41,11 @@ void Foam::readFields
// Search list of objects for fields of type GeomField
IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
// Remove the cellDist field
IOobjectList::iterator celDistIter = fieldObjects.find("cellDist");
if (celDistIter != fieldObjects.end())
// Remove the cellProc field
IOobjectList::iterator cellProcIter = fieldObjects.find("cellProc");
if (cellProcIter != fieldObjects.end())
{
fieldObjects.erase(celDistIter);
fieldObjects.erase(cellProcIter);
}
// Get sorted set of names (different processors might read objects in

View File

@ -66,7 +66,7 @@ bool haveAllTimes
void writeDecomposition(const domainDecomposition& meshes)
{
// Write as volScalarField for postprocessing.
// Write as volScalarField::Internal for postprocessing.
volScalarField::Internal cellProc
(
IOobject
@ -84,7 +84,7 @@ void writeDecomposition(const domainDecomposition& meshes)
cellProc.write();
Info<< "Wrote decomposition as volScalarField to "
Info<< "Wrote decomposition as volScalarField::Internal to "
<< cellProc.name() << " for use in postprocessing."
<< nl << endl;
}
@ -110,9 +110,9 @@ int main(int argc, char *argv[])
#include "addAllRegionsOption.H"
argList::addBoolOption
(
"cellDist",
"write cell distribution as a labelList - for use with 'manual' "
"decomposition method or as a volScalarField for post-processing."
"cellProc",
"write cell processor indices as a volScalarField::Internal for "
"post-processing."
);
argList::addOption
(
@ -152,7 +152,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
const bool writeCellDist = args.optionFound("cellDist");
const bool writeCellProc = args.optionFound("cellProc");
HashSet<word> selectedFields;
if (args.optionFound("fields"))
@ -266,7 +266,7 @@ int main(int argc, char *argv[])
// Create meshes
Info<< "\n\nReconstructing mesh " << regionName << nl << endl;
domainDecomposition meshes(runTimes, regionName);
if (meshes.readReconstruct(!noReconstructSets) && writeCellDist)
if (meshes.readReconstruct(!noReconstructSets) && writeCellProc)
{
writeDecomposition(meshes);
fileHandler().flush();
@ -301,7 +301,7 @@ int main(int argc, char *argv[])
// Write the decomposition, if necessary
if
(
writeCellDist
writeCellProc
&& meshes.completeMesh().facesInstance()
== runTimes.completeTime().timeName()
)

View File

@ -762,7 +762,7 @@ _decomposePar_ ()
local line=${COMP_LINE}
local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")
opts="-allRegions -case -cellDist -constant -copyUniform -copyZero -dict -doc -fields -fileHandler -force -help -latestTime -libs -noFields -noFunctionObjects -noSets -noZero -region -srcDoc -time"
opts="-allRegions -case -cellProc -constant -copyUniform -copyZero -dict -doc -fields -fileHandler -force -help -latestTime -libs -noFields -noFunctionObjects -noSets -noZero -region -srcDoc -time"
for o in $used ; do opts="${opts/$o/}" ; done
extra=""
@ -2831,7 +2831,7 @@ _reconstructPar_ ()
local line=${COMP_LINE}
local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ")
opts="- -allRegions -case -constant -doc -fields -fileHandler -help -lagrangianFields -latestTime -libs -newTimes -noFields -noFunctionObjects -noLagrangian -noSets -noZero -region -srcDoc -time -withZero"
opts="- -allRegions -case -cellProc -constant -doc -fields -fileHandler -help -lagrangianFields -latestTime -libs -newTimes -noFields -noFunctionObjects -noLagrangian -noSets -noZero -region -srcDoc -time -withZero"
for o in $used ; do opts="${opts/$o/}" ; done
extra=""

View File

@ -6,8 +6,8 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication blockMesh
runApplication decomposePar -cellDist
runApplication decomposePar -cellProc
runParallel $(getApplication)
runApplication reconstructPar -cellDist
runApplication reconstructPar -cellProc
#------------------------------------------------------------------------------

View File

@ -13,7 +13,7 @@ runApplication blockMesh
#runApplication $application
#- Run parallel
runApplication decomposePar -cellDist
runApplication decomposePar -cellProc
runParallel $application
runApplication reconstructPar

View File

@ -16,7 +16,7 @@ runApplication transformPoints -pointSet ball "Rz=-45"
runApplication createNonConformalCouples -overwrite pipeNonCouple ballNonCouple
# Decompose
runApplication decomposePar -cellDist
runApplication decomposePar -cellProc
# Set the value of the scalar transport field
runParallel setFields

View File

@ -4,6 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase & rm -f 0/cellDist
cleanCase & rm -f 0/cellProc
#------------------------------------------------------------------------------

View File

@ -11,7 +11,7 @@ runApplication blockMesh
runApplication topoSet
runApplication refineHexMesh c0 -noFields -overwrite
runApplication decomposePar -cellDist
runApplication decomposePar -cellProc
runParallel $application
runApplication reconstructPar

View File

@ -14,7 +14,7 @@ runApplication blockMesh -dict $FOAM_TUTORIALS/resources/blockMesh/ballValve
runApplication createNonConformalCouples -overwrite pipeNonCouple ballNonCouple
# Decompose
runApplication decomposePar -cellDist
runApplication decomposePar -cellProc
# Initialise the velocity field
runParallel potentialFoam -pName p_rgh

View File

@ -9,8 +9,8 @@ runApplication topoSet
runApplication subsetMesh -overwrite c0 -patch floatingObject -noFields
runApplication setFields
runApplication decomposePar -cellDist
runApplication decomposePar -cellProc
runParallel $(getApplication)
runApplication reconstructPar -cellDist
runApplication reconstructPar -cellProc
#------------------------------------------------------------------------------