mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add -verbose option to surface conversion, cleanup
- by default, reduce the amount of output ENH: support default text description for -verbose option - simplifies use in more places.
This commit is contained in:
@ -200,7 +200,7 @@ int main(int argc, char *argv[])
|
||||
// Less frequently used - reduce some clutter
|
||||
argList::setAdvanced("decomposeParDict");
|
||||
|
||||
argList::addVerboseOption("Additional verbosity");
|
||||
argList::addVerboseOption();
|
||||
|
||||
#include "addAllRegionOptions.H"
|
||||
|
||||
|
||||
@ -78,10 +78,7 @@ int main(int argc, char *argv[])
|
||||
"detail",
|
||||
"Additional detail"
|
||||
);
|
||||
argList::addVerboseOption
|
||||
(
|
||||
"Additional verbosity"
|
||||
);
|
||||
argList::addVerboseOption();
|
||||
|
||||
argList::addArgument("lib...");
|
||||
argList::noMandatoryArgs(); // Arguments are optional
|
||||
|
||||
@ -235,10 +235,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
"Report action without moving/renaming"
|
||||
);
|
||||
argList::addVerboseOption
|
||||
(
|
||||
"Additional verbosity"
|
||||
);
|
||||
argList::addVerboseOption();
|
||||
|
||||
// Arguments are optional (non-mandatory)
|
||||
argList::noMandatoryArgs();
|
||||
|
||||
@ -334,7 +334,7 @@ int main(int argc, char *argv[])
|
||||
"Test without writing the decomposition. "
|
||||
"Changes -cellDist to only write VTK output."
|
||||
);
|
||||
argList::addVerboseOption("Additional verbosity");
|
||||
argList::addVerboseOption();
|
||||
argList::addOption
|
||||
(
|
||||
"domains",
|
||||
|
||||
@ -92,7 +92,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "addAllRegionOptions.H"
|
||||
|
||||
argList::addVerboseOption("Additional verbosity");
|
||||
argList::addVerboseOption();
|
||||
argList::addOption
|
||||
(
|
||||
"fields",
|
||||
|
||||
@ -594,7 +594,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
argList::noParallel();
|
||||
|
||||
argList::addVerboseOption("Additional verbosity");
|
||||
argList::addVerboseOption();
|
||||
argList::addBoolOption
|
||||
(
|
||||
"addressing-only",
|
||||
|
||||
@ -1020,7 +1020,7 @@ int main(int argc, char *argv[])
|
||||
#include "addOverwriteOption.H"
|
||||
argList::addBoolOption("decompose", "Decompose case");
|
||||
argList::addBoolOption("reconstruct", "Reconstruct case");
|
||||
argList::addVerboseOption("Additional verbosity");
|
||||
argList::addVerboseOption();
|
||||
argList::addDryRunOption
|
||||
(
|
||||
"Test without writing the decomposition. "
|
||||
|
||||
@ -169,7 +169,7 @@ int main(int argc, char *argv[])
|
||||
// Less frequently used - reduce some clutter
|
||||
argList::setAdvanced("decomposeParDict");
|
||||
|
||||
argList::addVerboseOption("Additional verbosity");
|
||||
argList::addVerboseOption();
|
||||
|
||||
#include "addAllRegionOptions.H"
|
||||
|
||||
|
||||
@ -269,7 +269,7 @@ int main(int argc, char *argv[])
|
||||
// Less frequently used - reduce some clutter
|
||||
argList::setAdvanced("decomposeParDict");
|
||||
|
||||
argList::addVerboseOption("Additional verbosity");
|
||||
argList::addVerboseOption();
|
||||
|
||||
argList::addBoolOption
|
||||
(
|
||||
|
||||
@ -115,7 +115,7 @@ int main(int argc, char *argv[])
|
||||
"The writer format "
|
||||
"(default: vtk or 'setFormat' from dictionary)"
|
||||
);
|
||||
argList::addVerboseOption("Additional verbosity");
|
||||
argList::addVerboseOption();
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
@ -172,7 +172,7 @@ int main(int argc, char *argv[])
|
||||
"file",
|
||||
"Alternative particleTrackDict dictionary"
|
||||
);
|
||||
argList::addVerboseOption("Additional verbosity");
|
||||
argList::addVerboseOption();
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
@ -72,10 +72,7 @@ int main(int argc, char *argv[])
|
||||
"Suppress calculation/display of point interpolators"
|
||||
);
|
||||
|
||||
argList::addVerboseOption
|
||||
(
|
||||
"Additional verbosity"
|
||||
);
|
||||
argList::addVerboseOption();
|
||||
|
||||
#include "addRegionOption.H"
|
||||
#include "setRootCase.H"
|
||||
|
||||
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
argList::noCheckProcessorDirectories();
|
||||
argList::addVerboseOption("Additional verbosity");
|
||||
argList::addVerboseOption();
|
||||
|
||||
argList::addArgument("input", "The input surface file");
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -80,6 +80,7 @@ int main(int argc, char *argv[])
|
||||
"factor",
|
||||
"Geometry scaling factor on input surfaces"
|
||||
);
|
||||
argList::addVerboseOption();
|
||||
|
||||
argList args(argc, argv);
|
||||
|
||||
@ -87,6 +88,7 @@ int main(int argc, char *argv[])
|
||||
const auto inFileName2 = args.get<fileName>(2);
|
||||
const auto outFileName = args.get<fileName>(3);
|
||||
|
||||
const int optVerbose = args.verbose();
|
||||
const bool addPoint = args.found("points");
|
||||
const bool mergeRegions = args.found("mergeRegions");
|
||||
|
||||
@ -284,7 +286,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Merge all common points and do some checks
|
||||
combinedSurf.cleanup(true);
|
||||
combinedSurf.cleanup(optVerbose);
|
||||
|
||||
Info<< "Merged surface:" << endl;
|
||||
|
||||
|
||||
@ -308,10 +308,7 @@ int main(int argc, char *argv[])
|
||||
"Split surface along non-manifold edges "
|
||||
"(default split is fully disconnected)"
|
||||
);
|
||||
argList::addVerboseOption
|
||||
(
|
||||
"Additional verbosity"
|
||||
);
|
||||
argList::addVerboseOption();
|
||||
argList::addBoolOption
|
||||
(
|
||||
"blockMesh",
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -73,6 +73,7 @@ int main(int argc, char *argv[])
|
||||
"Suppress surface checking/cleanup on the input surface"
|
||||
);
|
||||
argList::addOptionCompat("no-clean", {"noClean", -2006});
|
||||
argList::addVerboseOption();
|
||||
|
||||
argList::addOption
|
||||
(
|
||||
@ -87,6 +88,8 @@ int main(int argc, char *argv[])
|
||||
const auto minQuality = args.get<scalar>(3);
|
||||
const auto outFileName = args.get<fileName>(4);
|
||||
|
||||
const int optVerbose = args.verbose();
|
||||
|
||||
Info<< "Reading surface " << inFileName << nl
|
||||
<< "Collapsing all triangles with" << nl
|
||||
<< " edges or heights < " << minLen << nl
|
||||
@ -106,7 +109,7 @@ int main(int argc, char *argv[])
|
||||
if (!args.found("no-clean"))
|
||||
{
|
||||
Info<< "Removing duplicate and illegal triangles ..." << nl << endl;
|
||||
surf.cleanup(true);
|
||||
surf.cleanup(optVerbose);
|
||||
}
|
||||
|
||||
Info<< "Collapsing triangles to edges ..." << nl << endl;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -144,6 +144,7 @@ int main(int argc, char *argv[])
|
||||
"The output precision"
|
||||
);
|
||||
argList::addOptionCompat("precision", {"writePrecision", 1812});
|
||||
argList::addVerboseOption();
|
||||
|
||||
argList args(argc, argv);
|
||||
|
||||
@ -161,6 +162,8 @@ int main(int argc, char *argv[])
|
||||
const auto importName = args.get<fileName>(1);
|
||||
const auto exportName = args.get<fileName>(2);
|
||||
|
||||
const int optVerbose = args.verbose();
|
||||
|
||||
if (importName == exportName)
|
||||
{
|
||||
FatalError
|
||||
@ -207,7 +210,7 @@ int main(int argc, char *argv[])
|
||||
if (args.found("clean"))
|
||||
{
|
||||
Info<< "Cleaning up surface" << endl;
|
||||
surf.cleanup(true);
|
||||
surf.cleanup(optVerbose);
|
||||
|
||||
Info<< "After cleaning up surface:" << endl;
|
||||
surf.writeStats(Info);
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -127,6 +127,7 @@ int main(int argc, char *argv[])
|
||||
"clean",
|
||||
"Perform some surface checking/cleanup on the input surface"
|
||||
);
|
||||
argList::addVerboseOption();
|
||||
argList::addOption
|
||||
(
|
||||
"read-format",
|
||||
@ -177,13 +178,14 @@ int main(int argc, char *argv[])
|
||||
"Triangulate surface"
|
||||
);
|
||||
|
||||
|
||||
argList args(argc, argv);
|
||||
Time runTime(args.rootPath(), args.caseName());
|
||||
|
||||
const auto importName = args.get<fileName>(1);
|
||||
const auto exportName = args.get<fileName>(2);
|
||||
|
||||
const int optVerbose = args.verbose();
|
||||
|
||||
if (importName == exportName)
|
||||
{
|
||||
FatalError
|
||||
@ -298,7 +300,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (args.found("clean"))
|
||||
{
|
||||
surf.cleanup(true);
|
||||
surf.cleanup(optVerbose);
|
||||
}
|
||||
|
||||
if (fromCsys)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -105,6 +105,7 @@ int main(int argc, char *argv[])
|
||||
"clean",
|
||||
"Perform some surface checking/cleanup on the input surface"
|
||||
);
|
||||
argList::addVerboseOption();
|
||||
argList::addOption
|
||||
(
|
||||
"name",
|
||||
@ -157,6 +158,8 @@ int main(int argc, char *argv[])
|
||||
const auto exportName = args.get<fileName>(1);
|
||||
const auto importName = args.getOrDefault<word>("name", "default");
|
||||
|
||||
const int optVerbose = args.verbose();
|
||||
|
||||
const word writeFileType
|
||||
(
|
||||
args.getOrDefault<word>("write-format", getExtension(exportName))
|
||||
@ -273,7 +276,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (args.found("clean"))
|
||||
{
|
||||
surf.cleanup(true);
|
||||
surf.cleanup(optVerbose);
|
||||
}
|
||||
|
||||
if (fromCsys)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -105,6 +105,7 @@ int main(int argc, char *argv[])
|
||||
"clean",
|
||||
"Perform some surface checking/cleanup on the input surface"
|
||||
);
|
||||
argList::addVerboseOption();
|
||||
argList::addOption
|
||||
(
|
||||
"name",
|
||||
@ -169,6 +170,8 @@ int main(int argc, char *argv[])
|
||||
const auto importName = args.get<fileName>(1);
|
||||
const auto exportName = args.getOrDefault<word>("name", "default");
|
||||
|
||||
const int optVerbose = args.verbose();
|
||||
|
||||
const word readFileType
|
||||
(
|
||||
args.getOrDefault<word>("read-format", getExtension(importName))
|
||||
@ -268,7 +271,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (args.found("clean"))
|
||||
{
|
||||
surf.cleanup(true);
|
||||
surf.cleanup(optVerbose);
|
||||
}
|
||||
|
||||
if (fromCsys)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -514,7 +514,14 @@ void Foam::argList::addVerboseOption
|
||||
bool advanced
|
||||
)
|
||||
{
|
||||
argList::addBoolOption("verbose", usage, advanced);
|
||||
if (usage.empty())
|
||||
{
|
||||
argList::addBoolOption("verbose", "Additional verbosity", advanced);
|
||||
}
|
||||
else
|
||||
{
|
||||
argList::addBoolOption("verbose", usage, advanced);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -628,7 +628,7 @@ public:
|
||||
//- Enable a 'verbose' bool option, with usage information
|
||||
static void addVerboseOption
|
||||
(
|
||||
const string& usage, //! usage information (expected)
|
||||
const string& usage = "", //! usage information (optional)
|
||||
bool advanced = false
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user