Commit 10c2f6be authored by Andrew Heather's avatar Andrew Heather
Browse files
parents 287fd398 8edf105c
......@@ -14,11 +14,10 @@
General Public License terms under which you can copy the files.
* System requirements
OpenFOAM is developed and tested on Linux, but should work with other Unix
style systems. To check your system setup, execute the foamSystemCheck script
in the bin/ directory of the OpenFOAM installation. If no problems are
reported, proceed to "3. Installation"; otherwise contact your system
administrator.
OpenFOAM is developed and tested on Linux, but should work with other POSIX
systems. To check your system setup, execute the foamSystemCheck script in
the bin/ directory of the OpenFOAM installation. If no problems are reported,
proceed to "3. Installation"; otherwise contact your system administrator.
If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the
section "Running OpenFOAM in 32-bit mode".
......
......@@ -47,11 +47,7 @@
);
word kinematicCloudName("kinematicCloud");
if (args.options().found("cloudName"))
{
kinematicCloudName = args.options()["cloudName"];
}
args.optionReadIfPresent("cloudName", kinematicCloudName);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicCloud kinematicCloud
......
......@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
U.write();
phi.write();
if (args.options().found("writep"))
if (args.optionFound("writep"))
{
p.write();
}
......
......@@ -29,6 +29,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "OSspecific.H"
#include "argList.H"
#include "wordReList.H"
#include "IOstreams.H"
#include "IStringStream.H"
......@@ -38,11 +40,21 @@ Description
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.insert("reList", "reList");
argList::validOptions.insert("wordList", "wordList");
argList::validOptions.insert("stringList", "stringList");
argList::validOptions.insert("float", "xx");
argList::validOptions.insert("flag", "");
# include "setRootCase.H"
List<vector> list1(IStringStream("1 ((0 1 2))")());
Info<< "list1: " << list1 << endl;
......@@ -69,6 +81,43 @@ int main(int argc, char *argv[])
Info<< "Elements " << map << " out of " << list3
<< " => " << subList3 << endl;
wordReList reLst;
wordList wLst;
stringList sLst;
scalar xxx(-1);
if (args.optionFound("flag"))
{
Info<<"-flag:" << args.option("flag") << endl;
}
if (args.optionReadIfPresent<scalar>("float", xxx))
{
Info<<"read float " << xxx << endl;
}
if (args.optionFound("reList"))
{
reLst = args.optionReadList<wordRe>("reList");
}
if (args.optionFound("wordList"))
{
wLst = args.optionReadList<word>("wordList");
}
if (args.optionFound("stringList"))
{
sLst = args.optionReadList<string>("stringList");
}
Info<< nl
<< "-reList: " << reLst << nl
<< "-wordList: " << wLst << nl
<< "-stringList: " << sLst << endl;
return 0;
}
......
POSIXTest.C
EXE = $(FOAM_USER_APPBIN)/POSIXTest
UnixTest.C
EXE = $(FOAM_USER_APPBIN)/UnixTest
......@@ -465,7 +465,7 @@ int main(int argc, char *argv[])
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
bool overwrite = args.options().found("overwrite");
bool overwrite = args.optionFound("overwrite");
scalar maxCos = Foam::cos(angle*180/mathematicalConstant::pi);
......
......@@ -448,19 +448,12 @@ int main(int argc, char *argv[])
scalar minCos = Foam::cos(featureAngle*mathematicalConstant::pi/180.0);
scalar concaveAngle = defaultConcaveAngle;
if (args.options().found("concaveAngle"))
{
concaveAngle = readScalar
(
IStringStream(args.options()["concaveAngle"])()
);
}
args.optionReadIfPresent("concaveAngle", concaveAngle);
scalar concaveSin = Foam::sin(concaveAngle*mathematicalConstant::pi/180.0);
bool snapMeshDict = args.options().found("snapMesh");
bool overwrite = args.options().found("overwrite");
bool snapMeshDict = args.optionFound("snapMesh");
bool overwrite = args.optionFound("overwrite");
Info<< "Merging all faces of a cell" << nl
<< " - which are on the same patch" << nl
......
......@@ -336,7 +336,7 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
bool overwrite = args.options().found("overwrite");
bool overwrite = args.optionFound("overwrite");
Info<< "Reading modifyMeshDict\n" << endl;
......
......@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
pointMesh pMesh(mesh);
word cellSetName(args.args()[1]);
bool overwrite = args.options().found("overwrite");
bool overwrite = args.optionFound("overwrite");
Info<< "Reading cells to refine from cellSet " << cellSetName
<< nl << endl;
......
......@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
word patchName(args.additionalArgs()[0]);
scalar weight(readScalar(IStringStream(args.additionalArgs()[1])()));
bool overwrite = args.options().found("overwrite");
bool overwrite = args.optionFound("overwrite");
label patchID = mesh.boundaryMesh().findPatchID(patchName);
......@@ -101,11 +101,11 @@ int main(int argc, char *argv[])
// List of cells to refine
//
bool useSet = args.options().found("useSet");
bool useSet = args.optionFound("useSet");
if (useSet)
{
word setName(args.options()["useSet"]);
word setName(args.option("useSet"));
Info<< "Subsetting cells to cut based on cellSet" << setName << endl
<< endl;
......
......@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
<< " to allow for some truncation error."
<< nl << endl;
bool readLevel = args.options().found("readLevel");
bool readLevel = args.optionFound("readLevel");
const scalarField& vols = mesh.cellVolumes();
......
......@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
# include "createMesh.H"
const word oldInstance = mesh.pointsInstance();
bool overwrite = args.options().found("overwrite");
bool overwrite = args.optionFound("overwrite");
word setName(args.additionalArgs()[0]);
......
......@@ -542,23 +542,19 @@ int main(int argc, char *argv[])
scalar minCos = Foam::cos(radAngle);
scalar minSin = Foam::sin(radAngle);
bool readSet = args.options().found("set");
bool geometry = args.options().found("geometry");
bool overwrite = args.options().found("overwrite");
bool readSet = args.optionFound("set");
bool geometry = args.optionFound("geometry");
bool overwrite = args.optionFound("overwrite");
scalar edgeTol = 0.2;
if (args.options().found("tol"))
{
edgeTol = readScalar(IStringStream(args.options()["tol"])());
}
args.optionReadIfPresent("tol", edgeTol);
Info<< "Trying to split cells with internal angles > feature angle\n" << nl
<< "featureAngle : " << featureAngle << nl
<< "edge snapping tol : " << edgeTol << nl;
if (readSet)
{
Info<< "candidate cells : cellSet " << args.options()["set"] << nl;
Info<< "candidate cells : cellSet " << args.option("set") << nl;
}
else
{
......@@ -586,7 +582,7 @@ int main(int argc, char *argv[])
if (readSet)
{
// Read cells to cut from cellSet
cellSet cells(mesh, args.options()["set"]);
cellSet cells(mesh, args.option("set"));
cellsToCut = cells;
}
......
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
......@@ -246,10 +246,7 @@ int main(int argc, char *argv[])
}
scalar scaleFactor = 1.0;
if (args.options().found("scale"))
{
scaleFactor = atof(args.options()["scale"].c_str());
}
args.optionReadIfPresent("scale", scaleFactor);
# include "createTime.H"
......
......@@ -60,10 +60,7 @@ int main(int argc, char *argv[])
}
scalar scaleFactor = 1.0;
if (args.options().found("scale"))
{
scaleFactor = atof(args.options()["scale"].c_str());
}
args.optionReadIfPresent("scale", scaleFactor);
# include "createTime.H"
......
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
......@@ -760,21 +760,18 @@ int main(int argc, char *argv[])
FatalError.exit();
}
if (args.options().found("scale"))
{
scaleFactor = atof(args.options()["scale"].c_str());
}
args.optionReadIfPresent("scale", scaleFactor);
HashSet<word> ignoreCellGroups;
if (args.options().found("ignoreCellGroups"))
if (args.optionFound("ignoreCellGroups"))
{
IStringStream(args.options()["ignoreCellGroups"])() >> ignoreCellGroups;
args.optionLookup("ignoreCellGroups")() >> ignoreCellGroups;
}
HashSet<word> ignoreFaceGroups;
if (args.options().found("ignoreFaceGroups"))
if (args.optionFound("ignoreFaceGroups"))
{
IStringStream(args.options()["ignoreFaceGroups"])() >> ignoreFaceGroups;
args.optionLookup("ignoreFaceGroups")() >> ignoreFaceGroups;
}
# include "createTime.H"
......
......@@ -879,13 +879,10 @@ int main(int argc, char *argv[])
}
scalar scaleFactor = 1.0;
if (args.options().found("scale"))
{
scaleFactor = atof(args.options()["scale"].c_str());
}
args.optionReadIfPresent("scale", scaleFactor);
bool writeSets = args.options().found("writeSets");
bool writeZones = args.options().found("writeZones");
bool writeSets = args.optionFound("writeSets");
bool writeZones = args.optionFound("writeZones");
# include "createTime.H"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment