Commit 8c3ef654 authored by Mark Olesen's avatar Mark Olesen
Browse files

misc. cosmetic changes

parent 22f6b4dc
......@@ -322,7 +322,7 @@ Foam::Istream* Foam::IOobject::objectStream()
{
fileName fName = filePath();
if (fName != fileName::null)
if (fName.size())
{
IFstream* isPtr = new IFstream(fName);
......
......@@ -29,14 +29,10 @@ License
#include "Time.H"
#include "PstreamReduceOps.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Istream& regIOobject::readStream()
Foam::Istream& Foam::regIOobject::readStream()
{
if (IFstream::debug)
{
......@@ -48,7 +44,7 @@ Istream& regIOobject::readStream()
if (readOpt() == NO_READ)
{
FatalErrorIn("regIOobject::readStream(const word&)")
FatalErrorIn("regIOobject::readStream()")
<< "NO_READ specified for read-constructor of object " << name()
<< " of class " << headerClassName()
<< abort(FatalError);
......@@ -61,7 +57,7 @@ Istream& regIOobject::readStream()
{
FatalIOError
(
"regIOobject::readStream(const word&)",
"regIOobject::readStream()",
__FILE__,
__LINE__,
objectPath(),
......@@ -71,7 +67,7 @@ Istream& regIOobject::readStream()
}
else if (!readHeader(*isPtr_))
{
FatalIOErrorIn("regIOobject::readStream(const word&)", *isPtr_)
FatalIOErrorIn("regIOobject::readStream()", *isPtr_)
<< "problem while reading header for object " << name()
<< exit(FatalIOError);
}
......@@ -86,7 +82,7 @@ Istream& regIOobject::readStream()
}
Istream& regIOobject::readStream(const word& aType)
Foam::Istream& Foam::regIOobject::readStream(const word& expectName)
{
if (IFstream::debug)
{
......@@ -106,14 +102,14 @@ Istream& regIOobject::readStream(const word& aType)
// instantiated is a dictionary
if
(
aType != word::null
&& headerClassName() != aType
expectName.size()
&& headerClassName() != expectName
&& headerClassName() != "dictionary"
)
{
FatalIOErrorIn("regIOobject::readStream(const word&)", *isPtr_)
<< "unexpected class name " << headerClassName()
<< " expected " << aType << endl
<< " expected " << expectName << endl
<< " while reading object " << name()
<< exit(FatalIOError);
}
......@@ -123,7 +119,7 @@ Istream& regIOobject::readStream(const word& aType)
}
void regIOobject::close()
void Foam::regIOobject::close()
{
if (IFstream::debug)
{
......@@ -140,13 +136,13 @@ void regIOobject::close()
}
bool regIOobject::readData(Istream&)
bool Foam::regIOobject::readData(Istream&)
{
return false;
}
bool regIOobject::read()
bool Foam::regIOobject::read()
{
bool ok = readData(readStream(type()));
close();
......@@ -154,7 +150,7 @@ bool regIOobject::read()
}
bool regIOobject::modified() const
bool Foam::regIOobject::modified() const
{
return
(
......@@ -164,7 +160,7 @@ bool regIOobject::modified() const
}
bool regIOobject::readIfModified()
bool Foam::regIOobject::readIfModified()
{
if (lastModified_)
{
......@@ -213,8 +209,4 @@ bool regIOobject::readIfModified()
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
......@@ -105,7 +105,7 @@ void pointPatchField<Type>::write(Ostream& os) const
{
os.writeKeyword("type") << type() << token::END_STATEMENT << nl;
if (patchType_ != word::null)
if (patchType_.size())
{
os.writeKeyword("patchType") << patchType_
<< token::END_STATEMENT << nl;
......
......@@ -37,7 +37,7 @@ Foam::patchIdentifier::patchIdentifier
)
:
name_(name),
boundaryIndex_(index),
index_(index),
physicalType_(physicalType)
{}
......@@ -50,7 +50,7 @@ Foam::patchIdentifier::patchIdentifier
)
:
name_(name),
boundaryIndex_(index)
index_(index)
{
dict.readIfPresent("physicalType", physicalType_);
}
......@@ -63,7 +63,7 @@ Foam::patchIdentifier::patchIdentifier
)
:
name_(p.name_),
boundaryIndex_(index),
index_(index),
physicalType_(p.physicalType_)
{}
......
......@@ -64,7 +64,7 @@ class patchIdentifier
word name_;
//- Index of patch in boundary
label boundaryIndex_;
label index_;
//- Optional physical type
mutable word physicalType_;
......@@ -86,14 +86,14 @@ public:
patchIdentifier
(
const word& name,
const dictionary& dict,
const dictionary&,
const label index
);
//- Construct from geometric patch, resetting the index
patchIdentifier
(
const patchIdentifier& p,
const patchIdentifier&,
const label index
);
......@@ -132,13 +132,13 @@ public:
//- Return the index of this patch in the boundaryMesh
label index() const
{
return boundaryIndex_;
return index_;
}
//- Return the index of this patch in the boundaryMesh for modification
label& index()
{
return boundaryIndex_;
return index_;
}
//- Write patchIdentifier as a dictionary
......
......@@ -25,35 +25,28 @@ License
\*---------------------------------------------------------------------------*/
#include "globalPointPatch.H"
#include "globalMeshData.H"
#include "triFace.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(globalPointPatch, 0);
defineTypeNameAndDebug(Foam::globalPointPatch, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
globalPointPatch::globalPointPatch
Foam::globalPointPatch::globalPointPatch
(
const pointBoundaryMesh& bm,
const label bi
const label index
)
:
pointPatch(bm),
coupledPointPatch(bm),
boundaryIndex_(bi)
index_(index)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
globalPointPatch::~globalPointPatch()
Foam::globalPointPatch::~globalPointPatch()
{}
......@@ -62,6 +55,4 @@ globalPointPatch::~globalPointPatch()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
......@@ -47,7 +47,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class globalPointPatch Declaration
Class globalPointPatch Declaration
\*---------------------------------------------------------------------------*/
class globalPointPatch
......@@ -57,11 +57,11 @@ class globalPointPatch
{
// Private data
////- Reference to the basic globalMeshData
//const globalMeshData& globalMeshData_;
// //- Reference to the basic globalMeshData
// const globalMeshData& globalMeshData_;
//- Index in the boundary mesh
label boundaryIndex_;
label index_;
// Protected Member Functions
......@@ -113,7 +113,7 @@ public:
//- Construct from components
globalPointPatch
(
const pointBoundaryMesh& bm,
const pointBoundaryMesh&,
const label index
);
......@@ -129,7 +129,7 @@ public:
virtual const word& name() const
{
// There can only be a single patch of this type - therefore
// its name is hard-coded.
// its name is hard-coded.
return type();
}
......@@ -161,7 +161,7 @@ public:
//- Return the index of this patch in the pointBoundaryMesh
virtual label index() const
{
return boundaryIndex_;
return index_;
}
//- Return mesh points
......
......@@ -236,7 +236,7 @@ void Foam::fvPatchField<Type>::write(Ostream& os) const
{
os.writeKeyword("type") << type() << token::END_STATEMENT << nl;
if (patchType_ != word::null)
if (patchType_.size())
{
os.writeKeyword("patchType") << patchType_
<< token::END_STATEMENT << nl;
......
......@@ -50,7 +50,7 @@ const Foam::fileName& Foam::triSurfaceMesh::checkFile
const fileName& objectName
)
{
if (fName == fileName::null)
if (fName.empty())
{
FatalErrorIn
(
......
......@@ -797,7 +797,7 @@ void Foam::chemkinReader::read
const fileName& thermoFileName
)
{
if (thermoFileName != fileName::null)
if (thermoFileName.size())
{
std::ifstream thermoStream(thermoFileName.c_str());
......
......@@ -43,7 +43,7 @@ geometricSurfacePatch::geometricSurfacePatch()
:
geometricType_("empty"),
name_("patch"),
boundaryIndex_(0)
index_(0)
{}
......@@ -57,7 +57,7 @@ geometricSurfacePatch::geometricSurfacePatch
:
geometricType_(geometricType),
name_(name),
boundaryIndex_(index)
index_(index)
{
if (geometricType_.empty())
......@@ -72,7 +72,7 @@ geometricSurfacePatch::geometricSurfacePatch(Istream& is, const label index)
:
geometricType_(is),
name_(is),
boundaryIndex_(index)
index_(index)
{
if (geometricType_.empty())
{
......@@ -91,7 +91,7 @@ geometricSurfacePatch::geometricSurfacePatch
:
geometricType_(dict.lookup("geometricType")),
name_(name),
boundaryIndex_(index)
index_(index)
{
if (geometricType_.empty())
{
......
......@@ -63,7 +63,7 @@ class geometricSurfacePatch
word name_;
//- Index of patch in boundary
label boundaryIndex_;
label index_;
public:
......@@ -125,7 +125,7 @@ public:
//- Return the index of this patch in the boundaryMesh
label index() const
{
return boundaryIndex_;
return index_;
}
//- Write
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment