STYLE: add notes to some (most) command-line options

- mapFields and splitMeshRegions need more clarification
This commit is contained in:
Mark Olesen
2010-04-27 10:50:15 +02:00
parent 5debfe4cdf
commit 147fa2a75d
85 changed files with 1221 additions and 472 deletions

View File

@ -45,14 +45,28 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addNote
(
"add two surfaces via a geometric merge on points."
);
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("Foam surface file");
argList::validArgs.append("Foam surface file");
argList::validArgs.append("Foam output file");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("output surfaceFile");
argList::addOption("points", "pointsFile");
argList::addBoolOption("mergeRegions");
argList::addOption
(
"points",
"file",
"provide additional points"
);
argList::addBoolOption
(
"mergeRegions",
"combine regions from both surfaces"
);
argList args(argc, argv);

View File

@ -47,17 +47,16 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("input surface file");
argList::validArgs.append("output surface file");
argList::validArgs.append("included angle [0..180]");
argList::validArgs.append("input surfaceFile");
argList::validArgs.append("output surfaceFile");
argList::validArgs.append("includedAngle [0..180]");
argList args(argc, argv);
const fileName inFileName = args[1];
const fileName outFileName = args[2];
const scalar includedAngle = args.argRead<scalar>(3);
Info<< "Surface : " << inFileName << nl
<< endl;
Info<< "Surface : " << inFileName << nl << endl;
// Read

View File

@ -175,10 +175,18 @@ int main(int argc, char *argv[])
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("surface file");
argList::validArgs.append("surfaceFile");
argList::addBoolOption("checkSelfIntersection");
argList::addBoolOption("verbose");
argList::addBoolOption
(
"checkSelfIntersection",
"also check for self-intersection"
);
argList::addBoolOption
(
"verbose",
"verbose operation"
);
argList::addBoolOption
(
"blockMesh",
@ -224,8 +232,8 @@ int main(int argc, char *argv[])
<<" hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1)\n"
<<");\n" << nl;
Info<<"edges();" << nl
<<"patches();" << endl;
Info<<"edges\n();" << nl
<<"patches\n();" << endl;
}

View File

@ -48,9 +48,9 @@ int main(int argc, char *argv[])
{
argList::validArgs.clear();
argList::noParallel();
argList::validArgs.append("surface file");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("min length");
argList::validArgs.append("output surface file");
argList::validArgs.append("output surfaceFile");
argList args(argc, argv);
const fileName inFileName = args[1];

View File

@ -65,9 +65,9 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("Foam surface file");
argList::validArgs.append("reduction factor");
argList::validArgs.append("Foam output file");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("reductionFactor");
argList::validArgs.append("output surfaceFile");
argList args(argc, argv);
const fileName inFileName = args[1];

View File

@ -58,14 +58,32 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addNote
(
"convert between surface formats"
);
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("inputFile");
argList::validArgs.append("outputFile");
argList::addBoolOption("clean");
argList::addBoolOption("group");
argList::addOption("scale", "scale");
argList::addBoolOption
(
"clean",
"perform some surface checking/cleanup on the input surface"
);
argList::addBoolOption
(
"group",
"reorder faces into groups; one per region"
);
argList::addOption
(
"scale",
"factor",
"geometry scaling factor - default is 1"
);
argList args(argc, argv);
@ -96,8 +114,7 @@ int main(int argc, char *argv[])
Info<< endl;
}
bool sortByRegion = args.optionFound("group");
const bool sortByRegion = args.optionFound("group");
if (sortByRegion)
{
Info<< "Reordering faces into groups; one per region." << endl;

View File

@ -53,7 +53,7 @@ int main(int argc, char *argv[])
(
"scale",
"factor",
"specify a scaling factor for the points"
"geometry scaling factor - default is 1"
);
argList args(argc, argv);

View File

@ -90,19 +90,53 @@ void deleteBox
int main(int argc, char *argv[])
{
argList::addNote
(
"extract and write surface features to file"
);
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("surface");
argList::validArgs.append("output set");
argList::addOption("includedAngle", "included angle [0..180]");
argList::addOption("set", "input feature set");
argList::addOption
(
"includedAngle",
"degrees",
"construct feature set from included angle [0..180]"
);
argList::addOption
(
"set",
"name",
"use existing feature set from file"
);
argList::addOption
(
"minLen",
"scalar",
"remove features shorter than the specified cumulative length"
);
argList::addOption
(
"minElem",
"int",
"remove features with fewer than the specified number of edges"
);
argList::addOption
(
"subsetBox",
"((x0 y0 z0)(x1 y1 z1))",
"remove edges outside specified bounding box"
);
argList::addOption
(
"deleteBox",
"((x0 y0 z0)(x1 y1 z1))",
"remove edges within specified bounding box"
);
argList::addOption("minLen", "cumulative length of feature");
argList::addOption("minElem", "number of edges in feature");
argList::addOption("subsetBox", "((x0 y0 z0)(x1 y1 z1))");
argList::addOption("deleteBox", "((x0 y0 z0)(x1 y1 z1))");
argList args(argc, argv);
Info<< "Feature line extraction is only valid on closed manifold surfaces."
@ -143,7 +177,7 @@ int main(int argc, char *argv[])
}
else if (args.optionFound("includedAngle"))
{
scalar includedAngle = args.optionRead<scalar>("includedAngle");
const scalar includedAngle = args.optionRead<scalar>("includedAngle");
Info<< "Constructing feature set from included angle " << includedAngle
<< endl;
@ -175,8 +209,6 @@ int main(int argc, char *argv[])
<< endl;
// Trim set
// ~~~~~~~~
@ -200,7 +232,6 @@ int main(int argc, char *argv[])
}
// Subset
// ~~~~~~

View File

@ -45,7 +45,7 @@ int main(int argc, char *argv[])
argList::addOption("y", "Y", "The point y-coordinate (if non-zero)");
argList::addOption("z", "Z", "The point y-coordinate (if non-zero)");
argList::validArgs.append("surface file");
argList::validArgs.append("surfaceFile");
argList args(argc, argv);

View File

@ -289,8 +289,12 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.append("surface file");
argList::addBoolOption("shellProperties");
argList::validArgs.append("surfaceFile");
argList::addBoolOption
(
"shellProperties",
"inertia of a thin shell"
);
argList::addOption
(

View File

@ -71,6 +71,11 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addNote
(
"convert between surface formats"
);
argList::noParallel();
argList::validArgs.append("inputFile");
argList::validArgs.append("outputFile");
@ -83,14 +88,14 @@ int main(int argc, char *argv[])
argList::addOption
(
"scaleIn",
"scale",
"specify input geometry scaling factor"
"factor",
"geometry scaling factor on input"
);
argList::addOption
(
"scaleOut",
"scale",
"specify output geometry scaling factor"
"factor",
"geometry scaling factor on output"
);
argList::addOption
(

View File

@ -71,6 +71,13 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addNote
(
"convert between surface formats, "
"but primarily for testing functionality\n"
"Normally use surfaceMeshConvert instead."
);
argList::noParallel();
argList::validArgs.append("inputFile");
argList::validArgs.append("outputFile");
@ -82,7 +89,12 @@ int main(int argc, char *argv[])
argList::addBoolOption("unsorted");
argList::addBoolOption("triFace");
argList::addOption("scale", "scale");
argList::addOption
(
"scale",
"factor",
"geometry scaling factor - default is 1"
);
# include "setRootCase.H"

View File

@ -48,10 +48,10 @@ Usage
Specify an alternative dictionary for constant/coordinateSystems.
@param -from \<coordinateSystem\> \n
Specify a coordinate System when reading files.
Specify a coordinate system when reading files.
@param -to \<coordinateSystem\> \n
Specify a coordinate System when writing files.
Specify a coordinate system when writing files.
Note
The filename extensions are used to determine the file format type.
@ -72,17 +72,56 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addNote
(
"export from surfMesh to various third-party surface formats"
);
argList::noParallel();
argList::validArgs.append("outputFile");
argList::addBoolOption("clean");
argList::addOption("name", "name");
argList::addOption("scaleIn", "scale");
argList::addOption("scaleOut", "scale");
argList::addOption("dict", "coordinateSystemsDict");
argList::addOption("from", "sourceCoordinateSystem");
argList::addOption("to", "targetCoordinateSystem");
argList::addBoolOption
(
"clean",
"perform some surface checking/cleanup on the input surface"
);
argList::addOption
(
"name",
"name",
"specify an alternative surface name when reading - "
"default is 'default'"
);
argList::addOption
(
"scaleIn",
"factor",
"geometry scaling factor on input - default is 1"
);
argList::addOption
(
"scaleOut",
"factor",
"geometry scaling factor on output - default is 1"
);
argList::addOption
(
"dict",
"file",
"specify an alternative dictionary for constant/coordinateSystems"
);
argList::addOption
(
"from",
"coordinateSystem",
"specify the source coordinate system, applied after '-scaleIn'"
);
argList::addOption
(
"to",
"coordinateSystem",
"specify the target coordinate system, applied before '-scaleOut'"
);
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());

View File

@ -48,10 +48,10 @@ Usage
Specify an alternative dictionary for constant/coordinateSystems.
@param -from \<coordinateSystem\> \n
Specify a coordinate System when reading files.
Specify a coordinate system when reading files.
@param -to \<coordinateSystem\> \n
Specify a coordinate System when writing files.
Specify a coordinate system when writing files.
Note
The filename extensions are used to determine the file format type.
@ -72,20 +72,59 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addNote
(
"import from various third-party surface formats into surfMesh"
);
argList::noParallel();
argList::validArgs.append("inputFile");
argList::addBoolOption("clean");
argList::addBoolOption
(
"clean",
"perform some surface checking/cleanup on the input surface"
);
argList::addOption
(
"name",
"name",
"specify an alternative surface name when writing - "
"default is 'default'"
);
argList::addOption
(
"scaleIn",
"factor",
"geometry scaling factor on input - default is 1"
);
argList::addOption
(
"scaleOut",
"factor",
"geometry scaling factor on output - default is 1"
);
argList::addOption
(
"dict",
"file",
"specify an alternative dictionary for constant/coordinateSystems"
);
argList::addOption
(
"from",
"coordinateSystem",
"specify a local coordinate system when reading files."
);
argList::addOption
(
"to",
"coordinateSystem",
"specify a local coordinate system when writing files."
);
argList::addOption("name", "name");
argList::addOption("scaleIn", "scale");
argList::addOption("scaleOut", "scale");
argList::addOption("dict", "coordinateSystemsDict");
argList::addOption("from", "sourceCoordinateSystem");
argList::addOption("to", "targetCoordinateSystem");
# include "setRootCase.H"
# include "createTime.H"
#include "setRootCase.H"
#include "createTime.H"
// try for the latestTime, but create "constant" as needed
instantList Times = runTime.times();

View File

@ -48,13 +48,26 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addNote
(
"extract surface from a polyMesh and triangulate boundary faces"
);
argList::validArgs.append("output file");
# include "addRegionOption.H"
argList::addBoolOption("excludeProcPatches");
argList::addOption("patches", "(patch0 .. patchN)");
#include "addRegionOption.H"
argList::addBoolOption
(
"excludeProcPatches",
"exclude processor patches"
);
argList::addOption
(
"patches",
"(patch0 .. patchN)",
"only triangulate named patches"
);
# include "setRootCase.H"
# include "createTime.H"
#include "setRootCase.H"
#include "createTime.H"
const fileName outFileName(runTime.path()/args[1]);
@ -63,9 +76,9 @@ int main(int argc, char *argv[])
Pout<< "Reading mesh from time " << runTime.value() << endl;
# include "createNamedPolyMesh.H"
#include "createNamedPolyMesh.H"
bool includeProcPatches =
const bool includeProcPatches =
!(
args.optionFound("excludeProcPatches")
|| Pstream::parRun()

View File

@ -39,12 +39,22 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addNote
(
"set face normals consistent with a user-provided 'outside' point"
);
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("Foam surface file");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("visiblePoint");
argList::validArgs.append("output file");
argList::addBoolOption("inside");
argList::validArgs.append("output surfaceFile");
argList::addBoolOption
(
"inside",
"treat provided point as being inside"
);
argList args(argc, argv);
const fileName surfFileName = args[1];
@ -53,18 +63,18 @@ int main(int argc, char *argv[])
const bool orientInside = args.optionFound("inside");
Info<< "Reading surface from " << surfFileName << endl;
Info<< "Visible point " << visiblePoint << endl;
Info<< "Reading surface from " << surfFileName << nl
<< "Visible point " << visiblePoint << nl
<< "Orienting surface such that visiblePoint " << visiblePoint
<< " is ";
if (orientInside)
{
Info<< "Orienting surface such that visiblePoint " << visiblePoint
<< " is inside" << endl;
Info<< "inside" << endl;
}
else
{
Info<< "Orienting surface such that visiblePoint " << visiblePoint
<< " is outside" << endl;
Info<< "outside" << endl;
}
Info<< "Writing surface to " << outFileName << endl;

View File

@ -43,9 +43,9 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("surface file");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("merge distance");
argList::validArgs.append("output file");
argList::validArgs.append("output surfaceFile");
argList args(argc, argv);
const fileName surfFileName = args[1];

View File

@ -80,7 +80,7 @@ void writeProcStats
{
const List<treeBoundBox>& bbs = meshBb[procI];
Info<< "processor" << procI << endl
Info<< "processor" << procI << nl
<< "\tMesh bounds : " << bbs[0] << nl;
for (label i = 1; i < bbs.size(); i++)
{
@ -99,19 +99,27 @@ void writeProcStats
int main(int argc, char *argv[])
{
argList::addNote
(
"redistribute a triSurface"
);
argList::validArgs.append("triSurfaceMesh");
argList::validArgs.append("distributionType");
argList::addBoolOption
(
"keepNonMapped",
"preserve surface outside of mesh bounds"
);
argList::addBoolOption("keepNonMapped");
# include "setRootCase.H"
# include "createTime.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
const fileName surfFileName = args[1];
const word distType = args[2];
Info<< "Reading surface from " << surfFileName << nl
<< nl
Info<< "Reading surface from " << surfFileName << nl << nl
<< "Using distribution method "
<< distributedTriSurfaceMesh::distributionTypeNames_[distType]
<< " " << distType << nl << endl;
@ -138,7 +146,7 @@ int main(int argc, char *argv[])
}
# include "createPolyMesh.H"
#include "createPolyMesh.H"
Random rndGen(653213);

View File

@ -48,8 +48,8 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("output surfaceFile");
argList args(argc, argv);
const fileName surfFileName = args[1];

View File

@ -43,10 +43,10 @@ int main(int argc, char *argv[])
argList::noParallel();
argList::validOptions.clear();
argList::validArgs.clear();
argList::validArgs.append("surface file");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("underrelax factor (0..1)");
argList::validArgs.append("iterations");
argList::validArgs.append("output file");
argList::validArgs.append("output surfaceFile");
argList args(argc, argv);
const fileName surfFileName = args[1];

View File

@ -36,6 +36,11 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addNote
(
"write surface mesh regions to separate files"
);
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("input file");
@ -104,7 +109,6 @@ int main(int argc, char *argv[])
subSurf.write(outFile);
}
Info<< "End\n" << endl;
return 0;

View File

@ -666,12 +666,20 @@ bool splitBorderEdges
int main(int argc, char *argv[])
{
argList::addNote
(
"split multiply connected surface edges by duplicating points"
);
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::addBoolOption("debug");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("output surfaceFile");
argList::addBoolOption
(
"debug",
"add debugging output"
);
argList args(argc, argv);
@ -679,7 +687,6 @@ int main(int argc, char *argv[])
const fileName outSurfName = args[2];
const bool debug = args.optionFound("debug");
Info<< "Reading surface from " << inSurfName << endl;
triSurface surf(inSurfName);

View File

@ -49,8 +49,8 @@ int main(int argc, char *argv[])
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("surfaceSubsetDict");
argList::validArgs.append("surface file");
argList::validArgs.append("output file");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("output surfaceFile");
argList args(argc, argv);
Info<< "Reading dictionary " << args[1] << " ..." << endl;

View File

@ -163,14 +163,29 @@ bool repatchFace
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("surface file");
argList::addOption("faceSet", "faceSet name");
argList::addOption("tol", "fraction of mesh size");
argList::addNote
(
"reads surface and applies surface regioning to a mesh"
);
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
argList::noParallel();
argList::validArgs.append("surfaceFile");
argList::addOption
(
"faceSet",
"name",
"only repatch the faces in specified faceSet"
);
argList::addOption
(
"tol",
"scalar",
"search tolerance as fraction of mesh size (default 1e-3)"
);
#include "setRootCase.H"
#include "createTime.H"
#include "createPolyMesh.H"
const fileName surfName = args[1];
@ -190,7 +205,7 @@ int main(int argc, char *argv[])
<< " triangle ..." << endl;
}
scalar searchTol = args.optionLookupOrDefault("tol", 1e-3);
const scalar searchTol = args.optionLookupOrDefault("tol", 1e-3);
// Get search box. Anything not within this box will not be considered.
const boundBox& meshBb = mesh.globalData().bb();
@ -212,7 +227,6 @@ int main(int argc, char *argv[])
Info<< endl;
boundaryMesh bMesh;
// Load in the surface.

View File

@ -61,8 +61,8 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::validArgs.clear();
argList::validArgs.append("surface file");
argList::validArgs.append("output surface file");
argList::validArgs.append("surfaceFile");
argList::validArgs.append("output surfaceFile");
argList::addOption
(
"translate",