Surface utilities: standardised argument naming and ordering

for input and output surface files
This commit is contained in:
Chris Greenshields
2017-05-12 14:43:10 +01:00
parent 3aec2ad4ac
commit da6b1bf361
29 changed files with 101 additions and 105 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -53,9 +53,9 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("output surfaceFile");
argList::validArgs.append("surface file");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::addOption
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,8 +45,8 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("input surfaceFile");
argList::validArgs.append("output surfaceFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::validArgs.append("includedAngle [0..180]");
argList args(argc, argv);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -395,9 +395,9 @@ void calcFeaturePoints(const pointField& points, const edgeList& edges)
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("surface file");
argList::validArgs.append("surface file");
argList::validArgs.append("action");
argList::validArgs.append("surface file");
argList::validArgs.append("surface file");
argList::addBoolOption
(
@ -428,7 +428,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
word action(args.args()[1]);
word action(args.args()[3]);
HashTable<booleanSurface::booleanOpType> validActions;
validActions.insert("intersection", booleanSurface::INTERSECTION);
@ -442,7 +442,7 @@ int main(int argc, char *argv[])
<< "Supported actions:" << validActions.toc() << abort(FatalError);
}
fileName surf1Name(args.args()[2]);
fileName surf1Name = args[1];
Info<< "Reading surface " << surf1Name << endl;
triSurface surf1(surf1Name);
@ -450,7 +450,7 @@ int main(int argc, char *argv[])
surf1.writeStats(Info);
Info<< endl;
fileName surf2Name(args[3]);
fileName surf2Name = args[2];
Info<< "Reading surface " << surf2Name << endl;
triSurface surf2(surf2Name);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -172,7 +172,7 @@ labelList countBins
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surface file");
argList::addBoolOption
(
"checkSelfIntersection",

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,10 +47,10 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::validArgs.append("min length");
argList::validArgs.append("min quality");
argList::validArgs.append("output surfaceFile");
argList::addBoolOption
(
"noClean",
@ -59,9 +59,9 @@ int main(int argc, char *argv[])
argList args(argc, argv);
const fileName inFileName = args[1];
const scalar minLen = args.argRead<scalar>(2);
const scalar minQuality = args.argRead<scalar>(3);
const fileName outFileName = args[4];
const fileName outFileName = args[2];
const scalar minLen = args.argRead<scalar>(3);
const scalar minQuality = args.argRead<scalar>(4);
Info<< "Reading surface " << inFileName << nl
<< "Collapsing all triangles with" << nl

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,14 +66,14 @@ int mapVertex(::List<int>& collapse_map, int a, int mx)
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::validArgs.append("reductionFactor");
argList::validArgs.append("output surfaceFile");
argList args(argc, argv);
const fileName inFileName = args[1];
const scalar reduction = args.argRead<scalar>(2);
const fileName outFileName = args[3];
const fileName outFileName = args[2];
const scalar reduction = args.argRead<scalar>(3);
if (reduction <= 0 || reduction > 1)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -65,8 +65,8 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("inputFile");
argList::validArgs.append("outputFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::addBoolOption
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,8 +46,8 @@ int main(int argc, char *argv[])
"Convert between edgeMesh formats"
);
argList::noParallel();
argList::validArgs.append("inputFile");
argList::validArgs.append("outputFile");
argList::validArgs.append("edge file");
argList::validArgs.append("output edge file");
argList::addOption
(
"scale",

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,7 +42,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surface file");
argList::addOption("x", "X", "The point x-coordinate (if non-zero)");
argList::addOption("y", "Y", "The point y-coordinate (if non-zero)");
argList::addOption("z", "Z", "The point y-coordinate (if non-zero)");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surface file");
argList::addBoolOption
(
"shellProperties",

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -130,11 +130,11 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.clear();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::validArgs.append("lambda (0..1)");
argList::validArgs.append("mu (0..1)");
argList::validArgs.append("iterations");
argList::validArgs.append("output surfaceFile");
argList::addOption
(
"featureFile",
@ -143,10 +143,10 @@ int main(int argc, char *argv[])
argList args(argc, argv);
const fileName surfFileName = args[1];
const scalar lambda = args.argRead<scalar>(2);
const scalar mu = args.argRead<scalar>(3);
const label iters = args.argRead<label>(4);
const fileName outFileName = args[5];
const fileName outFileName = args[2];
const scalar lambda = args.argRead<scalar>(3);
const scalar mu = args.argRead<scalar>(4);
const label iters = args.argRead<label>(5);
if (lambda < 0 || lambda > 1)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -76,8 +76,8 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("inputFile");
argList::validArgs.append("outputFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::addBoolOption
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,8 +78,8 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("inputFile");
argList::validArgs.append("outputFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::addBoolOption("clean");
argList::addBoolOption("orient");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,7 +77,7 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("outputFile");
argList::validArgs.append("output surface file");
argList::addBoolOption
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,7 +77,7 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("inputFile");
argList::validArgs.append("surface file");
argList::addBoolOption
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,7 +75,7 @@ int main(int argc, char *argv[])
argList::noBanner();
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surface file");
argList::addOption
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,7 +60,7 @@ int main(int argc, char *argv[])
(
"extract surface from a polyMesh"
);
argList::validArgs.append("output file");
argList::validArgs.append("output surface file");
#include "addRegionOption.H"
argList::addBoolOption
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,9 +47,9 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::validArgs.append("visiblePoint");
argList::validArgs.append("output surfaceFile");
argList::addBoolOption
(
"inside",
@ -64,8 +64,8 @@ int main(int argc, char *argv[])
argList args(argc, argv);
const fileName surfFileName = args[1];
const point visiblePoint = args.argRead<point>(2);
const fileName outFileName = args[3];
const fileName outFileName = args[2];
const point visiblePoint = args.argRead<point>(3);
const bool orientInside = args.optionFound("inside");
const bool usePierceTest = args.optionFound("usePierceTest");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,14 +44,14 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::validArgs.append("merge distance");
argList::validArgs.append("output surfaceFile");
argList args(argc, argv);
const fileName surfFileName = args[1];
const scalar mergeTol = args.argRead<scalar>(2);
const fileName outFileName = args[3];
const fileName outFileName = args[2];
const scalar mergeTol = args.argRead<scalar>(3);
Info<< "Reading surface from " << surfFileName << " ..." << endl;
Info<< "Merging points within " << mergeTol << " metre." << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -103,8 +103,8 @@ int main(int argc, char *argv[])
"redistribute a triSurface"
);
argList::validArgs.append("triSurfaceMesh");
argList::validArgs.append("distributionType");
argList::validArgs.append("surface file");
argList::validArgs.append("distribution type");
argList::addBoolOption
(
"keepNonMapped",

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,8 +46,8 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("output surfaceFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList args(argc, argv);
const fileName surfFileName = args[1];

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,7 +44,7 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("input surfaceFile");
argList::validArgs.append("surface file");
argList args(argc, argv);
const fileName surfName = args[1];

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,7 +40,7 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.clear();
argList::validArgs.append("input surface file");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList args(argc, argv);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -671,8 +671,8 @@ int main(int argc, char *argv[])
"split multiply connected surface edges by duplicating points"
);
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("output surfaceFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::addBoolOption
(
"debug",

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,19 +51,19 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::validArgs.append("surfaceSubsetDict");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("output surfaceFile");
argList args(argc, argv);
Info<< "Reading dictionary " << args[1] << " ..." << endl;
IFstream dictFile(args[1]);
Info<< "Reading dictionary " << args[3] << " ..." << endl;
IFstream dictFile(args[3]);
dictionary meshSubsetDict(dictFile);
Info<< "Reading surface " << args[2] << " ..." << endl;
triSurface surf1(args[2]);
Info<< "Reading surface " << args[1] << " ..." << endl;
triSurface surf1(args[1]);
const fileName outFileName(args[3]);
const fileName outFileName = args[2];
Info<< "Original:" << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -172,7 +172,7 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surface file");
argList::addOption
(
"faceSet",

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -62,8 +62,8 @@ int main(int argc, char *argv[])
"Like transformPoints but for surfaces."
);
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::validArgs.append("output surfaceFile");
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::addOption
(
"translate",