mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
STYLE: use new argList argRead() method and operator[] for cleaner code.
- deprecate argList::additionalArgs() method and remove uses of it
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -615,7 +615,7 @@ int main(int argc, char *argv[])
|
||||
wordList foamPatchNames;
|
||||
|
||||
{
|
||||
fileName ccmFile(args.additionalArgs()[0]);
|
||||
const fileName ccmFile = args[1];
|
||||
|
||||
if (!isFile(ccmFile))
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,8 @@ Application
|
||||
ansysToFoam
|
||||
|
||||
Description
|
||||
Converts an ANSYS input mesh file, exported from I-DEAS, to FOAM format.
|
||||
Converts an ANSYS input mesh file, exported from I-DEAS,
|
||||
to OpenFOAM format.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -252,7 +253,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName ansysFile(args.additionalArgs()[0]);
|
||||
const fileName ansysFile = args[1];
|
||||
ifstream ansysStream(ansysFile.c_str());
|
||||
|
||||
if (!ansysStream)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Application
|
||||
cfx4ToFoam
|
||||
|
||||
Description
|
||||
Converts a CFX 4 mesh to FOAM format
|
||||
Converts a CFX 4 mesh to OpenFOAM format
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
IFstream cfxFile(args.additionalArgs()[0]);
|
||||
IFstream cfxFile(args[1]);
|
||||
|
||||
// Read the cfx information using a fixed format reader.
|
||||
// Comments in the file are in C++ style, so the stream parser will remove
|
||||
@ -603,7 +603,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "CFX patch " << patchI
|
||||
<< ", of type " << cfxPatchTypes[patchI]
|
||||
<< ", name " << cfxPatchNames[patchI]
|
||||
<< " already exists as FOAM patch " << existingPatch
|
||||
<< " already exists as OpenFOAM patch " << existingPatch
|
||||
<< ". Adding faces." << endl;
|
||||
|
||||
faceList& renumberedPatch = boundary[existingPatch];
|
||||
@ -655,7 +655,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "CFX patch " << patchI
|
||||
<< ", of type " << cfxPatchTypes[patchI]
|
||||
<< ", name " << cfxPatchNames[patchI]
|
||||
<< " converted into FOAM patch " << nCreatedPatches
|
||||
<< " converted into OpenFOAM patch " << nCreatedPatches
|
||||
<< " type ";
|
||||
|
||||
if (cfxPatchTypes[patchI] == "WALL")
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -795,7 +795,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName fluentFile(args.additionalArgs()[0]);
|
||||
const fileName fluentFile = args[1];
|
||||
IFstream fluentStream(fluentFile);
|
||||
|
||||
if (!fluentStream)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Application
|
||||
fluentMeshToFoam
|
||||
|
||||
Description
|
||||
Converts a Fluent mesh to FOAM format
|
||||
Converts a Fluent mesh to OpenFOAM format
|
||||
including multiple region and region boundary handling.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -881,12 +881,12 @@ int main(int argc, char *argv[])
|
||||
scalar scaleFactor = 1.0;
|
||||
args.optionReadIfPresent("scale", scaleFactor);
|
||||
|
||||
bool writeSets = args.optionFound("writeSets");
|
||||
bool writeZones = args.optionFound("writeZones");
|
||||
const bool writeSets = args.optionFound("writeSets");
|
||||
const bool writeZones = args.optionFound("writeZones");
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName fluentFile(args.additionalArgs()[0]);
|
||||
const fileName fluentFile = args[1];
|
||||
std::ifstream fluentStream(fluentFile.c_str());
|
||||
|
||||
if (!fluentStream)
|
||||
|
||||
@ -199,7 +199,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
fluentMeshFile << l.size() << " ";
|
||||
|
||||
// Note: In Fluent, all boundary faces point inwards, which is
|
||||
// opposite from the FOAM convention. Turn them round on printout
|
||||
// opposite from the OpenFOAM convention.
|
||||
// Turn them around on printout
|
||||
forAllReverse (l, lI)
|
||||
{
|
||||
fluentMeshFile << l[lI] + 1 << " ";
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
Writes out the FOAM mesh in Fluent mesh format.
|
||||
Writes out the OpenFOAM mesh in Fluent mesh format.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -73,14 +73,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
||||
const stringList& params = args.additionalArgs();
|
||||
fileName exportName = args[1];
|
||||
|
||||
scalar scaleFactor = 0;
|
||||
args.optionReadIfPresent<scalar>("scale", scaleFactor);
|
||||
const bool doTriangulate = args.optionFound("tri");
|
||||
|
||||
fileName exportName(params[0]);
|
||||
|
||||
fileName exportBase = exportName.lessExt();
|
||||
word exportExt = exportName.ext();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Application
|
||||
gambitToFoam
|
||||
|
||||
Description
|
||||
Converts a GAMBIT mesh to FOAM format.
|
||||
Converts a GAMBIT mesh to OpenFOAM format.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -653,7 +653,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName gambitFile(args.additionalArgs()[0]);
|
||||
const fileName gambitFile = args[1];
|
||||
ifstream gambitStream(gambitFile.c_str());
|
||||
|
||||
if (!gambitStream)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -722,9 +722,8 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
fileName mshName(args.additionalArgs()[0]);
|
||||
|
||||
bool keepOrientation = args.optionFound("keepOrientation");
|
||||
const bool keepOrientation = args.optionFound("keepOrientation");
|
||||
IFstream inFile(args[1]);
|
||||
|
||||
// Storage for points
|
||||
pointField points;
|
||||
@ -749,9 +748,6 @@ int main(int argc, char *argv[])
|
||||
// Version 1 or 2 format
|
||||
bool version2Format = false;
|
||||
|
||||
|
||||
IFstream inFile(mshName);
|
||||
|
||||
while (inFile.good())
|
||||
{
|
||||
string line;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -595,9 +595,8 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
fileName ideasName(args.additionalArgs()[0]);
|
||||
|
||||
IFstream inFile(ideasName.c_str());
|
||||
const fileName ideasName = args[1];
|
||||
IFstream inFile(ideasName);
|
||||
|
||||
if (!inFile.good())
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@ Application
|
||||
kivaToFoam
|
||||
|
||||
Description
|
||||
Converts a KIVA3v grid to FOAM format
|
||||
Converts a KIVA3v grid to OpenFOAM format
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -62,10 +62,8 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
bool readHex = args.optionFound("hex");
|
||||
|
||||
fileName mshFile(args.additionalArgs()[0]);
|
||||
IFstream mshStream(mshFile);
|
||||
const bool readHex = args.optionFound("hex");
|
||||
IFstream mshStream(args[1]);
|
||||
|
||||
label nCells;
|
||||
mshStream >> nCells;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -93,11 +93,7 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
fileName neuFile(args.additionalArgs()[0]);
|
||||
|
||||
|
||||
IFstream str(neuFile);
|
||||
|
||||
IFstream str(args[1]);
|
||||
|
||||
//
|
||||
// Read nodes.
|
||||
@ -106,7 +102,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "nNodes:" << nNodes << endl;
|
||||
|
||||
|
||||
pointField points(nNodes);
|
||||
|
||||
forAll(points, pointI)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -85,7 +85,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
IFstream plot3dFile(args.additionalArgs()[0]);
|
||||
IFstream plot3dFile(args[1]);
|
||||
|
||||
// Read the plot3d information using a fixed format reader.
|
||||
// Comments in the file are in C++ style, so the stream parser will remove
|
||||
|
||||
@ -385,9 +385,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
|
||||
scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
const scalar featureAngle = args.argRead<scalar>(1);
|
||||
const scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
|
||||
Info<< "Feature:" << featureAngle << endl
|
||||
<< "minCos :" << minCos << endl
|
||||
|
||||
@ -47,7 +47,7 @@ const cellModel* sammMesh::sammTrim4Ptr_ = cellModeller::lookup("sammTrim4");
|
||||
const cellModel* sammMesh::sammTrim5Ptr_ = cellModeller::lookup("sammTrim5");
|
||||
const cellModel* sammMesh::sammTrim8Ptr_ = cellModeller::lookup("hexagonalPrism");
|
||||
|
||||
// lookup table giving FOAM face number when looked up with shape index
|
||||
// lookup table giving OpenFOAM face number when looked up with shape index
|
||||
// (first index) and STAR face number
|
||||
// - first column is always -1
|
||||
// - last column is -1 for all but hexagonal prism
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Application
|
||||
sammToFoam
|
||||
|
||||
Description
|
||||
Converts a STAR-CD SAMM mesh to FOAM format
|
||||
Converts a Star-CD (v3) SAMM mesh to OpenFOAM format.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -54,8 +54,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName sammFile(args.additionalArgs()[0]);
|
||||
sammMesh makeMesh(sammFile, runTime, scaleFactor);
|
||||
sammMesh makeMesh(args[1], runTime, scaleFactor);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -81,7 +81,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
argList args(argc, argv);
|
||||
Time runTime(args.rootPath(), args.caseName());
|
||||
const stringList& params = args.additionalArgs();
|
||||
|
||||
// default rescale from [mm] to [m]
|
||||
scalar scaleFactor = args.optionLookupOrDefault("scale", 0.001);
|
||||
@ -103,7 +102,7 @@ int main(int argc, char *argv[])
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
// remove extensions and/or trailing '.'
|
||||
fileName prefix = fileName(params[0]).lessExt();
|
||||
const fileName prefix = fileName(args[1]).lessExt();
|
||||
|
||||
meshReaders::STARCD reader(prefix, runTime, scaleFactor);
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ const label starMesh::sammAddressingTable[9][12] =
|
||||
};
|
||||
|
||||
|
||||
// lookup table giving FOAM face number when looked up with shape index
|
||||
// lookup table giving OpenFOAM face number when looked up with shape index
|
||||
// (first index) and STAR face number
|
||||
// - first column is always -1
|
||||
// - last column is -1 for all but hexagonal prism
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Application
|
||||
starToFoam
|
||||
|
||||
Description
|
||||
Converts a STAR-CD PROSTAR mesh into FOAM format.
|
||||
Converts a Star-CD (v3) pro-STAR mesh into OpenFOAM format.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -54,8 +54,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName starMeshFile(args.additionalArgs()[0]);
|
||||
starMesh makeMesh(starMeshFile, runTime, scaleFactor);
|
||||
starMesh makeMesh(args[1], runTime, scaleFactor);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -103,14 +103,12 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
const fileName prefix = args[1];
|
||||
const bool readFaceFile = !args.optionFound("noFaceFile");
|
||||
|
||||
bool readFaceFile = !args.optionFound("noFaceFile");
|
||||
|
||||
fileName prefix(args.additionalArgs()[0]);
|
||||
|
||||
fileName nodeFile(prefix + ".node");
|
||||
fileName eleFile(prefix + ".ele");
|
||||
fileName faceFile(prefix + ".face");
|
||||
const fileName nodeFile(prefix + ".node");
|
||||
const fileName eleFile(prefix + ".ele");
|
||||
const fileName faceFile(prefix + ".face");
|
||||
|
||||
if (!readFaceFile)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user