mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: -no-finite-area, -no-lagrangian options for some parallel utils
This commit is contained in:
@ -351,6 +351,20 @@ int main(int argc, char *argv[])
|
|||||||
true // Advanced option
|
true // Advanced option
|
||||||
);
|
);
|
||||||
|
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"no-finite-area",
|
||||||
|
"Suppress finiteArea mesh/field decomposition",
|
||||||
|
true // Advanced option
|
||||||
|
);
|
||||||
|
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"no-lagrangian",
|
||||||
|
"Suppress lagrangian (cloud) decomposition",
|
||||||
|
true // Advanced option
|
||||||
|
);
|
||||||
|
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"cellDist",
|
"cellDist",
|
||||||
@ -372,11 +386,14 @@ int main(int argc, char *argv[])
|
|||||||
"fields",
|
"fields",
|
||||||
"Use existing geometry decomposition and convert fields only"
|
"Use existing geometry decomposition and convert fields only"
|
||||||
);
|
);
|
||||||
|
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"noSets",
|
"no-sets",
|
||||||
"Skip decomposing cellSets, faceSets, pointSets"
|
"Skip decomposing cellSets, faceSets, pointSets"
|
||||||
);
|
);
|
||||||
|
argList::addOptionCompat("no-sets", {"noSets", 2106});
|
||||||
|
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"force",
|
"force",
|
||||||
@ -400,9 +417,13 @@ int main(int argc, char *argv[])
|
|||||||
// Most of these are ignored for dry-run (not triggered anywhere)
|
// Most of these are ignored for dry-run (not triggered anywhere)
|
||||||
const bool copyZero = args.found("copyZero");
|
const bool copyZero = args.found("copyZero");
|
||||||
const bool copyUniform = args.found("copyUniform");
|
const bool copyUniform = args.found("copyUniform");
|
||||||
const bool decomposeSets = !args.found("noSets");
|
const bool decomposeSets = !args.found("no-sets");
|
||||||
|
|
||||||
const bool decomposeIfRequired = args.found("ifRequired");
|
const bool decomposeIfRequired = args.found("ifRequired");
|
||||||
|
|
||||||
|
const bool doFiniteArea = !args.found("no-finite-area");
|
||||||
|
const bool doLagrangian = !args.found("no-lagrangian");
|
||||||
|
|
||||||
bool decomposeFieldsOnly = args.found("fields");
|
bool decomposeFieldsOnly = args.found("fields");
|
||||||
bool forceOverwrite = args.found("force");
|
bool forceOverwrite = args.found("force");
|
||||||
|
|
||||||
@ -419,6 +440,15 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!doFiniteArea)
|
||||||
|
{
|
||||||
|
Info<< "Skip decompose of finiteArea mesh/fields" << nl;
|
||||||
|
}
|
||||||
|
if (!doLagrangian)
|
||||||
|
{
|
||||||
|
Info<< "Skip decompose of lagrangian positions/fields" << nl;
|
||||||
|
}
|
||||||
|
|
||||||
times = timeSelector::selectIfPresent(runTime, args);
|
times = timeSelector::selectIfPresent(runTime, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,14 +822,16 @@ int main(int argc, char *argv[])
|
|||||||
// Construct the Lagrangian fields
|
// Construct the Lagrangian fields
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
fileNameList cloudDirs
|
fileNameList cloudDirs;
|
||||||
(
|
|
||||||
fileHandler().readDir
|
if (doLagrangian)
|
||||||
|
{
|
||||||
|
cloudDirs = fileHandler().readDir
|
||||||
(
|
(
|
||||||
runTime.timePath()/cloud::prefix,
|
runTime.timePath()/cloud::prefix,
|
||||||
fileName::DIRECTORY
|
fileName::DIRECTORY
|
||||||
)
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
// Particles
|
// Particles
|
||||||
PtrList<Cloud<indexedParticle>> lagrangianPositions
|
PtrList<Cloud<indexedParticle>> lagrangianPositions
|
||||||
@ -1375,7 +1407,11 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if (faMeshBoundaryIOobj.typeHeaderOk<faBoundaryMesh>(true))
|
if
|
||||||
|
(
|
||||||
|
doFiniteArea
|
||||||
|
&& faMeshBoundaryIOobj.typeHeaderOk<faBoundaryMesh>(true)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Info<< "\nFinite area mesh decomposition" << endl;
|
Info<< "\nFinite area mesh decomposition" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -101,9 +101,10 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"noFields",
|
"no-fields", // noFields
|
||||||
"Skip reconstructing fields"
|
"Skip reconstructing fields"
|
||||||
);
|
);
|
||||||
|
argList::addOptionCompat("no-fields", {"noFields", 2106});
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"lagrangianFields",
|
"lagrangianFields",
|
||||||
@ -115,15 +116,18 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"noLagrangian",
|
"no-lagrangian", // noLagrangian
|
||||||
"Skip reconstructing lagrangian positions and fields"
|
"Skip reconstructing lagrangian positions and fields"
|
||||||
);
|
);
|
||||||
|
argList::addOptionCompat("no-lagrangian", {"noLagrangian", 2106});
|
||||||
|
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"noSets",
|
"no-sets",
|
||||||
"Skip reconstructing cellSets, faceSets, pointSets"
|
"Skip reconstructing cellSets, faceSets, pointSets"
|
||||||
);
|
);
|
||||||
|
argList::addOptionCompat("no-sets", {"noSets", 2106});
|
||||||
|
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"newTimes",
|
"newTimes",
|
||||||
@ -134,32 +138,54 @@ int main(int argc, char *argv[])
|
|||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
|
|
||||||
|
const bool doFields = !args.found("no-fields");
|
||||||
wordRes selectedFields;
|
wordRes selectedFields;
|
||||||
args.readListIfPresent<wordRe>("fields", selectedFields);
|
|
||||||
|
|
||||||
const bool doFields = !args.found("noFields");
|
if (doFields)
|
||||||
|
|
||||||
if (!doFields)
|
|
||||||
{
|
{
|
||||||
Info<< "Skipping reconstructing fields"
|
args.readListIfPresent<wordRe>("fields", selectedFields);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "Skipping reconstructing fields";
|
||||||
|
if (args.found("fields"))
|
||||||
|
{
|
||||||
|
Info<< ". Ignore -fields option";
|
||||||
|
}
|
||||||
|
Info<< nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const bool doFiniteArea = !args.found("no-finite-area");
|
||||||
|
if (!doFiniteArea)
|
||||||
|
{
|
||||||
|
Info<< "Skipping reconstructing finiteArea mesh/fields"
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const bool doLagrangian = !args.found("no-lagrangian");
|
||||||
wordRes selectedLagrangianFields;
|
wordRes selectedLagrangianFields;
|
||||||
args.readListIfPresent<wordRe>
|
|
||||||
(
|
|
||||||
"lagrangianFields", selectedLagrangianFields
|
|
||||||
);
|
|
||||||
|
|
||||||
const bool doLagrangian = !args.found("noLagrangian");
|
if (doLagrangian)
|
||||||
|
|
||||||
if (!doLagrangian)
|
|
||||||
{
|
{
|
||||||
Info<< "Skipping reconstructing lagrangian positions and fields"
|
args.readListIfPresent<wordRe>
|
||||||
<< nl << endl;
|
(
|
||||||
|
"lagrangianFields", selectedLagrangianFields
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "Skipping reconstructing lagrangian positions/fields";
|
||||||
|
if (args.found("lagrangianFields"))
|
||||||
|
{
|
||||||
|
Info<< ". Ignore -lagrangianFields option";
|
||||||
|
}
|
||||||
|
Info<< nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool doReconstructSets = !args.found("noSets");
|
|
||||||
|
const bool doReconstructSets = !args.found("no-sets");
|
||||||
|
|
||||||
if (!doReconstructSets)
|
if (!doReconstructSets)
|
||||||
{
|
{
|
||||||
@ -692,7 +718,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// If there are any FA fields, reconstruct them
|
// If there are any FA fields, reconstruct them
|
||||||
|
|
||||||
if
|
if (!doFiniteArea)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else if
|
||||||
(
|
(
|
||||||
objects.lookupClass(areaScalarField::typeName).size()
|
objects.lookupClass(areaScalarField::typeName).size()
|
||||||
|| objects.lookupClass(areaVectorField::typeName).size()
|
|| objects.lookupClass(areaVectorField::typeName).size()
|
||||||
|
|||||||
@ -202,11 +202,13 @@ int main(int argc, char *argv[])
|
|||||||
"Specify single or multiple fields to reconstruct (all by default)."
|
"Specify single or multiple fields to reconstruct (all by default)."
|
||||||
" Eg, 'T' or '(p T U \"alpha.*\")'"
|
" Eg, 'T' or '(p T U \"alpha.*\")'"
|
||||||
);
|
);
|
||||||
|
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"noLagrangian",
|
"no-lagrangian", // noLagrangian
|
||||||
"Skip mapping lagrangian positions and fields"
|
"Skip mapping lagrangian positions and fields"
|
||||||
);
|
);
|
||||||
|
argList::addOptionCompat("no-lagrangian", {"noLagrangian", 2106});
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
#include "foamDlOpenLibs.H"
|
#include "foamDlOpenLibs.H"
|
||||||
@ -291,7 +293,7 @@ int main(int argc, char *argv[])
|
|||||||
// Non-mandatory
|
// Non-mandatory
|
||||||
const wordRes selectedFields(args.getList<wordRe>("fields", false));
|
const wordRes selectedFields(args.getList<wordRe>("fields", false));
|
||||||
|
|
||||||
const bool noLagrangian = args.found("noLagrangian");
|
const bool noLagrangian = args.found("no-lagrangian");
|
||||||
|
|
||||||
#include "createTimes.H"
|
#include "createTimes.H"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user