Merge branch 'olesenm'

This commit is contained in:
andy
2010-02-17 16:48:44 +00:00
158 changed files with 804 additions and 712 deletions

View File

@ -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
@ -251,7 +251,7 @@ bool Foam::argList::regroupArgv(int& argc, char**& argv)
// note: we also re-write directly into args_
// and use a second pass to sort out args/options
for (int argI = 0; argI < argc; argI++)
for (int argI = 0; argI < argc; ++argI)
{
if (strcmp(argv[argI], "(") == 0)
{
@ -369,7 +369,7 @@ Foam::argList::argList
{
// Check if this run is a parallel run by searching for any parallel option
// If found call runPar which might filter argv
for (int argI = 0; argI < argc; argI++)
for (int argI = 0; argI < argc; ++argI)
{
if (argv[argI][0] == '-')
{
@ -395,7 +395,7 @@ Foam::argList::argList
int nArgs = 1;
string argListString = args_[0];
for (int argI = 1; argI < args_.size(); argI++)
for (int argI = 1; argI < args_.size(); ++argI)
{
argListString += ' ';
argListString += args_[argI];
@ -751,12 +751,6 @@ Foam::argList::~argList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::stringList::subList Foam::argList::additionalArgs() const
{
return stringList::subList(args_, args_.size() - 1, 1);
}
void Foam::argList::printUsage() const
{
Info<< "\nUsage: " << executable_ << " [OPTIONS]";

View File

@ -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
@ -193,7 +193,7 @@ public:
// Access
//- Name of executable
//- Name of executable without the path
inline const word& executable() const;
//- Return root path
@ -211,9 +211,25 @@ public:
//- Return arguments
inline const stringList& args() const;
//- Return additional arguments,
// i.e. those additional to the executable itself
stringList::subList additionalArgs() const;
//- Return the argument corresponding to index.
inline const string& arg(const label index) const;
//- Return the number of arguments
inline label size() const;
//- Read a value from the argument at index.
// Index 0 corresponds to the name of the executable.
// Index 1 corresponds to the first argument.
template<class T>
inline T argRead(const label index) const;
//- Return arguments that are additional to the executable
// @deprecated use operator[] directly (deprecated Feb 2010)
stringList::subList additionalArgs() const
{
return stringList::subList(args_, args_.size()-1, 1);
}
//- Return options
inline const Foam::HashTable<string>& options() const;
@ -264,6 +280,14 @@ public:
}
//- Return the argument corresponding to index.
// Index 0 corresponds to the name of the executable.
// Index 1 corresponds to the first argument.
inline const string& operator[](const label index) const;
//- Return the argument string associated with the named option
// @sa option()
inline const string& operator[](const word& opt) const;
// Edit

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -64,6 +64,18 @@ inline const Foam::stringList& Foam::argList::args() const
}
inline const Foam::string& Foam::argList::arg(const label index) const
{
return args_[index];
}
inline Foam::label Foam::argList::size() const
{
return args_.size();
}
inline const Foam::HashTable<Foam::string>& Foam::argList::options() const
{
return options_;
@ -72,7 +84,7 @@ inline const Foam::HashTable<Foam::string>& Foam::argList::options() const
inline const Foam::string& Foam::argList::option(const word& opt) const
{
return options_.operator[](opt);
return options_[opt];
}
@ -84,7 +96,7 @@ inline bool Foam::argList::optionFound(const word& opt) const
inline Foam::IStringStream Foam::argList::optionLookup(const word& opt) const
{
return IStringStream(option(opt));
return IStringStream(options_[opt]);
}
@ -92,12 +104,36 @@ inline Foam::IStringStream Foam::argList::optionLookup(const word& opt) const
namespace Foam
{
// Template specialization for string
template<>
inline Foam::string
Foam::argList::argRead<Foam::string>(const label index) const
{
return args_[index];
}
// Template specialization for word
template<>
inline Foam::word
Foam::argList::argRead<Foam::word>(const label index) const
{
return args_[index];
}
// Template specialization for fileName
template<>
inline Foam::fileName
Foam::argList::argRead<Foam::fileName>(const label index) const
{
return args_[index];
}
// Template specialization for string
template<>
inline Foam::string
Foam::argList::optionRead<Foam::string>(const word& opt) const
{
return option(opt);
return options_[opt];
}
// Template specialization for word
@ -105,7 +141,7 @@ namespace Foam
inline Foam::word
Foam::argList::optionRead<Foam::word>(const word& opt) const
{
return option(opt);
return options_[opt];
}
// Template specialization for fileName
@ -113,13 +149,23 @@ namespace Foam
inline Foam::fileName
Foam::argList::optionRead<Foam::fileName>(const word& opt) const
{
return option(opt);
return options_[opt];
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
inline T Foam::argList::argRead(const label index) const
{
T val;
IStringStream(args_[index])() >> val;
return val;
}
template<class T>
inline T Foam::argList::optionRead(const word& opt) const
{
@ -187,4 +233,18 @@ inline T Foam::argList::optionLookupOrDefault
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline const Foam::string& Foam::argList::operator[](const label index) const
{
return args_[index];
}
inline const Foam::string& Foam::argList::operator[](const word& opt) const
{
return options_[opt];
}
// ************************************************************************* //

View File

@ -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

View File

@ -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
@ -44,6 +44,40 @@ Description
SourceFiles
global.Cver
@mainpage OpenFOAM&reg;: open source CFD
@section about About OpenFOAM
OpenFOAM is a free, open source CFD software package produced by
a commercial company,
<a href="http://www.openfoam.com/about">OpenCFD Ltd</a>.
It has a
large user base across most areas of engineering and science,
from both commercial and academic organisations. OpenFOAM has an
extensive range of features to solve anything from complex fluid
flows involving chemical reactions, turbulence and heat transfer,
to solid dynamics and electromagnetics.
<a href="http://www.openfoam.com/features">More ...</a>
@section users Our commitment to the users
OpenFOAM comes with full commercial support from OpenCFD, including
<a href="http://www.openfoam.com/support/software.php">software support</a>,
<a href="http://www.openfoam.com/support/development.php">contracted developments</a> and
a programme of <a href="http://www.openfoam.com/training">training courses</a>.
These activities fund the development, maintenance and release of
OpenFOAM to make it an extremely viable commercial open source product.
@section opensource Our commitment to open source
OpenCFD is committed to open source software, continually developing and
maintaining OpenFOAM under the
<a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public Licence</a>.
OpenFOAM will <strong>always</strong> be free of charge and open source.
In addition, we endeavour to support other viable open source initiatives
that will benefit science and engineering.
\*---------------------------------------------------------------------------*/
#ifndef foamVersion_H

View File

@ -0,0 +1,10 @@
//
// addOverwriteOption.H
// ~~~~~~~~~~~~~~~~~~~~
Foam::argList::addOption
(
"overwrite",
"overwrite existing mesh/results files"
);

View File

@ -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
@ -32,7 +32,7 @@ Description
Deprecated
This solver is present for backward-compatibility and the PBiCG solver
should be used instead.
should be used instead. (deprecated Apr 2008)
SourceFiles
BICCG.C

View File

@ -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
@ -32,7 +32,7 @@ Description
Deprecated
This solver is present for backward-compatibility and the PCG solver
should be used for preference.
should be used for preference. (deprecated Apr 2008)
SourceFiles
ICCG.C

View File

@ -65,6 +65,7 @@ Deprecated
Specifying the local vectors as an @c axis (corresponding to e3) and a
@c direction (corresponding to e1), is allowed for backwards
compatibility, but this terminology is generally a bit confusing.
(deprecated Apr 2008)
\*---------------------------------------------------------------------------*/

View File

@ -365,14 +365,14 @@ public:
}
//- Return axis (e3: local Cartesian z-axis)
// @deprecated method e3 is preferred
// @deprecated method e3 is preferred (deprecated Apr 2008)
const vector& axis() const
{
return Rtr_.z();
}
//- Return direction (e1: local Cartesian x-axis)
// @deprecated method e1 is preferred
// @deprecated method e1 is preferred (deprecated Apr 2008)
const vector& direction() const
{
return Rtr_.x();

View File

@ -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
@ -411,9 +411,8 @@ Foam::booleanSurface::booleanSurface
Pout<< "booleanSurface : Generated cutSurf1: " << endl;
cutSurf1.writeStats(Pout);
Pout<< "Writing to file cutSurf1.ftr" << endl;
OFstream cutSurf1Stream("cutSurf1.ftr");
cutSurf1.write(cutSurf1Stream);
Pout<< "Writing to file cutSurf1.obj" << endl;
cutSurf1.write("cutSurf1.obj");
}
if (debug)
@ -430,9 +429,8 @@ Foam::booleanSurface::booleanSurface
Pout<< "booleanSurface : Generated cutSurf2: " << endl;
cutSurf2.writeStats(Pout);
Pout<< "Writing to file cutSurf2.ftr" << endl;
OFstream cutSurf2Stream("cutSurf2.ftr");
cutSurf2.write(cutSurf2Stream);
Pout<< "Writing to file cutSurf2.obj" << endl;
cutSurf2.write("cutSurf2.obj");
}
@ -768,9 +766,8 @@ Foam::booleanSurface::booleanSurface
Pout<< "booleanSurface : Generated cutSurf1: " << endl;
cutSurf1.writeStats(Pout);
Pout<< "Writing to file cutSurf1.ftr" << endl;
OFstream cutSurf1Stream("cutSurf1.ftr");
cutSurf1.write(cutSurf1Stream);
Pout<< "Writing to file cutSurf1.obj" << endl;
cutSurf1.write("cutSurf1.obj");
}
@ -792,9 +789,8 @@ Foam::booleanSurface::booleanSurface
Pout<< "booleanSurface : Generated cutSurf2: " << endl;
cutSurf2.writeStats(Pout);
Pout<< "Writing to file cutSurf2.ftr" << endl;
OFstream cutSurf2Stream("cutSurf2.ftr");
cutSurf2.write(cutSurf2Stream);
Pout<< "Writing to file cutSurf2.obj" << endl;
cutSurf2.write("cutSurf2.obj");
}
@ -920,9 +916,8 @@ Foam::booleanSurface::booleanSurface
Pout<< "booleanSurface : Generated combinedSurf: " << endl;
combinedSurf.writeStats(Pout);
Pout<< "Writing to file combinedSurf.ftr" << endl;
OFstream combinedSurfStream("combinedSurf.ftr");
combinedSurf.write(combinedSurfStream);
Pout<< "Writing to file combinedSurf.obj" << endl;
combinedSurf.write("combinedSurf.obj");
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -213,8 +213,8 @@ void Foam::calcTypes::addSubtract::preCalc
const fvMesh& mesh
)
{
baseFieldName_ = args.additionalArgs()[1];
word calcModeName = args.additionalArgs()[2];
baseFieldName_ = args[2];
const word calcModeName = args[3];
if (calcModeName == "add")
{
@ -232,14 +232,12 @@ void Foam::calcTypes::addSubtract::preCalc
<< exit(FatalError);
}
if (args.optionFound("field"))
if (args.optionReadIfPresent("field", addSubtractFieldName_))
{
addSubtractFieldName_ = args.option("field");
calcType_ = FIELD;
}
else if (args.optionFound("value"))
else if (args.optionReadIfPresent("value", addSubtractValueStr_))
{
addSubtractValueStr_ = args.option("value");
calcType_ = VALUE;
}
else
@ -249,10 +247,7 @@ void Foam::calcTypes::addSubtract::preCalc
<< nl << exit(FatalError);
}
if (args.optionFound("resultName"))
{
resultName_ = args.option("resultName");
}
args.optionReadIfPresent("resultName", resultName_);
}

View File

@ -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
@ -78,7 +78,7 @@ void Foam::calcTypes::components::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

View File

@ -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
@ -78,7 +78,7 @@ void Foam::calcTypes::div::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,7 +78,7 @@ void Foam::calcTypes::interpolate::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

View File

@ -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
@ -78,7 +78,7 @@ void Foam::calcTypes::mag::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

View File

@ -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
@ -78,7 +78,7 @@ void Foam::calcTypes::magGrad::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

View File

@ -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
@ -78,7 +78,7 @@ void Foam::calcTypes::magSqr::calc
const fvMesh& mesh
)
{
const word& fieldName = args.additionalArgs()[1];
const word fieldName = args[2];
IOobject fieldHeader
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -79,9 +79,8 @@ void Foam::calcTypes::randomise::calc
const fvMesh& mesh
)
{
const stringList& params = args.additionalArgs();
const scalar pertMag = readScalar(IStringStream(params[1])());
const word& fieldName = params[2];
const scalar pertMag = args.argRead<scalar>(2);
const word fieldName = args[3];
Random rand(1234567);

View File

@ -29,6 +29,9 @@ Description
Reading of the (now deprecated and infrequently used)
Foam Trisurface Format.
Deprecated
Other formats are better. (deprecated Mar 2009)
SourceFiles
FTRsurfaceFormat.C