Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
68e86f97
Commit
68e86f97
authored
Jan 20, 2016
by
Henry Weller
Browse files
Info -> InfoInFunction and updated comments
parent
1bd1a493
Changes
45
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/containers/HashTables/HashTable/HashTable.C
View file @
68e86f97
...
...
@@ -121,13 +121,12 @@ bool Foam::HashTable<T, Key, Hash>::found(const Key& key) const
}
}
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"HashTable<T, Key, Hash>::found(const Key& key) : "
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
InfoInFunction
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
}
#
endif
#
endif
return
false
;
}
...
...
@@ -153,13 +152,12 @@ Foam::HashTable<T, Key, Hash>::find
}
}
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"HashTable<T, Key, Hash>::find(const Key& key) : "
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
InfoInFunction
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
}
#
endif
#
endif
return
iterator
();
}
...
...
@@ -185,13 +183,12 @@ Foam::HashTable<T, Key, Hash>::find
}
}
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"HashTable<T, Key, Hash>::find(const Key& key) const : "
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
InfoInFunction
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
}
#
endif
#
endif
return
const_iterator
();
}
...
...
@@ -250,7 +247,7 @@ bool Foam::HashTable<T, Key, Hash>::set
prev
=
ep
;
}
//
n
ot found, insert it at the head
//
N
ot found, insert it at the head
if
(
!
existing
)
{
table_
[
hashIdx
]
=
new
hashedEntry
(
key
,
table_
[
hashIdx
],
newEntry
);
...
...
@@ -258,39 +255,36 @@ bool Foam::HashTable<T, Key, Hash>::set
if
(
double
(
nElmts_
)
/
tableSize_
>
0
.
8
&&
tableSize_
<
maxTableSize
)
{
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"HashTable<T, Key, Hash>::set"
"(const Key& key, T newEntry) : "
"Doubling table size
\n
"
;
InfoInFunction
<<
"Doubling table size
\n
"
;
}
#
endif
#
endif
resize
(
2
*
tableSize_
);
}
}
else
if
(
protect
)
{
//
f
ound - but protected from overwriting
//
F
ound - but protected from overwriting
// this corresponds to the STL 'insert' convention
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"HashTable<T, Key, Hash>::set"
"(const Key& key, T newEntry, true) : "
"Cannot insert "
<<
key
<<
" already in hash table
\n
"
;
InfoInFunction
<<
"Cannot insert "
<<
key
<<
" already in hash table
\n
"
;
}
#
endif
#
endif
return
false
;
}
else
{
//
f
ound - overwrite existing entry
//
F
ound - overwrite existing entry
// this corresponds to the Perl convention
hashedEntry
*
ep
=
new
hashedEntry
(
key
,
existing
->
next_
,
newEntry
);
//
r
eplace existing element - within list or insert at the head
//
R
eplace existing element - within list or insert at the head
if
(
prev
)
{
prev
->
next_
=
ep
;
...
...
@@ -310,7 +304,7 @@ bool Foam::HashTable<T, Key, Hash>::set
template
<
class
T
,
class
Key
,
class
Hash
>
bool
Foam
::
HashTable
<
T
,
Key
,
Hash
>::
iteratorBase
::
erase
()
{
//
n
ote: entryPtr_ is NULL for end(), so this catches that too
//
N
ote: entryPtr_ is NULL for end(), so this catches that too
if
(
entryPtr_
)
{
// Search element before entryPtr_
...
...
@@ -332,7 +326,7 @@ bool Foam::HashTable<T, Key, Hash>::iteratorBase::erase()
if
(
prev
)
{
//
h
as an element before entryPtr - reposition to there
//
H
as an element before entryPtr - reposition to there
prev
->
next_
=
entryPtr_
->
next_
;
delete
entryPtr_
;
entryPtr_
=
prev
;
...
...
@@ -343,7 +337,7 @@ bool Foam::HashTable<T, Key, Hash>::iteratorBase::erase()
hashTable_
->
table_
[
hashIndex_
]
=
entryPtr_
->
next_
;
delete
entryPtr_
;
//
a
ssign any non-NULL pointer value so it doesn't look
//
A
ssign any non-NULL pointer value so it doesn't look
// like end()/cend()
entryPtr_
=
reinterpret_cast
<
hashedEntry
*>
(
this
);
...
...
@@ -378,7 +372,7 @@ bool Foam::HashTable<T, Key, Hash>::iteratorBase::erase()
template
<
class
T
,
class
Key
,
class
Hash
>
bool
Foam
::
HashTable
<
T
,
Key
,
Hash
>::
erase
(
const
iterator
&
iter
)
{
//
a
djust iterator after erase
//
A
djust iterator after erase
return
const_cast
<
iterator
&>
(
iter
).
erase
();
}
...
...
@@ -439,13 +433,12 @@ void Foam::HashTable<T, Key, Hash>::resize(const label sz)
if
(
newSize
==
tableSize_
)
{
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"HashTable<T, Key, Hash>::resize(const label) : "
<<
"new table size == old table size
\n
"
;
InfoInFunction
<<
"New table size == old table size
\n
"
;
}
#
endif
#
endif
return
;
}
...
...
@@ -508,7 +501,7 @@ void Foam::HashTable<T, Key, Hash>::shrink()
if
(
newSize
<
tableSize_
)
{
//
a
void having the table disappear on us
//
A
void having the table disappear on us
resize
(
newSize
?
newSize
:
2
);
}
}
...
...
@@ -517,7 +510,7 @@ void Foam::HashTable<T, Key, Hash>::shrink()
template
<
class
T
,
class
Key
,
class
Hash
>
void
Foam
::
HashTable
<
T
,
Key
,
Hash
>::
transfer
(
HashTable
<
T
,
Key
,
Hash
>&
ht
)
{
//
a
s per the Destructor
//
A
s per the Destructor
if
(
table_
)
{
clear
();
...
...
@@ -551,7 +544,7 @@ void Foam::HashTable<T, Key, Hash>::operator=
<<
abort
(
FatalError
);
}
//
c
ould be zero-sized from a previous transfer()
//
C
ould be zero-sized from a previous transfer()
if
(
!
tableSize_
)
{
resize
(
rhs
.
tableSize_
);
...
...
@@ -574,7 +567,7 @@ bool Foam::HashTable<T, Key, Hash>::operator==
const
HashTable
<
T
,
Key
,
Hash
>&
rhs
)
const
{
//
s
izes (number of keys) must match
//
S
izes (number of keys) must match
if
(
size
()
!=
rhs
.
size
())
{
return
false
;
...
...
src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C
View file @
68e86f97
...
...
@@ -39,12 +39,12 @@ Foam::label Foam::StaticHashTableCore::canonicalSize(const label size)
return
0
;
}
//
e
nforce power of two
//
E
nforce power of two
unsigned
int
goodSize
=
size
;
if
(
goodSize
&
(
goodSize
-
1
))
{
//
b
rute-force is fast enough
//
B
rute-force is fast enough
goodSize
=
1
;
while
(
goodSize
<
unsigned
(
size
))
{
...
...
@@ -58,7 +58,6 @@ Foam::label Foam::StaticHashTableCore::canonicalSize(const label size)
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct given initial table size
template
<
class
T
,
class
Key
,
class
Hash
>
Foam
::
StaticHashTable
<
T
,
Key
,
Hash
>::
StaticHashTable
(
const
label
size
)
:
...
...
@@ -78,7 +77,6 @@ Foam::StaticHashTable<T, Key, Hash>::StaticHashTable(const label size)
}
// Construct as copy
template
<
class
T
,
class
Key
,
class
Hash
>
Foam
::
StaticHashTable
<
T
,
Key
,
Hash
>::
StaticHashTable
(
...
...
@@ -137,13 +135,12 @@ bool Foam::StaticHashTable<T, Key, Hash>::found(const Key& key) const
}
}
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"StaticHashTable<T, Key, Hash>::found(const Key&) : "
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
InfoInFunction
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
}
#
endif
#
endif
return
false
;
}
...
...
@@ -170,13 +167,12 @@ Foam::StaticHashTable<T, Key, Hash>::find
}
}
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"StaticHashTable<T, Key, Hash>::find(const Key&) : "
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
InfoInFunction
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
}
#
endif
#
endif
return
end
();
}
...
...
@@ -203,19 +199,17 @@ Foam::StaticHashTable<T, Key, Hash>::find
}
}
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"StaticHashTable<T, Key, Hash>::find(const Key&) const : "
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
InfoInFunction
<<
"Entry "
<<
key
<<
" not found in hash table
\n
"
;
}
#
endif
#
endif
return
cend
();
}
// Return the table of contents
template
<
class
T
,
class
Key
,
class
Hash
>
Foam
::
List
<
Key
>
Foam
::
StaticHashTable
<
T
,
Key
,
Hash
>::
toc
()
const
{
...
...
@@ -254,7 +248,7 @@ bool Foam::StaticHashTable<T, Key, Hash>::set
if
(
existing
==
localKeys
.
size
())
{
//
n
ot found, append
//
N
ot found, append
List
<
T
>&
localObjects
=
objects_
[
hashIdx
];
localKeys
.
setSize
(
existing
+
1
);
...
...
@@ -267,21 +261,20 @@ bool Foam::StaticHashTable<T, Key, Hash>::set
}
else
if
(
protect
)
{
//
f
ound - but protected from overwriting
//
F
ound - but protected from overwriting
// this corresponds to the STL 'insert' convention
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"StaticHashTable<T, Key, Hash>::set"
"(const Key& key, T newEntry, true) : "
"Cannot insert "
<<
key
<<
" already in hash table
\n
"
;
InfoInFunction
<<
"Cannot insert "
<<
key
<<
" already in hash table
\n
"
;
}
#
endif
#
endif
return
false
;
}
else
{
//
f
ound - overwrite existing entry
//
F
ound - overwrite existing entry
// this corresponds to the Perl convention
objects_
[
hashIdx
][
existing
]
=
newEntry
;
}
...
...
@@ -307,7 +300,7 @@ bool Foam::StaticHashTable<T, Key, Hash>::erase(const iterator& cit)
localKeys
.
setSize
(
localKeys
.
size
()
-
1
);
localObjects
.
setSize
(
localObjects
.
size
()
-
1
);
//
a
djust iterator after erase
//
A
djust iterator after erase
iterator
&
it
=
const_cast
<
iterator
&>
(
cit
);
it
.
elemIndex_
--
;
...
...
@@ -321,25 +314,24 @@ bool Foam::StaticHashTable<T, Key, Hash>::erase(const iterator& cit)
nElmts_
--
;
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"StaticHashTable<T, Key, Hash>::erase(iterator&) : "
<<
"hashedEntry removed.
\n
"
;
InfoInFunction
<<
"hashedEntry removed.
\n
"
;
}
#
endif
#
endif
return
true
;
}
else
{
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"StaticHashTable<T, Key, Hash>::erase(iterator&) : "
<<
"
c
annot remove hashedEntry from hash table
\n
"
;
Info
InFunction
<<
"
C
annot remove hashedEntry from hash table
\n
"
;
}
#
endif
#
endif
return
false
;
}
...
...
@@ -391,13 +383,12 @@ void Foam::StaticHashTable<T, Key, Hash>::resize(const label sz)
if
(
newSize
==
keys_
.
size
())
{
#
ifdef FULLDEBUG
#
ifdef FULLDEBUG
if
(
debug
)
{
Info
<<
"StaticHashTable<T, Key, Hash>::resize(const label) : "
<<
"new table size == old table size
\n
"
;
InfoInFunction
<<
"New table size == old table size
\n
"
;
}
#
endif
#
endif
return
;
}
...
...
@@ -517,7 +508,7 @@ bool Foam::StaticHashTable<T, Key, Hash>::operator==
const
StaticHashTable
<
T
,
Key
,
Hash
>&
rhs
)
const
{
//
s
izes (number of keys) must match
//
S
izes (number of keys) must match
for
(
const_iterator
iter
=
rhs
.
cbegin
();
iter
!=
rhs
.
cend
();
++
iter
)
{
...
...
src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C
View file @
68e86f97
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
5
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -31,7 +31,7 @@ License
namespace
Foam
{
defineTypeNameAndDebug
(
IFstream
,
0
);
defineTypeNameAndDebug
(
IFstream
,
0
);
}
...
...
@@ -46,8 +46,7 @@ Foam::IFstreamAllocator::IFstreamAllocator(const fileName& pathname)
{
if
(
IFstream
::
debug
)
{
Info
<<
"IFstreamAllocator::IFstreamAllocator(const fileName&) : "
"cannot open null file "
<<
endl
;
InfoInFunction
<<
"Cannot open null file "
<<
endl
;
}
}
...
...
@@ -58,8 +57,7 @@ Foam::IFstreamAllocator::IFstreamAllocator(const fileName& pathname)
{
if
(
IFstream
::
debug
)
{
Info
<<
"IFstreamAllocator::IFstreamAllocator(const fileName&) : "
"decompressing "
<<
pathname
+
".gz"
<<
endl
;
InfoInFunction
<<
"Decompressing "
<<
pathname
+
".gz"
<<
endl
;
}
delete
ifPtr_
;
...
...
@@ -108,11 +106,8 @@ Foam::IFstream::IFstream
{
if
(
debug
)
{
Info
<<
"IFstream::IFstream(const fileName&,"
"streamFormat=ASCII,"
"versionNumber=currentVersion) : "
"could not open file for input"
<<
endl
<<
info
()
<<
endl
;
InfoInFunction
<<
"Could not open file for input"
<<
endl
<<
info
()
<<
endl
;
}
setBad
();
...
...
src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C
View file @
68e86f97
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
5
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -49,8 +49,7 @@ Foam::OFstreamAllocator::OFstreamAllocator
{
if
(
OFstream
::
debug
)
{
Info
<<
"OFstreamAllocator::OFstreamAllocator(const fileName&) : "
"cannot open null file "
<<
endl
;
InfoInFunction
<<
"Cannot open null file "
<<
endl
;
}
}
...
...
src/OpenFOAM/db/Time/findTimes.C
View file @
68e86f97
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
2
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -42,8 +42,7 @@ Foam::instantList Foam::Time::findTimes
{
if
(
debug
)
{
Info
<<
"Time::findTimes(const fileName&): finding times in directory "
<<
directory
<<
endl
;
InfoInFunction
<<
"Finding times in directory "
<<
directory
<<
endl
;
}
// Read directory entries into a list
...
...
src/OpenFOAM/db/dictionary/dictionaryIO.C
View file @
68e86f97
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
5
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -112,7 +112,7 @@ bool Foam::dictionary::read(Istream& is, const bool keepHeader)
if
(
is
.
bad
())
{
Info
<<
"dictionary::read(Istream&, bool) : "
Info
InFunction
<<
"Istream not OK after reading dictionary "
<<
name
()
<<
endl
;
...
...
src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C
View file @
68e86f97
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
5
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -61,8 +61,8 @@ Foam::dlLibraryTable::~dlLibraryTable()
{
if
(
debug
)
{
Info
<<
"dlLibraryTable::~dlLibraryTable() : closing "
<<
libNames_
[
i
]
Info
InFunction
<<
"Closing "
<<
libNames_
[
i
]
<<
" with handle "
<<
uintptr_t
(
libPtrs_
[
i
])
<<
endl
;
}
dlClose
(
libPtrs_
[
i
]);
...
...
@@ -85,7 +85,8 @@ bool Foam::dlLibraryTable::open
if
(
debug
)
{
Info
<<
"dlLibraryTable::open : opened "
<<
functionLibName
InfoInFunction
<<
"Opened "
<<
functionLibName
<<
" resulting in handle "
<<
uintptr_t
(
functionLibPtr
)
<<
endl
;
}
...
...
@@ -134,7 +135,8 @@ bool Foam::dlLibraryTable::close
{
if
(
debug
)
{
Info
<<
"dlLibraryTable::close : closing "
<<
functionLibName
InfoInFunction
<<
"Closing "
<<
functionLibName
<<
" with handle "
<<
uintptr_t
(
libPtrs_
[
index
])
<<
endl
;
}
...
...
src/OpenFOAM/db/regIOobject/regIOobjectRead.C
View file @
68e86f97
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
5
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -28,15 +28,14 @@ License
#include
"Time.H"
#include
"Pstream.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
Istream
&
Foam
::
regIOobject
::
readStream
()
{
if
(
IFstream
::
debug
)
{
Info
<<
"regIOobject::readStream() : "
<<
"
r
eading object "
<<
name
()
Info
InFunction
<<
"
R
eading object "
<<
name
()
<<
" from file "
<<
objectPath
()
<<
endl
;
}
...
...
@@ -112,8 +111,8 @@ Foam::Istream& Foam::regIOobject::readStream(const word& expectName)
{
if
(
IFstream
::
debug
)
{
Info
<<
"regIOobject::readStream(const word&) : "
<<
"
r
eading object "
<<
name
()
Info
InFunction
<<
"
R
eading object "
<<
name
()
<<
" from file "
<<
objectPath
()
<<
endl
;
}
...
...
@@ -149,8 +148,8 @@ void Foam::regIOobject::close()
{
if
(
IFstream
::
debug
)
{
Info
<<
"regIOobject::close() : "
<<
"
f
inished reading "
<<
filePath
()
Info
InFunction
<<
"
F
inished reading "
<<
filePath
()
<<
endl
;
}
...
...
@@ -288,7 +287,8 @@ bool Foam::regIOobject::readIfModified()
if
(
modified
())
{
const
fileName
&
fName
=
time
().
getFile
(
watchIndex_
);
Info
<<
"regIOobject::readIfModified() : "
<<
nl
InfoInFunction
<<
nl
<<
" Re-reading object "
<<
name
()
<<
" from file "
<<
fName
<<
endl
;
return
read
();
...
...
src/OpenFOAM/db/regIOobject/regIOobjectWrite.C
View file @
68e86f97
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
5
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -74,8 +74,7 @@ bool Foam::regIOobject::writeObject
if
(
OFstream
::
debug
)
{
Info
<<
"regIOobject::write() : "
<<
"writing file "
<<
objectPath
();
InfoInFunction
<<
"Writing file "
<<
objectPath
();
}
...
...
src/OpenFOAM/meshes/polyMesh/polyMesh.C
View file @
68e86f97
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
5
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -1051,8 +1051,8 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
{
if
(
debug
)
{