mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +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:
@ -464,8 +464,8 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
|
||||
const scalar minLen = args.argRead<scalar>(1);
|
||||
const scalar angle = args.argRead<scalar>(2);
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
scalar maxCos = Foam::cos(degToRad(angle));
|
||||
|
||||
@ -446,14 +446,12 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
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));
|
||||
|
||||
// Sin of angle between two consecutive edges on a face.
|
||||
// If sin(angle) larger than this the face will be considered concave.
|
||||
scalar concaveAngle = args.optionLookupOrDefault("concaveAngle", 30.0);
|
||||
|
||||
scalar concaveSin = Foam::sin(degToRad(concaveAngle));
|
||||
|
||||
const bool snapMeshDict = args.optionFound("snapMesh");
|
||||
|
||||
@ -60,12 +60,10 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
word patchName(args.additionalArgs()[0]);
|
||||
|
||||
scalar weight(readScalar(IStringStream(args.additionalArgs()[1])()));
|
||||
const word patchName = args[1];
|
||||
const scalar weight = args.argRead<scalar>(2);
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
|
||||
label patchID = mesh.boundaryMesh().findPatchID(patchName);
|
||||
|
||||
if (patchID == -1)
|
||||
|
||||
@ -57,10 +57,9 @@ int main(int argc, char *argv[])
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
const word setName = args[1];
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
word setName(args.additionalArgs()[0]);
|
||||
|
||||
// Read faces
|
||||
faceSet candidateSet(mesh, setName);
|
||||
|
||||
|
||||
@ -537,10 +537,9 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
|
||||
scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
scalar minSin = Foam::sin(degToRad(featureAngle));
|
||||
const scalar featureAngle = args.argRead<scalar>(1);
|
||||
const scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
const scalar minSin = Foam::sin(degToRad(featureAngle));
|
||||
|
||||
const bool readSet = args.optionFound("set");
|
||||
const bool geometry = args.optionFound("geometry");
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -65,8 +65,8 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
const scalar thickness = args.argRead<scalar>(1);
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
|
||||
// Check that mesh is 2D
|
||||
|
||||
@ -84,21 +84,20 @@ int main(int argc, char *argv[])
|
||||
<< " s\n" << endl << endl;
|
||||
|
||||
|
||||
//
|
||||
// Use boundaryMesh to reuse all the featureEdge stuff in there.
|
||||
//
|
||||
const scalar featureAngle = args.argRead<scalar>(1);
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
boundaryMesh bMesh;
|
||||
|
||||
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
const scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
|
||||
Info<< "Feature:" << featureAngle << endl
|
||||
<< "minCos :" << minCos << endl
|
||||
<< endl;
|
||||
|
||||
//
|
||||
// Use boundaryMesh to reuse all the featureEdge stuff in there.
|
||||
//
|
||||
|
||||
boundaryMesh bMesh;
|
||||
bMesh.read(mesh);
|
||||
|
||||
// Set feature angle (calculate feature edges)
|
||||
|
||||
@ -143,7 +143,7 @@ int main(int argc, char *argv[])
|
||||
const faceZoneMesh& faceZones = mesh.faceZones();
|
||||
|
||||
// Faces to baffle
|
||||
faceZoneID zoneID(args.additionalArgs()[0], faceZones);
|
||||
faceZoneID zoneID(args[1], faceZones);
|
||||
|
||||
Info<< "Converting faces on zone " << zoneID.name()
|
||||
<< " into baffles." << nl << endl;
|
||||
@ -168,7 +168,7 @@ int main(int argc, char *argv[])
|
||||
// Patches to put baffles into
|
||||
DynamicList<label> newPatches(1);
|
||||
|
||||
word patchName(args.additionalArgs()[1]);
|
||||
const word patchName = args[2];
|
||||
newPatches.append(findPatchID(mesh, patchName));
|
||||
Info<< "Using patch " << patchName
|
||||
<< " at index " << newPatches[0] << endl;
|
||||
|
||||
@ -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
|
||||
@ -47,7 +47,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
||||
scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
const scalar scaleFactor = args.argRead<scalar>(1);
|
||||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
@ -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
|
||||
@ -51,9 +51,8 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
# include "createPolyMesh.H"
|
||||
|
||||
fileName surfName(args.additionalArgs()[0]);
|
||||
fileName setName(args.additionalArgs()[1]);
|
||||
|
||||
const fileName surfName = args[1];
|
||||
const fileName setName = args[2];
|
||||
|
||||
// Read surface
|
||||
Info<< "Reading surface from " << surfName << endl;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -15,13 +15,13 @@
|
||||
FatalError.exit();
|
||||
}
|
||||
|
||||
fileName rootDirMaster(args.additionalArgs()[0]);
|
||||
fileName caseDirMaster(args.additionalArgs()[1]);
|
||||
fileName rootDirMaster = args[1];
|
||||
fileName caseDirMaster = args[2];
|
||||
word masterRegion = polyMesh::defaultRegion;
|
||||
args.optionReadIfPresent("masterRegion", masterRegion);
|
||||
|
||||
fileName rootDirToAdd(args.additionalArgs()[2]);
|
||||
fileName caseDirToAdd(args.additionalArgs()[3]);
|
||||
fileName rootDirToAdd = args[3];
|
||||
fileName caseDirToAdd = args[4];
|
||||
word addRegion = polyMesh::defaultRegion;
|
||||
args.optionReadIfPresent("addRegion", addRegion);
|
||||
|
||||
@ -29,3 +29,4 @@
|
||||
<< " region " << masterRegion << nl
|
||||
<< "mesh to add: " << rootDirToAdd << " " << caseDirToAdd
|
||||
<< " region " << addRegion << endl;
|
||||
|
||||
|
||||
@ -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
|
||||
@ -116,8 +116,8 @@ int main(int argc, char *argv[])
|
||||
argList::validArgs.append("output VTK file");
|
||||
argList::argList args(argc, argv);
|
||||
|
||||
fileName objName(args.additionalArgs()[0]);
|
||||
fileName outName(args.additionalArgs()[1]);
|
||||
const fileName objName = args[1];
|
||||
const fileName outName = args[2];
|
||||
|
||||
std::ifstream OBJfile(objName.c_str());
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anispulation |
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -75,10 +75,10 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
vector n1(IStringStream(args.additionalArgs()[0])());
|
||||
vector n1 = args.argRead<vector>(1);
|
||||
n1 /= mag(n1);
|
||||
|
||||
vector n2(IStringStream(args.additionalArgs()[1])());
|
||||
vector n2 = args.argRead<vector>(2);
|
||||
n2 /= mag(n2);
|
||||
|
||||
tensor T = rotationTensor(n1, n2);
|
||||
|
||||
@ -123,10 +123,9 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
word setName(args.additionalArgs()[0]);
|
||||
word masterPatch(args.additionalArgs()[1]);
|
||||
word slavePatch(args.additionalArgs()[2]);
|
||||
|
||||
const word setName = args[1];
|
||||
const word masterPatch = args[2];
|
||||
const word slavePatch = args[3];
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
// List of faces to split
|
||||
|
||||
@ -113,9 +113,8 @@ int main(int argc, char *argv[])
|
||||
# include "createNamedMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
|
||||
word masterPatchName(args.additionalArgs()[0]);
|
||||
word slavePatchName(args.additionalArgs()[1]);
|
||||
const word masterPatchName = args[1];
|
||||
const word slavePatchName = args[2];
|
||||
|
||||
const bool partialCover = args.optionFound("partial");
|
||||
const bool perfectCover = args.optionFound("perfect");
|
||||
|
||||
@ -161,7 +161,7 @@ int main(int argc, char *argv[])
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
word setName(args.additionalArgs()[0]);
|
||||
const word setName = args[1];
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user