mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: make foamToVTK faceZone writing explicit (closes #1117)
- change previous default (convert all faceZones unless -noFaceZones specified) with the default behaviour to only convert face zones on request. - uses the '-faceZones' option as per foamToEnsight
This commit is contained in:
@ -61,7 +61,7 @@ Usage
|
|||||||
- \par -patches patch or patch list
|
- \par -patches patch or patch list
|
||||||
Specify particular patches to write.
|
Specify particular patches to write.
|
||||||
|
|
||||||
- \par -faceZones patch or zone list
|
- \par -faceZones zone or zone list
|
||||||
Specify faceZones to write, with wildcards
|
Specify faceZones to write, with wildcards
|
||||||
|
|
||||||
- \par -cellZone zoneName
|
- \par -cellZone zoneName
|
||||||
|
|||||||
@ -149,7 +149,7 @@ Description
|
|||||||
|
|
||||||
// Write faceZones (POLYDATA file, one for each zone)
|
// Write faceZones (POLYDATA file, one for each zone)
|
||||||
|
|
||||||
if (doFaceZones && !mesh.faceZones().empty())
|
if (!selectedFaceZones.empty() && !mesh.faceZones().empty())
|
||||||
{
|
{
|
||||||
if (nSurfaceScalarField == -1)
|
if (nSurfaceScalarField == -1)
|
||||||
{
|
{
|
||||||
@ -187,6 +187,11 @@ Description
|
|||||||
|
|
||||||
for (const faceZone& fz : mesh.faceZones())
|
for (const faceZone& fz : mesh.faceZones())
|
||||||
{
|
{
|
||||||
|
if (!selectedFaceZones.match(fz.name()))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
indirectPrimitivePatch pp
|
indirectPrimitivePatch pp
|
||||||
(
|
(
|
||||||
IndirectList<face>(mesh.faces(), fz),
|
IndirectList<face>(mesh.faces(), fz),
|
||||||
|
|||||||
@ -70,6 +70,10 @@ Usage
|
|||||||
- \par -pointSet \<name\>
|
- \par -pointSet \<name\>
|
||||||
Restrict conversion to the faceSet or pointSet.
|
Restrict conversion to the faceSet or pointSet.
|
||||||
|
|
||||||
|
- \par -faceZones zone or zone list
|
||||||
|
Specify single faceZone or or multiple faceZones (name or regex)
|
||||||
|
to write
|
||||||
|
|
||||||
- \par -nearCellValue
|
- \par -nearCellValue
|
||||||
Output cell value on patches instead of patch value itself
|
Output cell value on patches instead of patch value itself
|
||||||
|
|
||||||
@ -85,9 +89,6 @@ Usage
|
|||||||
- \par -no-point-data
|
- \par -no-point-data
|
||||||
Suppress conversion of pointFields. No interpolated PointData.
|
Suppress conversion of pointFields. No interpolated PointData.
|
||||||
|
|
||||||
- \par -noFaceZones
|
|
||||||
Suppress conversion of surface fields on faceZones
|
|
||||||
|
|
||||||
- \par -poly-decomp
|
- \par -poly-decomp
|
||||||
Decompose polyhedral cells into tets/pyramids
|
Decompose polyhedral cells into tets/pyramids
|
||||||
|
|
||||||
@ -308,6 +309,13 @@ int main(int argc, char *argv[])
|
|||||||
"Convert specified pointSet only",
|
"Convert specified pointSet only",
|
||||||
true // mark as an advanced option
|
true // mark as an advanced option
|
||||||
);
|
);
|
||||||
|
argList::addOption
|
||||||
|
(
|
||||||
|
"faceZones",
|
||||||
|
"wordRes",
|
||||||
|
"Specify single or multiple faceZones to write\n"
|
||||||
|
"Eg, 'cells' or '( slice \"mfp-.*\" )'."
|
||||||
|
);
|
||||||
|
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
@ -397,12 +405,10 @@ int main(int argc, char *argv[])
|
|||||||
" Eg, 'outlet' or '( inlet \".*Wall\" )'",
|
" Eg, 'outlet' or '( inlet \".*Wall\" )'",
|
||||||
true // mark as an advanced option
|
true // mark as an advanced option
|
||||||
);
|
);
|
||||||
|
argList::ignoreOptionCompat
|
||||||
argList::addBoolOption
|
|
||||||
(
|
(
|
||||||
"noFaceZones",
|
{"noFaceZones", 1806}, // faceZones are only enabled on demand
|
||||||
"Suppress conversion of surface fields on faceZones",
|
false // bool option, no argument
|
||||||
true // mark as an advanced option
|
|
||||||
);
|
);
|
||||||
argList::ignoreOptionCompat
|
argList::ignoreOptionCompat
|
||||||
(
|
(
|
||||||
@ -435,7 +441,6 @@ int main(int argc, char *argv[])
|
|||||||
const bool doFiniteArea = args.found("finiteAreaFields");
|
const bool doFiniteArea = args.found("finiteAreaFields");
|
||||||
const bool doSurfaceFields = args.found("surfaceFields");
|
const bool doSurfaceFields = args.found("surfaceFields");
|
||||||
|
|
||||||
const bool doFaceZones = !args.found("noFaceZones") && doInternal;
|
|
||||||
const bool oneBoundary = args.found("one-boundary") && doBoundary;
|
const bool oneBoundary = args.found("one-boundary") && doBoundary;
|
||||||
const bool nearCellValue = args.found("nearCellValue") && doBoundary;
|
const bool nearCellValue = args.found("nearCellValue") && doBoundary;
|
||||||
const bool allRegions = args.found("allRegions");
|
const bool allRegions = args.found("allRegions");
|
||||||
@ -471,10 +476,14 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Can be specified as empty (ie, no fields)
|
||||||
wordRes selectedFields;
|
wordRes selectedFields;
|
||||||
const bool useFieldFilter =
|
const bool useFieldFilter =
|
||||||
args.readListIfPresent<wordRe>("fields", selectedFields);
|
args.readListIfPresent<wordRe>("fields", selectedFields);
|
||||||
|
|
||||||
|
// Non-mandatory
|
||||||
|
const wordRes selectedFaceZones(args.getList<wordRe>("faceZones", false));
|
||||||
|
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
|
|||||||
@ -96,7 +96,7 @@ _of_complete_cache_[foamToGMV]="-case -decomposeParDict -fileHandler | -listFunc
|
|||||||
_of_complete_cache_[foamToStarMesh]="-case -fileHandler -scale -time | -constant -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -noBnd -noFunctionObjects -noZero -doc -doc-source -help"
|
_of_complete_cache_[foamToStarMesh]="-case -fileHandler -scale -time | -constant -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -noBnd -noFunctionObjects -noZero -doc -doc-source -help"
|
||||||
_of_complete_cache_[foamToSurface]="-case -fileHandler -scale -time | -constant -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -noFunctionObjects -noZero -tri -doc -doc-source -help"
|
_of_complete_cache_[foamToSurface]="-case -fileHandler -scale -time | -constant -latestTime -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -noFunctionObjects -noZero -tri -doc -doc-source -help"
|
||||||
_of_complete_cache_[foamToTetDualMesh]="-case -decomposeParDict -fileHandler -time | -constant -latestTime -listFunctionObjects -listRegisteredSwitches -listScalarBCs -listSwitches -listUnsetSwitches -listVectorBCs -noFunctionObjects -noZero -overwrite -parallel -doc -doc-source -help"
|
_of_complete_cache_[foamToTetDualMesh]="-case -decomposeParDict -fileHandler -time | -constant -latestTime -listFunctionObjects -listRegisteredSwitches -listScalarBCs -listSwitches -listUnsetSwitches -listVectorBCs -noFunctionObjects -noZero -overwrite -parallel -doc -doc-source -help"
|
||||||
_of_complete_cache_[foamToVTK]="-case -cellSet -cellZone -decomposeParDict -excludePatches -faceSet -fields -fileHandler -name -patches -pointSet -region -regions -time | -allRegions -ascii -constant -finiteAreaFields -latestTime -legacy -listFunctionObjects -listRegisteredSwitches -listScalarBCs -listSwitches -listUnsetSwitches -listVectorBCs -nearCellValue -no-boundary -no-internal -no-lagrangian -no-point-data -noFaceZones -noFunctionObjects -noZero -one-boundary -overwrite -parallel -poly-decomp -surfaceFields -doc -doc-source -help"
|
_of_complete_cache_[foamToVTK]="-case -cellSet -cellZone -decomposeParDict -excludePatches -faceSet -faceZones -fields -fileHandler -name -patches -pointSet -region -regions -time | -allRegions -ascii -constant -finiteAreaFields -latestTime -legacy -listFunctionObjects -listRegisteredSwitches -listScalarBCs -listSwitches -listUnsetSwitches -listVectorBCs -nearCellValue -no-boundary -no-internal -no-lagrangian -no-point-data -noFunctionObjects -noZero -one-boundary -overwrite -parallel -poly-decomp -surfaceFields -doc -doc-source -help"
|
||||||
_of_complete_cache_[foamUpgradeCyclics]="-case -decomposeParDict -fileHandler -region -time | -constant -dry-run -enableFunctionEntries -latestTime -listFunctionObjects -listRegisteredSwitches -listScalarBCs -listSwitches -listUnsetSwitches -listVectorBCs -noFunctionObjects -noZero -parallel -doc -doc-source -help"
|
_of_complete_cache_[foamUpgradeCyclics]="-case -decomposeParDict -fileHandler -region -time | -constant -dry-run -enableFunctionEntries -latestTime -listFunctionObjects -listRegisteredSwitches -listScalarBCs -listSwitches -listUnsetSwitches -listVectorBCs -noFunctionObjects -noZero -parallel -doc -doc-source -help"
|
||||||
_of_complete_cache_[foamyHexMesh]="-case -decomposeParDict -fileHandler | -checkGeometry -conformationOnly -listFunctionObjects -listRegisteredSwitches -listScalarBCs -listSwitches -listUnsetSwitches -listVectorBCs -parallel -doc -doc-source -help"
|
_of_complete_cache_[foamyHexMesh]="-case -decomposeParDict -fileHandler | -checkGeometry -conformationOnly -listFunctionObjects -listRegisteredSwitches -listScalarBCs -listSwitches -listUnsetSwitches -listVectorBCs -parallel -doc -doc-source -help"
|
||||||
_of_complete_cache_[foamyQuadMesh]="-case -fileHandler -pointsFile | -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -noFunctionObjects -overwrite -doc -doc-source -help"
|
_of_complete_cache_[foamyQuadMesh]="-case -fileHandler -pointsFile | -listFunctionObjects -listRegisteredSwitches -listSwitches -listUnsetSwitches -noFunctionObjects -overwrite -doc -doc-source -help"
|
||||||
|
|||||||
Reference in New Issue
Block a user