Merge branch 'master' into molecularDynamics

This commit is contained in:
graham
2008-07-24 10:43:12 +01:00
198 changed files with 1033 additions and 1522 deletions

View File

@ -83,10 +83,7 @@ bool Foam::IOobject::readHeader(Istream& is)
}
// The note entry is optional
if (headerDict.found("note"))
{
note_ = string(headerDict.lookup("note"));
}
headerDict.readIfPresent("note", note_);
}
else
{

View File

@ -49,7 +49,6 @@ bool Foam::IOobject::writeHeader(Ostream& os) const
<< " format " << os.format() << ";\n"
<< " class " << type() << ";\n";
// outdent for visibility and more space
if (note().size())
{
os << " note " << note() << ";\n";

View File

@ -1,179 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "IFstream.H"
#include "OSspecific.H"
#include "zfstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(IFstream, 0);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
IFstreamAllocator::IFstreamAllocator(const fileName& pathname)
:
ifPtr_(NULL),
compression_(IOstream::UNCOMPRESSED)
{
if (!pathname.size())
{
if (IFstream::debug)
{
Info<< "IFstreamAllocator::IFstreamAllocator"
"(const fileName& pathname) : "
"can't open null file "
<< endl;
}
}
ifPtr_ = new ifstream(pathname.c_str());
// If the file is compressed, decompress it before reading.
if (!ifPtr_->good() && file(pathname + ".gz"))
{
if (IFstream::debug)
{
Info<< "IFstreamAllocator::IFstreamAllocator"
"(const fileName& pathname) : "
"decompressing " << pathname + ".gz"
<< endl;
}
delete ifPtr_;
ifPtr_ = new gzifstream((pathname + ".gz").c_str());
if (ifPtr_->good())
{
compression_ = IOstream::COMPRESSED;
}
}
}
IFstreamAllocator::~IFstreamAllocator()
{
delete ifPtr_;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
IFstream::IFstream
(
const fileName& pathname,
streamFormat format,
versionNumber version
)
:
IFstreamAllocator(pathname),
ISstream
(
*ifPtr_,
"IFstream.sourceFile_",
format,
version,
IFstreamAllocator::compression_
),
pathname_(pathname)
{
setClosed();
setState(ifPtr_->rdstate());
if (!good())
{
if (debug)
{
Info<< "IFstream::IFstream(const fileName& pathname,"
"streamFormat format=ASCII,"
"versionNumber version=currentVersion) : "
"couldn't open File for input"
<< endl << info() << endl;
}
setBad();
}
else
{
setOpened();
}
lineNumber_ = 1;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
IFstream::~IFstream()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void IFstream::print(Ostream& os) const
{
// Print File data
os << "IFstream: ";
ISstream::print(os);
}
//- Return a non-const reference to const Istream
// Needed for read-constructors where the stream argument is temporary:
// e.g. thing thisThing(IFstream("thingFileName")());
IFstream& IFstream::operator()() const
{
if (!good())
{
if (!file(pathname_) && !file(pathname_ + ".gz"))
{
FatalIOErrorIn("IFstream::operator()", *this)
<< "file " << pathname_ << " does not exist"
<< exit(FatalIOError);
}
else
{
check("IFstream::operator()");
FatalIOError.exit();
}
}
return const_cast<IFstream&>(*this);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,151 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "OFstream.H"
#include "OSspecific.H"
#include "zfstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(OFstream, 0);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
OFstreamAllocator::OFstreamAllocator
(
const fileName& pathname,
IOstream::compressionType compression
)
:
ofPtr_(NULL)
{
if (!pathname.size())
{
if (OFstream::debug)
{
Info
<< "OFstreamAllocator::OFstreamAllocator"
"(const fileName& pathname) : "
"can't open null file "
<< endl;
}
}
if (compression == IOstream::COMPRESSED)
{
if (file(pathname))
{
rm(pathname);
}
gzofstream* gzofPtr = new gzofstream((pathname + ".gz").c_str());
gzofPtr->buffer_.setcompressionlevel(Z_BEST_SPEED);
ofPtr_ = gzofPtr;
}
else
{
if (file(pathname + ".gz"))
{
rm(pathname + ".gz");
}
ofPtr_ = new ofstream(pathname.c_str());
}
}
OFstreamAllocator::~OFstreamAllocator()
{
delete ofPtr_;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
OFstream::OFstream
(
const fileName& pathname,
streamFormat format,
versionNumber version,
compressionType compression
)
:
OFstreamAllocator(pathname, compression),
OSstream(*ofPtr_, "OFstream.sinkFile_", format, version, compression),
pathname_(pathname)
{
setClosed();
setState(ofPtr_->rdstate());
if (!good())
{
if (debug)
{
Info<< "IFstream::IFstream(const fileName& pathname,"
"streamFormat format=ASCII,"
"versionNumber version=currentVersion) : "
"couldn't open File for input\n"
"in stream " << info() << Foam::endl;
}
setBad();
}
else
{
setOpened();
}
lineNumber_ = 1;
}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
OFstream::~OFstream()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void OFstream::print(Ostream& os) const
{
// Print File data
os << " OFstream: ";
OSstream::print(os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -101,14 +101,12 @@ void Foam::Time::setControls()
{
// default is to resume calculation from "latestTime"
word startFrom("latestTime");
if (controlDict_.found("startFrom"))
{
controlDict_.lookup("startFrom") >> startFrom;
}
controlDict_.readIfPresent("startFrom", startFrom);
if (startFrom == "startTime")
{
startTime_ = readScalar(controlDict_.lookup("startTime"));
controlDict_.lookup("startTime") >> startTime_;
}
else
{
@ -158,7 +156,7 @@ void Foam::Time::setControls()
FatalErrorIn("Time::setControls()")
<< "Start time is not the same for all processors" << nl
<< "processor " << Pstream::myProcNo() << " has startTime "
<< startTime_ << exit(FatalError);
<< startTime_ << exit(FatalError);
}
}
@ -176,15 +174,13 @@ void Foam::Time::setControls()
)
);
if (timeDict.found("deltaT"))
if (timeDict.readIfPresent("deltaT", deltaTSave_))
{
deltaTSave_ = readScalar(timeDict.lookup("deltaT"));
deltaT0_ = deltaTSave_;
}
if (timeDict.found("index"))
if (timeDict.readIfPresent("index", startTimeIndex_))
{
timeDict.lookup("index") >> startTimeIndex_;
timeIndex_ = startTimeIndex_;
}
}
@ -503,20 +499,9 @@ void Foam::Time::setTime(const instant& inst, const label newIndex)
)
);
if (timeDict.found("deltaT"))
{
deltaT_ = readScalar(timeDict.lookup("deltaT"));
}
if (timeDict.found("deltaT0"))
{
deltaT0_ = readScalar(timeDict.lookup("deltaT0"));
}
if (timeDict.found("index"))
{
timeIndex_ = readLabel(timeDict.lookup("index"));
}
timeDict.readIfPresent("deltaT", deltaT_);
timeDict.readIfPresent("deltaT0", deltaT0_);
timeDict.readIfPresent("index", timeIndex_);
}
@ -647,7 +632,7 @@ Foam::Time& Foam::Time::operator++()
case wcRunTime:
case wcAdjustableRunTime:
{
label outputTimeIndex =
label outputTimeIndex =
label(((value() - startTime_) + 0.5*deltaT_)/writeInterval_);
if (outputTimeIndex > outputTimeIndex_)

View File

@ -44,10 +44,8 @@ void Foam::Time::readDict()
);
}
if (controlDict_.found("writeInterval"))
if (controlDict_.readIfPresent("writeInterval", writeInterval_))
{
controlDict_.lookup("writeInterval") >> writeInterval_;
if (writeControl_ == wcTimeStep && label(writeInterval_) < 1)
{
FatalIOErrorIn("Time::readDict()", controlDict_)
@ -60,10 +58,8 @@ void Foam::Time::readDict()
controlDict_.lookup("writeFrequency") >> writeInterval_;
}
if (controlDict_.found("purgeWrite"))
if (controlDict_.readIfPresent("purgeWrite", purgeWrite_))
{
purgeWrite_ = readInt(controlDict_.lookup("purgeWrite"));
if (purgeWrite_ < 0)
{
WarningIn("Time::readDict()")
@ -106,10 +102,7 @@ void Foam::Time::readDict()
}
}
if (controlDict_.found("timePrecision"))
{
precision_ = readLabel(controlDict_.lookup("timePrecision"));
}
controlDict_.readIfPresent("timePrecision", precision_);
// stopAt at 'endTime' or a specified value
// if nothing is specified, the endTime is zero
@ -119,18 +112,14 @@ void Foam::Time::readDict()
if (stopAt_ == saEndTime)
{
endTime_ = readScalar(controlDict_.lookup("endTime"));
controlDict_.lookup("endTime") >> endTime_;
}
else
{
endTime_ = GREAT;
}
}
else if (controlDict_.found("endTime"))
{
endTime_ = readScalar(controlDict_.lookup("endTime"));
}
else
else if (!controlDict_.readIfPresent("endTime", endTime_))
{
endTime_ = 0;
}
@ -175,10 +164,7 @@ void Foam::Time::readDict()
);
}
if (controlDict_.found("graphFormat"))
{
graphFormat_ = word(controlDict_.lookup("graphFormat"));
}
controlDict_.readIfPresent("graphFormat", graphFormat_);
if (controlDict_.found("runTimeModifiable"))
{

View File

@ -28,6 +28,9 @@ Class
Description
Abstract base-class for Time/database function objects.
See Also
Foam::OutputFilterFunctionObject
SourceFiles
functionObject.C

View File

@ -29,6 +29,9 @@ Description
List of function objects with execute function which is called for
each object.
See Also
Foam::functionObject and Foam::OutputFilterFunctionObject
SourceFiles
functionObjectList.C

View File

@ -26,7 +26,7 @@ InClass
Foam::memberFunctionSelectionTables
Description
Macros to enable the easy insertion into member function selection tables.
Macros for easy insertion into member function selection tables
\*---------------------------------------------------------------------------*/
@ -47,14 +47,13 @@ Description
\
/* Add the thisType constructor function to the table */ \
baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType> \
add##thisType##memberFunction##argNames##MemberFunctionTo##baseType##Table_(#lookup)
add_##lookup##_##thisType##memberFunction##argNames##MemberFunctionTo##baseType##Table_(#lookup)
#define addTemplateToMemberFunctionSelectionTable\
(baseType,thisType,Targ,memberFunction,argNames) \
\
/* Add the thisType constructor function to the table */ \
baseType::add##memberFunction##argNames##MemberFunctionToTable \
<thisType<Targ> > \
baseType::add##memberFunction##argNames##MemberFunctionToTable<thisType<Targ> > \
add##thisType##Targ##memberFunction##argNames##MemberFunctionTo##baseType##Table_

View File

@ -26,7 +26,7 @@ InClass
Foam::runTimeSelectionTables
Description
Macros to enable the easy insertion into run-time selection tables.
Macros for easy insertion into run-time selection tables
\*---------------------------------------------------------------------------*/
@ -45,7 +45,7 @@ Description
\
/* Add the thisType constructor function to the table */ \
baseType::add##argNames##ConstructorToTable<thisType> \
add##thisType##argNames##ConstructorTo##baseType##Table_(#lookup)
add_##lookup##_##thisType##argNames##ConstructorTo##baseType##Table_(#lookup)
#define addTemplateToRunTimeSelectionTable(baseType,thisType,Targ,argNames) \
\

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::FieldField\<T\>
Foam::FieldField
Description
Generic field type.
@ -134,7 +134,7 @@ public:
);
forAll(*nffPtr, i)
{
{
nffPtr->set(i, Field<Type>::NewCalculatedType(ff[i]).ptr());
}

View File

@ -168,7 +168,6 @@ Foam::argList::argList
{
// Check if this run is a parallel run by searching for any parallel option
// If found call runPar (might filter argv)
for (int argi=0; argi<argc; argi++)
{
if (argv[argi][0] == '-')
@ -183,12 +182,6 @@ Foam::argList::argList
}
}
// Print the banner once only for parallel runs
if (Pstream::master())
{
IOobject::writeBanner(Info, true);
}
// convert argv -> args_ and capture ( ... ) lists
// for normal arguments and for options
regroupArgv(argc, argv);
@ -291,8 +284,10 @@ Foam::argList::argList
string dateString = clock::date();
string timeString = clock::clockTime();
// Print the banner once only for parallel runs
if (Pstream::master())
{
IOobject::writeBanner(Info, true);
Info<< "Exec : " << argListString.c_str() << nl
<< "Date : " << dateString.c_str() << nl
<< "Time : " << timeString.c_str() << nl
@ -609,9 +604,9 @@ void Foam::argList::printUsage() const
Info<< ']';
}
// place help/doc options of the way at the end,
// place help/doc/srcDoc options of the way at the end,
// but with an extra space to separate it a little
Info<< " [-help] [-doc] [-srcDoc]" << endl;
Info<< " [-help] [-doc] [-srcDoc]\n" << endl;
}
@ -663,7 +658,9 @@ void Foam::argList::displayDoc(bool source) const
}
else
{
Info<< "No documentation found" << endl;
Info<< nl
<< "No documentation found for " << executable_
<< ", but you can use -help to display the usage\n" << endl;
}
}

View File

@ -1 +1 @@
argList::validOptions.insert("region", "region name");
argList::validOptions.insert("region", "name");

View File

@ -87,8 +87,7 @@ class lduMatrix
public:
//- Class returned by the solver
// containing performance statistics
//- Class returned by the solver, containing performance statistics
class solverPerformance
{
word solverName_;
@ -237,16 +236,6 @@ public:
// Protected Member Functions
//- Read a control parameter from controlDict
template<class T>
inline void readControl
(
const dictionary& controlDict,
T& control,
const word& controlName
);
//- Read the control parameters from the controlDict_
virtual void readControls();
@ -318,7 +307,6 @@ public:
Istream& solverData
);
// Selectors
//- Return a new solver
@ -333,6 +321,7 @@ public:
);
// Destructor
virtual ~solver()
@ -749,7 +738,7 @@ public:
const lduInterfaceFieldPtrsList&,
const direction cmpt
) const;
//- Matrix transpose multiplication with updated interfaces.
void Tmul
(
@ -800,7 +789,7 @@ public:
scalarField& result,
const direction cmpt
) const;
//- Update interfaced interfaces for matrix operations
void updateMatrixInterfaces
(
@ -810,7 +799,7 @@ public:
scalarField& result,
const direction cmpt
) const;
template<class Type>
tmp<Field<Type> > H(const Field<Type>&) const;

View File

@ -171,9 +171,9 @@ Foam::lduMatrix::solver::solver
void Foam::lduMatrix::solver::readControls()
{
readControl(controlDict_, maxIter_, "maxIter");
readControl(controlDict_, tolerance_, "tolerance");
readControl(controlDict_, relTol_, "relTol");
controlDict_.readIfPresent("maxIter", maxIter_);
controlDict_.readIfPresent("tolerance", tolerance_);
controlDict_.readIfPresent("relTol", relTol_);
}

View File

@ -31,21 +31,6 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class T>
inline void Foam::lduMatrix::solver::readControl
(
const dictionary& controlDict,
T& control,
const word& controlName
)
{
if (controlDict.found(controlName))
{
controlDict.lookup(controlName) >> control;
}
}
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::lduMatrix::H(const Field<Type>& psi) const
{

View File

@ -75,7 +75,7 @@ Foam::GAMGPreconditioner::~GAMGPreconditioner()
void Foam::GAMGPreconditioner::readControls()
{
GAMGSolver::readControls();
readControl(controlDict_, nVcycles_, "nVcycles");
controlDict_.readIfPresent("nVcycles", nVcycles_);
}

View File

@ -154,13 +154,12 @@ void Foam::GAMGSolver::readControls()
{
lduMatrix::solver::readControls();
readControl(controlDict_, cacheAgglomeration_, "cacheAgglomeration");
readControl(controlDict_, nPreSweeps_, "nPreSweeps");
readControl(controlDict_, nPostSweeps_, "nPostSweeps");
readControl(controlDict_, nFinestSweeps_, "nFinestSweeps");
readControl(controlDict_, scaleCorrection_, "scaleCorrection");
readControl(controlDict_, directSolveCoarsest_, "directSolveCoarsest");
controlDict_.readIfPresent("cacheAgglomeration", cacheAgglomeration_);
controlDict_.readIfPresent("nPreSweeps", nPreSweeps_);
controlDict_.readIfPresent("nPostSweeps", nPostSweeps_);
controlDict_.readIfPresent("nFinestSweeps", nFinestSweeps_);
controlDict_.readIfPresent("scaleCorrection", scaleCorrection_);
controlDict_.readIfPresent("directSolveCoarsest", directSolveCoarsest_);
}

View File

@ -72,7 +72,7 @@ Foam::smoothSolver::smoothSolver
void Foam::smoothSolver::readControls()
{
lduMatrix::solver::readControls();
readControl(controlDict_, nSweeps_, "nSweeps");
controlDict_.readIfPresent("nSweeps", nSweeps_);
}

View File

@ -97,7 +97,7 @@ public:
const dictionary& solverDict(const word& name) const;
//- Return the stream of solver parameters for the given field
// (Provided for backward compatibility only)
// @deprecated Backward compatibility only - should use solverDict
ITstream& solver(const word& name) const;

View File

@ -52,10 +52,7 @@ Foam::patchIdentifier::patchIdentifier
name_(name),
boundaryIndex_(index)
{
if (dict.found("physicalType"))
{
dict.lookup("physicalType") >> physicalType_;
}
dict.readIfPresent("physicalType", physicalType_);
}

View File

@ -23,14 +23,15 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::genericPolyPatch.C
Foam::genericPolyPatch
Description
Determines a mapping between patch face centres and mesh cell centres and
processors they're on.
Note: storage is not optimal. It stores all face centres and cells on
all processors to keep the addressing calculation simple.
Note
Storage is not optimal. It stores all face centres and cells on all
processors to keep the addressing calculation simple.
SourceFiles
genericPolyPatch.C

View File

@ -637,10 +637,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
rotationAxis_(vector::zero),
rotationCentre_(point::zero)
{
if (dict.found("featureCos"))
{
dict.lookup("featureCos") >> featureCos_;
}
dict.readIfPresent("featureCos", featureCos_);
if (dict.found("transform"))
{
transform_ = transformTypeNames.read(dict.lookup("transform"));

View File

@ -27,14 +27,9 @@ License
#include "polyPatch.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
autoPtr<polyPatch> polyPatch::New
Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
(
const word& patchType,
const word& name,
@ -72,7 +67,7 @@ autoPtr<polyPatch> polyPatch::New
}
autoPtr<polyPatch> polyPatch::New
Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New
(
const word& name,
const dictionary& dict,
@ -89,10 +84,7 @@ autoPtr<polyPatch> polyPatch::New
word patchType(dict.lookup("type"));
if (dict.found("geometricType"))
{
dict.lookup("geometricType") >> patchType;
}
dict.readIfPresent("geometricType", patchType);
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(patchType);
@ -124,8 +116,4 @@ autoPtr<polyPatch> polyPatch::New
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -77,19 +77,14 @@ void Foam::preservePatchTypes
const dictionary& patchDict =
patchDictionary.subDict(patchNames[patchi]);
patchTypes[patchi] = word(patchDict.lookup("type"));
patchDict.lookup("type") >> patchTypes[patchi];
if (patchDict.found("geometricType"))
{
patchTypes[patchi] =
word(patchDict.lookup("geometricType"));
}
if (patchDict.found("physicalType"))
{
patchPhysicalTypes[patchi] =
word(patchDict.lookup("physicalType"));
}
patchDict.readIfPresent("geometricType", patchTypes[patchi]);
patchDict.readIfPresent
(
"physicalType",
patchPhysicalTypes[patchi]
);
}
}
@ -98,10 +93,7 @@ void Foam::preservePatchTypes
const dictionary& patchDict =
patchDictionary.subDict(defaultFacesName);
if (patchDict.found("geometricType"))
{
defaultFacesType = word(patchDict.lookup("geometricType"));
}
patchDict.readIfPresent("geometricType", defaultFacesType);
}
}

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Typedef
Foam::double and float
\*---------------------------------------------------------------------------*/
#ifndef doubleFloat_H

View File

@ -147,7 +147,7 @@ public:
wordList components(const char delimiter='/') const;
//- Return a component of the path
word component(const size_t, const char delimiter='/') const;
word component(const size_type, const char delimiter='/') const;
// Interogation

View File

@ -1,11 +1,8 @@
/* include /home/pinky2/mattijs/pub/Delaunay/CGAL-3.1/make/makefile_i686_Linux-2.6.4-52-default_g++-3.4.3 */
EXE_INC = \
/* -g -DFULLDEBUG -O0 $(CGAL_CXXFLAGS) */ \
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(FOAM_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude
@ -17,5 +14,4 @@ LIB_LIBS = \
-llagrangian \
-lmeshTools \
-ledgeMesh \
-ltriSurface \
/* $(CGAL_LDFLAGS) */
-ltriSurface

View File

@ -175,9 +175,7 @@ Foam::layerParameters::layerParameters
featureAngle_(readScalar(dict.lookup("featureAngle"))),
concaveAngle_
(
dict.found("concaveAngle")
? readScalar(dict.lookup("concaveAngle"))
: defaultConcaveAngle
dict.lookupOrDefault("concaveAngle", defaultConcaveAngle)
),
nGrow_(readLabel(dict.lookup("nGrow"))),
nSmoothSurfaceNormals_
@ -242,9 +240,7 @@ Foam::layerParameters::layerParameters
featureAngle_(readScalar(dict.lookup("featureAngle"))),
concaveAngle_
(
dict.found("concaveAngle")
? readScalar(dict.lookup("concaveAngle"))
: defaultConcaveAngle
dict.lookupOrDefault("concaveAngle", defaultConcaveAngle)
),
nGrow_(readLabel(dict.lookup("nGrow"))),
nSmoothSurfaceNormals_

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
shellSurfaces
Foam::shellSurfaces
Description
Encapsulates queries for volume refinement ('refine all cells within

View File

@ -171,14 +171,10 @@ void Foam::ensightPart::reconstruct(Istream& is)
forAll(elementTypes(), elemI)
{
word key(elementTypes()[elemI]);
if (dict.found(key))
{
dict.lookup(key) >> elemLists_[elemI];
}
else
{
elemLists_[elemI].clear();
}
elemLists_[elemI].clear();
dict.readIfPresent(key, elemLists_[elemI]);
size_ += elemLists_[elemI].size();
}

View File

@ -137,7 +137,7 @@ protected:
(
ensightFile& os,
const List<scalar>& field,
const labelList& idList
const List<label>& idList
) const;
//- track points used

View File

@ -745,17 +745,17 @@ void Foam::meshReaders::STARCD::readBoundary(const fileName& inputName)
iter != boundaryRegion_.end()
)
{
if (iter().found("BoundaryType"))
{
iter().lookup("BoundaryType") >> patchTypes_[patchI];
foundType = true;
}
foundType = iter().readIfPresent
(
"BoundaryType",
patchTypes_[patchI]
);
if (iter().found("Label"))
{
iter().lookup("Label") >> patchNames_[patchI];
foundName = true;
}
foundName = iter().readIfPresent
(
"Label",
patchNames_[patchI]
);
}
// consistent names, in long form and in lowercase

View File

@ -69,7 +69,7 @@ Foam::label Foam::metisDecomp::decompose
// Method of decomposition
// recursive: multi-level recursive bisection (default)
// k-way: multi-level k-way
// k-way: multi-level k-way
word method("k-way");
// decomposition options. 0 = use defaults
@ -88,15 +88,12 @@ Foam::label Foam::metisDecomp::decompose
// Check for user supplied weights and decomp options
if (decompositionDict_.found("metisCoeffs"))
{
dictionary metisDecompCoeffs
(
decompositionDict_.subDict("metisCoeffs")
);
const dictionary& metisCoeffs =
decompositionDict_.subDict("metisCoeffs");
word weightsFile;
if (metisDecompCoeffs.found("method"))
if (metisCoeffs.readIfPresent("method", method))
{
metisDecompCoeffs.lookup("method") >> method;
if (method != "recursive" && method != "k-way")
{
FatalErrorIn("metisDecomp::decompose()")
@ -106,14 +103,12 @@ Foam::label Foam::metisDecomp::decompose
<< exit(FatalError);
}
Info<< "metisDecomp : Using Metis options " << options
<< endl << endl;
Info<< "metisDecomp : Using Metis method " << method
<< nl << endl;
}
if (metisDecompCoeffs.found("options"))
if (metisCoeffs.readIfPresent("options", options))
{
metisDecompCoeffs.lookup("options") >> options;
if (options.size() != 5)
{
FatalErrorIn("metisDecomp::decompose()")
@ -124,12 +119,11 @@ Foam::label Foam::metisDecomp::decompose
}
Info<< "metisDecomp : Using Metis options " << options
<< endl << endl;
<< nl << endl;
}
if (metisDecompCoeffs.found("processorWeights"))
if (metisCoeffs.readIfPresent("processorWeights", processorWeights))
{
metisDecompCoeffs.lookup("processorWeights") >> processorWeights;
processorWeights /= sum(processorWeights);
if (processorWeights.size() != nProcessors_)
@ -142,20 +136,15 @@ Foam::label Foam::metisDecomp::decompose
}
}
if (metisDecompCoeffs.found("cellWeightsFile"))
if (metisCoeffs.readIfPresent("cellWeightsFile", weightsFile))
{
Info<< "metisDecomp : Using cell-based weights." << endl;
word cellWeightsFile
(
metisDecompCoeffs.lookup("cellWeightsFile")
);
IOList<int> cellIOWeights
(
IOobject
(
cellWeightsFile,
weightsFile,
mesh_.time().timeName(),
mesh_,
IOobject::MUST_READ,
@ -174,20 +163,15 @@ Foam::label Foam::metisDecomp::decompose
}
//- faceWeights disabled. Only makes sense for cellCells from mesh.
//if (metisDecompCoeffs.found("faceWeightsFile"))
//if (metisCoeffs.readIfPresent("faceWeightsFile", weightsFile))
//{
// Info<< "metisDecomp : Using face-based weights." << endl;
//
// word faceWeightsFile
// (
// metisDecompCoeffs.lookup("faceWeightsFile")
// );
//
// IOList<int> weights
// (
// IOobject
// (
// faceWeightsFile,
// weightsFile,
// mesh_.time().timeName(),
// mesh_,
// IOobject::MUST_READ,
@ -366,7 +350,7 @@ Foam::labelList Foam::metisDecomp::decompose(const pointField& points)
// number of internal faces
label nInternalFaces = 2*mesh_.nInternalFaces();
// Check the boundary for coupled patches and add to the number of
// Check the boundary for coupled patches and add to the number of
// internal faces
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();

View File

@ -516,26 +516,20 @@ Foam::labelList Foam::parMetisDecomp::decompose(const pointField& points)
// Check for user supplied weights and decomp options
if (decompositionDict_.found("metisCoeffs"))
{
dictionary parMetisDecompCoeffs
(
decompositionDict_.subDict("metisCoeffs")
);
const dictionary& metisCoeffs =
decompositionDict_.subDict("metisCoeffs");
word weightsFile;
if (parMetisDecompCoeffs.found("cellWeightsFile"))
if (metisCoeffs.readIfPresent("cellWeightsFile", weightsFile))
{
word cellWeightsFile
(
parMetisDecompCoeffs.lookup("cellWeightsFile")
);
Info<< "parMetisDecomp : Using cell-based weights read from "
<< cellWeightsFile << endl;
<< weightsFile << endl;
labelIOField cellIOWeights
(
IOobject
(
cellWeightsFile,
weightsFile,
mesh_.time().timeName(),
mesh_,
IOobject::MUST_READ,
@ -554,21 +548,16 @@ Foam::labelList Foam::parMetisDecomp::decompose(const pointField& points)
}
}
if (parMetisDecompCoeffs.found("faceWeightsFile"))
if (metisCoeffs.readIfPresent("faceWeightsFile", weightsFile))
{
word faceWeightsFile
(
parMetisDecompCoeffs.lookup("faceWeightsFile")
);
Info<< "parMetisDecomp : Using face-based weights read from "
<< faceWeightsFile << endl;
<< weightsFile << endl;
labelIOField weights
(
IOobject
(
faceWeightsFile,
weightsFile,
mesh_.time().timeName(),
mesh_,
IOobject::MUST_READ,
@ -621,12 +610,10 @@ Foam::labelList Foam::parMetisDecomp::decompose(const pointField& points)
}
}
if (parMetisDecompCoeffs.found("options"))
if (metisCoeffs.readIfPresent("options", options))
{
parMetisDecompCoeffs.lookup("options") >> options;
Info<< "Using Metis options " << options
<< endl << endl;
<< nl << endl;
if (options.size() != 3)
{
@ -835,26 +822,20 @@ Foam::labelList Foam::parMetisDecomp::decompose
// Check for user supplied weights and decomp options
if (decompositionDict_.found("metisCoeffs"))
{
dictionary parMetisDecompCoeffs
(
decompositionDict_.subDict("metisCoeffs")
);
const dictionary& metisCoeffs =
decompositionDict_.subDict("metisCoeffs");
word weightsFile;
if (parMetisDecompCoeffs.found("cellWeightsFile"))
if (metisCoeffs.readIfPresent("cellWeightsFile", weightsFile))
{
word cellWeightsFile
(
parMetisDecompCoeffs.lookup("cellWeightsFile")
);
Info<< "parMetisDecomp : Using cell-based weights read from "
<< cellWeightsFile << endl;
<< weightsFile << endl;
labelIOField cellIOWeights
(
IOobject
(
cellWeightsFile,
weightsFile,
mesh_.time().timeName(),
mesh_,
IOobject::MUST_READ,
@ -877,21 +858,16 @@ Foam::labelList Foam::parMetisDecomp::decompose
}
//- faceWeights disabled. Only makes sense for cellCells from mesh.
//if (parMetisDecompCoeffs.found("faceWeightsFile"))
//if (metisCoeffs.readIfPresent("faceWeightsFile", weightsFile))
//{
// word faceWeightsFile
// (
// parMetisDecompCoeffs.lookup("faceWeightsFile")
// );
//
// Info<< "parMetisDecomp : Using face-based weights read from "
// << faceWeightsFile << endl;
// << weightsFile << endl;
//
// labelIOField weights
// (
// IOobject
// (
// faceWeightsFile,
// weightsFile,
// mesh_.time().timeName(),
// mesh_,
// IOobject::MUST_READ,
@ -944,12 +920,10 @@ Foam::labelList Foam::parMetisDecomp::decompose
// }
//}
if (parMetisDecompCoeffs.found("options"))
if (metisCoeffs.readIfPresent("options", options))
{
parMetisDecompCoeffs.lookup("options") >> options;
Info<< "Using Metis options " << options
<< endl << endl;
<< nl << endl;
if (options.size() != 3)
{

View File

@ -501,7 +501,7 @@ Foam::scalar Foam::octreeDataFaceList::calcSign
(
const label index,
const point& sample,
point&
vector&
) const
{
label faceI = faceLabels_[index];

View File

@ -102,14 +102,7 @@ Foam::scalar Foam::layerAdditionRemoval::readOldThickness
const dictionary& dict
)
{
if (dict.found("oldLayerThickness"))
{
return readScalar(dict.lookup("oldLayerThickness"));
}
else
{
return -1.0;
}
dict.lookupOrDefault("oldLayerThickness", -1.0);
}
@ -279,7 +272,7 @@ bool Foam::layerAdditionRemoval::changeTopology() const
<< "Layer thickness: min: " << minDelta
<< " max: " << maxDelta << " avg: " << avgDelta
<< " old thickness: " << oldLayerThickness_ << nl
<< "Removal threshold: " << minLayerThickness_
<< "Removal threshold: " << minLayerThickness_
<< " addition threshold: " << maxLayerThickness_ << endl;
}
@ -295,7 +288,7 @@ bool Foam::layerAdditionRemoval::changeTopology() const
}
// No topological changes allowed before first mesh motion
//
//
oldLayerThickness_ = avgDelta;
topologicalChange = false;
@ -314,7 +307,7 @@ bool Foam::layerAdditionRemoval::changeTopology() const
// At this point, info about moving the old mesh
// in a way to collapse the cells in the removed
// layer is available. Not sure what to do with
// it.
// it.
if (debug)
{

View File

@ -27,18 +27,18 @@ Class
Description
Given a displacement moves the mesh by scaling the displacement back
until there are no more mesh errors. Holds displacement field
(read upon construction since need boundary conditions) and scaling factor
and optional patch number on which to scale back displacement.
until there are no more mesh errors.
E.g.
Holds displacement field (read upon construction since need boundary
conditions) and scaling factor and optional patch number on which to
scale back displacement.
E.g.
@verbatim
// Construct iterative mesh mover.
motionSmoother meshMover(mesh, labelList(1, patchI));
// Set wanted displacement:
// Set desired displacement:
meshMover.displacement() = ..
for (label iter = 0; iter < maxIter; iter++)
@ -49,19 +49,20 @@ Description
return true;
}
}
@envverbatim
@endverbatim
Note
Shared points (parallel): a processor can have points which are part of
pp on another processor but have no pp itself (i.e. it has points
and/or edges but no faces of pp). Hence we have to be careful when e.g.
synchronising displacements that the value from the processor which has
faces of pp get priority. This is currently handled in setDisplacement
by resetting the internal displacement to zero before doing anything
else. The combine operator used will give preference to non-zero
values.
Note: shared points (parallel). A processor can have points which are
part of pp on another processor but have no pp itself (i.e. it has points
and/or edges but no faces of pp). Hence we have to be careful when
e.g. synchronising displacements that the value from the processor which
has faces of pp get priority. This is currently handled in setDisplacement
by resetting the internal displacement to zero before doing anything else.
The combine operator used will give preference to non-zero values.
Note: various routines take baffles. These are sets of boundary faces
that are treated as a single internal face. This is a hack used to apply
Various routines take baffles. These are sets of boundary faces that
are treated as a single internal face. This is a hack used to apply
movement to internal faces.
SourceFiles
@ -420,7 +421,7 @@ public:
labelHashSet& wrongFaces
);
//- Check (subset of mesh including baffles) with mesh settings
//- Check (subset of mesh including baffles) with mesh settings
// in dict. Collects incorrect faces in set. Returns true if one
// or more faces in error. Parallel ok.
static bool checkMesh

View File

@ -84,23 +84,11 @@ Foam::engineTime::engineTime
stroke_(dimensionedScalar("stroke", dimLength, 0)),
clearance_(dimensionedScalar("clearance", dimLength, 0))
{
// the geometric parameters are not strictly required for Time
if (dict_.found("conRodLength"))
{
dict_.lookup("conRodLength") >> conRodLength_;
}
if (dict_.found("bore"))
{
dict_.lookup("bore") >> bore_;
}
if (dict_.found("stroke"))
{
dict_.lookup("stroke") >> stroke_;
}
if (dict_.found("clearance"))
{
dict_.lookup("clearance") >> clearance_;
}
// geometric parameters are not strictly required for Time
dict_.readIfPresent("conRodLength", conRodLength_);
dict_.readIfPresent("bore", bore_);
dict_.readIfPresent("stroke", stroke_);
dict_.readIfPresent("clearance", clearance_);
timeAdjustment();

View File

@ -35,8 +35,8 @@ Description
type timeVaryingFlowRateInletVelocity;
flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
value uniform (0 0 0); // placeholder
fileName "time-series";
boundAction repeat; // (error|warn|clamp|repeat)
fileName "$FOAM_CASE/time-series";
outOfBounds repeat; // (error|warn|clamp|repeat)
}
@endverbatim

View File

@ -33,8 +33,8 @@ Description
inlet
{
type timeVaryingUniformFixedValue;
fileName "time-series";
boundAction clamp; // (error|warn|clamp|repeat)
fileName "$FOAM_CASE/time-series";
outOfBounds clamp; // (error|warn|clamp|repeat)
}
@endverbatim

View File

@ -342,11 +342,11 @@ public:
//- Relax matrix (for steady-state solution).
// alpha = 1 : diagonally equal
// alpha < 1 : ,, dominant
// alpha < 1 : diagonally dominant
// alpha = 0 : do nothing
void relax(const scalar alpha);
//- Relax matrix (for steadty-state solution).
//- Relax matrix (for steady-state solution).
// alpha is read from controlDict
void relax();

View File

@ -35,7 +35,7 @@ Description
- interpolates the displacement of all points based on the
faceZone motion.
Tables are in the <verbatim>constant/tables</verbatim> directory.
Tables are in the @a constant/tables directory.
Note
could be a motionSolver - does not use any fvMesh structure.

View File

@ -27,15 +27,17 @@ Class
Description
Manual injection
- User specifies
- Total mass to inject
- Parcel positions in file <positionsFile>
- Parcel positions in file @c positionsFile
- Initial parcel velocity
- Parcel diameters obtained by PDF model
- All parcels introduced at the start of the calculation
NOTE - not suitable for 2-D slab/wedge simulations unless the positions
file describes 2-D data!
Note
Not suitable for 2-D slab/wedge simulations unless the @c positionsFile
describes 2-D data.
SourceFiles
ManualInjection.C

View File

@ -23,9 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
molecule
Foam::molecule
Description
Foam::molecule
SourceFiles
moleculeI.H
@ -59,12 +60,12 @@ class molecule
{
// Private data
//- Be careful with the ordering of data. It has an impact on binary
// transfer:
// 1) Put the largest data members 1st
// 2) Pair up labels,
// 3) Don't go scalar-label, scalar-label, becasue in 64bit mode,
// the labels will be padded by 4bytes.
//- Be careful with the ordering of data.
// It has an impact on binary transfer:
// -# Put the largest data members 1st
// -# Pair up labels,
// -# Don't go scalar-label, scalar-label, because in 64bit mode,
// the labels will be padded by 4bytes.
// - mass of molecule
scalar mass_;
@ -200,16 +201,15 @@ public:
// Member Operators
//- Overridable function to handle the particle hitting a
// processorPatch
//- Overridable function to handle the particle hitting a processorPatch
void hitProcessorPatch
(
const processorPolyPatch&,
molecule::trackData& td
);
//- Overridable function to handle the particle hitting a
// processorPatch without trackData
//- Overridable function to handle the particle hitting a processorPatch
// without trackData
void hitProcessorPatch
(
const processorPolyPatch&,
@ -224,7 +224,7 @@ public:
);
//- Overridable function to handle the particle hitting a wallPatch
//- without trackData
// without trackData
void hitWallPatch
(
const wallPolyPatch&,
@ -239,7 +239,7 @@ public:
);
//- Overridable function to handle the particle hitting a polyPatch
//- without trackData
// without trackData
void hitPatch
(
const polyPatch&,

View File

@ -22,11 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
moleculeCloud
Description
\*----------------------------------------------------------------------------*/
#include "moleculeCloud.H"

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
energyScalingFunction
\*---------------------------------------------------------------------------*/
#include "energyScalingFunction.H"

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
energyScalingFunction
\*---------------------------------------------------------------------------*/
#include "energyScalingFunction.H"

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
pairPotential
\*---------------------------------------------------------------------------*/
#include "pairPotential.H"

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
pairPotential
\*---------------------------------------------------------------------------*/
#include "pairPotential.H"

View File

@ -26,22 +26,24 @@ Class
Foam::pairPotentials::azizChen
Description
Foam::pairPotentials::azizChen
From:
@article{MA_Aziz_Chen,
author = {R. A. Aziz and H. H. Chen},
collaboration = {},
title = {An accurate intermolecular potential for argon},
publisher = {AIP},
year = {1977},
journal = {The Journal of Chemical Physics},
volume = {67},
number = {12},
pages = {5719-5726},
url = {http://link.aip.org/link/?JCP/67/5719/1},
doi = {10.1063/1.434827}
}
@verbatim
@article{MA_Aziz_Chen,
author = {R. A. Aziz and H. H. Chen},
collaboration = {},
title = {An accurate intermolecular potential for argon},
publisher = {AIP},
year = {1977},
journal = {The Journal of Chemical Physics},
volume = {67},
number = {12},
pages = {5719-5726},
url = {http://link.aip.org/link/?JCP/67/5719/1},
doi = {10.1063/1.434827}
}
@endverbatim
SourceFiles
azizChen.C

View File

@ -26,28 +26,32 @@ Class
Foam::pairPotentials::maitlandSmith
Description
Foam::pairPotentials::maitlandSmith
From:
@ARTICLE{MA_Maitland_Smith,
author = {{Maitland}, G.~C. and {Smith}, E.~B.},
title = {A simplified representation of intermolecular potential energy},
journal = {Chemical Physics Letters},
year = 1973,
month = oct,
volume = 22,
pages = {443-446},
adsurl = {http://adsabs.harvard.edu/abs/1973CPL....22..443M},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
@verbatim
@ARTICLE{MA_Maitland_Smith,
author = {{Maitland}, G.~C. and {Smith}, E.~B.},
title = {A simplified representation of intermolecular potential energy},
journal = {Chemical Physics Letters},
year = 1973,
month = oct,
volume = 22,
pages = {443-446},
adsurl = {http://adsabs.harvard.edu/abs/1973CPL....22..443M},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
@endverbatim
Parameters for other monoatomics from:
@BOOK{MD_Maitland_Rigby_Smith_Wakeham,
AUTHOR = {Geoffrey C. Maitland and Maurice Rigby and E. Brian Smith and William A. Wakeham},
TITLE = {Intermolecular Forces: Their Origin and Determination},
PUBLISHER = {Oxford University Press},
YEAR = {1981}
}
@verbatim
@BOOK{MD_Maitland_Rigby_Smith_Wakeham,
AUTHOR = {Geoffrey C. Maitland and Maurice Rigby and E. Brian Smith and William A. Wakeham},
TITLE = {Intermolecular Forces: Their Origin and Determination},
PUBLISHER = {Oxford University Press},
YEAR = {1981}
}
@endverbatim
SourceFiles
maitlandSmith.C

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
tetherPotential
\*---------------------------------------------------------------------------*/
#include "tetherPotential.H"

View File

@ -162,10 +162,7 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New
// default type is self (alias: "axes")
word rotType(typeName_());
if (dict.found("type"))
{
dict.lookup("type") >> rotType;
}
dict.readIfPresent("type", rotType);
// can (must) construct base class directly
if (rotType == typeName_() || rotType == "axes")

View File

@ -23,14 +23,15 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::directMappedPolyPatch.C
Foam::directMappedPolyPatch
Description
Determines a mapping between patch face centres and mesh cell centres and
processors they're on.
Note: storage is not optimal. It stores all face centres and cells on
all processors to keep the addressing calculation simple.
Note
Storage is not optimal. It stores all face centres and cells on all
processors to keep the addressing calculation simple.
SourceFiles
directMappedPolyPatch.C

View File

@ -176,12 +176,7 @@ Foam::searchableSurfaces::searchableSurfaces
const dictionary& dict = topDict.subDict(key);
names_[surfI] = key;
if (dict.found("name"))
{
dict.lookup("name") >> names_[surfI];
}
dict.readIfPresent("name", names_[surfI]);
// Make IOobject with correct name
autoPtr<IOobject> namedIO(io.clone());

View File

@ -66,7 +66,7 @@ Description
Information regarding the number of averaging steps, and total averaging
time are written on a (base) per-field basis to the
fieldAveragingProperties dictionary, located in <time>/uniform
fieldAveragingProperties dictionary, located in \<time\>/uniform
SourceFiles
fieldAverage.C

View File

@ -33,7 +33,7 @@ Description
moments.
Member function forces::write() calls calcForcesMoment() and writes the
forces and moments into the file <time dir>/forces.dat
forces and moments into the file \<timeDir\>/forces.dat
SourceFiles
forces.C

View File

@ -34,6 +34,7 @@ Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
(
const objectRegistry& obr,
const fileName& dictName,
const IOobject::readOption rOpt,
const bool readFromFiles
)
:
@ -44,7 +45,7 @@ Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
dictName,
obr.time().system(),
obr,
IOobject::MUST_READ,
rOpt,
IOobject::NO_WRITE
)
),

View File

@ -70,11 +70,13 @@ public:
// Constructors
//- Construct for given objectRegistry and dictionary
// allow the possibility to load fields from files
// Allow dictionary to be optional
// Allow the possibility to load fields from files
IOOutputFilter
(
const objectRegistry&,
const fileName& dictName = OutputFilter::typeName() + "Dict",
const IOobject::readOption rOpt = IOobject::MUST_READ,
const bool loadFromFile = false
);

View File

@ -34,25 +34,10 @@ License
template<class OutputFilter>
void Foam::OutputFilterFunctionObject<OutputFilter>::readDict()
{
if (dict_.found("region"))
{
dict_.lookup("region") >> regionName_;
}
if (dict_.found("dictionary"))
{
dict_.lookup("dictionary") >> dictName_;
}
if (dict_.found("interval"))
{
dict_.lookup("interval") >> interval_;
}
if (dict_.found("enabled"))
{
dict_.lookup("enabled") >> execution_;
}
dict_.readIfPresent("region", regionName_);
dict_.readIfPresent("dictionary", dictName_);
dict_.readIfPresent("interval", interval_);
dict_.readIfPresent("enabled", execution_);
}

View File

@ -26,8 +26,14 @@ Class
Foam::OutputFilterFunctionObject
Description
FunctionObject wrapper around OutputFilter to allow them to be created
via the functions list within controlDict.
A functionObject wrapper around OutputFilter to allow them to be
created via the functions list within controlDict.
Note
Since the timeIndex is used directly from Foam::Time, it is unaffected
by user-time conversions. For example, Foam::engineTime might cause @a
writeInterval to be degrees crank angle, but the functionObject
execution @a interval would still be in timestep.
SourceFiles
OutputFilterFunctionObject.C

View File

@ -289,16 +289,10 @@ void Foam::sampledSets::read(const dictionary& dict)
fieldNames_ = wordList(dict_.lookup("fields"));
interpolationScheme_ = "cell";
if (dict_.found("interpolationScheme"))
{
dict_.lookup("interpolationScheme") >> interpolationScheme_;
}
dict_.readIfPresent("interpolationScheme", interpolationScheme_);
writeFormat_ = "null";
if (dict_.found("setFormat"))
{
dict_.lookup("setFormat") >> writeFormat_;
}
dict_.readIfPresent("setFormat", writeFormat_);
scalarFields_.clear();
vectorFields_.clear();

View File

@ -156,9 +156,8 @@ Foam::sampledPlane::sampledPlane
label zoneId = -1;
if (dict.found("zone"))
if (dict.readIfPresent("zone", zoneName_))
{
dict.lookup("zone") >> zoneName_;
zoneId = mesh.cellZones().findZoneID(zoneName_);
if (debug && zoneId < 0)
{

View File

@ -188,10 +188,7 @@ Foam::sampledSurface::sampledSurface
CfPtr_(NULL),
area_(-1)
{
if (dict.found("name"))
{
dict.lookup("name") >> name_;
}
dict.readIfPresent("name", name_);
}

View File

@ -327,16 +327,10 @@ void Foam::sampledSurfaces::read(const dictionary& dict)
fieldNames_ = wordList(dict.lookup("fields"));
interpolationScheme_ = "cell";
if (dict.found("interpolationScheme"))
{
dict.lookup("interpolationScheme") >> interpolationScheme_;
}
dict.readIfPresent("interpolationScheme", interpolationScheme_);
writeFormat_ = "null";
if (dict.found("surfaceFormat"))
{
dict.lookup("surfaceFormat") >> writeFormat_;
}
dict.readIfPresent("surfaceFormat", writeFormat_);
PtrList<sampledSurface> newList

View File

@ -46,10 +46,7 @@ Foam::autoPtr<Foam::chemistryReader> Foam::chemistryReader::New
word chemistryReaderTypeName("chemkinReader");
// otherwise use the specified reader
if (thermoDict.found("chemistryReader"))
{
thermoDict.lookup("chemistryReader") >> chemistryReaderTypeName;
}
thermoDict.readIfPresent("chemistryReader", chemistryReaderTypeName);
Info<< "Selecting chemistryReader " << chemistryReaderTypeName << endl;

View File

@ -37,6 +37,7 @@ License
int Foam::chemkinReader::yyBufSize = YY_BUF_SIZE;
// Dummy yyFlexLexer::yylex() to keep the linker happy. It is not called
//! @cond dummy
int yyFlexLexer::yylex()
{
Foam::FatalErrorIn("yyFlexLexer::yylex()")
@ -45,11 +46,13 @@ int yyFlexLexer::yylex()
return 0;
}
//! @endcond dummy
// Dummy yywrap to keep yylex happy at compile time.
// It is called by yylex but is not used as the mechanism to change file.
// See <<EOF>>
//! @cond dummy
#if YY_FLEX_SUBMINOR_VERSION < 34
extern "C" int yywrap()
#else
@ -58,6 +61,8 @@ int yyFlexLexer::yywrap()
{
return 1;
}
//! @endcond dummy
Foam::string foamSpecieString(const char* YYText)
{

View File

@ -40,6 +40,7 @@ License
using namespace Foam;
// Dummy yyFlexLexer::yylex() to keep the linker happy. It is not called
//! @cond dummy
int yyFlexLexer::yylex()
{
FatalErrorIn("yyFlexLexer::yylex()")
@ -47,10 +48,12 @@ int yyFlexLexer::yylex()
<< abort(FatalError);
return 0;
}
//! @endcond dummy
// Dummy yywrap to keep yylex happy at compile time.
// It is called by yylex but is not used as the mechanism to change file.
// See <<EOF>>
//! @cond dummy
#if YY_FLEX_SUBMINOR_VERSION < 34
extern "C" int yywrap()
#else
@ -59,6 +62,7 @@ int yyFlexLexer::yywrap()
{
return 1;
}
//! @endcond dummy
class STLLexer

View File

@ -88,10 +88,7 @@ LESModel::LESModel
delta_(LESdelta::New("delta", U.mesh(), *this))
{
if (found("k0"))
{
lookup("k0") >> k0_;
}
readIfPresent("k0", k0_);
}
@ -117,10 +114,7 @@ bool LESModel::read()
delta_().read(*this);
if (found("k0"))
{
lookup("k0") >> k0_;
}
readIfPresent("k0", k0_);
return true;
}

View File

@ -87,10 +87,7 @@ LESModel::LESModel
delta_(LESdelta::New("delta", U.mesh(), *this))
{
if (found("k0"))
{
lookup("k0") >> k0_;
}
readIfPresent("k0", k0_);
}
@ -117,10 +114,7 @@ bool LESModel::read()
delta_().read(*this);
if (found("k0"))
{
lookup("k0") >> k0_;
}
readIfPresent("k0", k0_);
return true;
}

View File

@ -47,7 +47,7 @@ Description
D = symm(grad(U));
nuSgs = ck*sqrt(k)*delta
nuEff = nuSgs + nu
@endverabtim
@endverbatim
SourceFiles
dynOneEqEddy.C

View File

@ -41,7 +41,7 @@ Description
Etemad, S., et al.,
"Turbulent flow and heat transfer in a square-sectioned U bend"
Progress in compuational fluid dynamics 6, 89-100. 2006.
@verbatim
@endverbatim
SourceFiles
LienCubicKELowRe.C