mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
regIOobject, Hasher, IOobject tweak
- regIOobject: don't re-register an unregister object on rename/assignment - Hasher: split-off HasherInt with uint32_t specializations - IOobject: writeBanner/writeDivider return Stream for easier chaining. ... also dropped some namespace bracketing while I was at it.
This commit is contained in:
@ -54,8 +54,7 @@ int main(int argc, char *argv[])
|
|||||||
const word listType(is);
|
const word listType(is);
|
||||||
|
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
IOobject::writeDivider(Info);
|
IOobject::writeDivider(Info) << listType << endl;
|
||||||
Info<< listType << endl;
|
|
||||||
|
|
||||||
if (listType == "stringList")
|
if (listType == "stringList")
|
||||||
{
|
{
|
||||||
|
|||||||
@ -43,8 +43,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
List<Tuple2<string, string> > rawList(IFstream("testRegexps")());
|
List<Tuple2<string, string> > rawList(IFstream("testRegexps")());
|
||||||
Info<< "input list:" << rawList << endl;
|
Info<< "input list:" << rawList << endl;
|
||||||
IOobject::writeDivider(Info);
|
IOobject::writeDivider(Info) << endl;
|
||||||
Info<< endl;
|
|
||||||
|
|
||||||
List<string> groups;
|
List<string> groups;
|
||||||
|
|
||||||
|
|||||||
@ -86,8 +86,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
List<Tuple2<wordRe, string> > rawList(IFstream("testRegexps")());
|
List<Tuple2<wordRe, string> > rawList(IFstream("testRegexps")());
|
||||||
Info<< "input list:" << rawList << endl;
|
Info<< "input list:" << rawList << endl;
|
||||||
IOobject::writeDivider(Info);
|
IOobject::writeDivider(Info) << endl;
|
||||||
Info<< endl;
|
|
||||||
|
|
||||||
forAll(rawList, elemI)
|
forAll(rawList, elemI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,15 +26,10 @@ License
|
|||||||
|
|
||||||
#include "Callback.H"
|
#include "Callback.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CallbackType>
|
template<class CallbackType>
|
||||||
Callback<CallbackType>::Callback(CallbackRegistry<CallbackType>& cbr)
|
Foam::Callback<CallbackType>::Callback(CallbackRegistry<CallbackType>& cbr)
|
||||||
:
|
:
|
||||||
cbr_(cbr)
|
cbr_(cbr)
|
||||||
{
|
{
|
||||||
@ -43,7 +38,7 @@ Callback<CallbackType>::Callback(CallbackRegistry<CallbackType>& cbr)
|
|||||||
|
|
||||||
|
|
||||||
template<class CallbackType>
|
template<class CallbackType>
|
||||||
Callback<CallbackType>::Callback(const Callback<CallbackType>& cb)
|
Foam::Callback<CallbackType>::Callback(const Callback<CallbackType>& cb)
|
||||||
:
|
:
|
||||||
cbr_(cb.cbr_)
|
cbr_(cb.cbr_)
|
||||||
{
|
{
|
||||||
@ -54,7 +49,7 @@ Callback<CallbackType>::Callback(const Callback<CallbackType>& cb)
|
|||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CallbackType>
|
template<class CallbackType>
|
||||||
Callback<CallbackType>::~Callback()
|
Foam::Callback<CallbackType>::~Callback()
|
||||||
{
|
{
|
||||||
checkOut();
|
checkOut();
|
||||||
}
|
}
|
||||||
@ -63,7 +58,7 @@ Callback<CallbackType>::~Callback()
|
|||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CallbackType>
|
template<class CallbackType>
|
||||||
bool Callback<CallbackType>::checkIn()
|
bool Foam::Callback<CallbackType>::checkIn()
|
||||||
{
|
{
|
||||||
if (!Callback<CallbackType>::link::registered())
|
if (!Callback<CallbackType>::link::registered())
|
||||||
{
|
{
|
||||||
@ -78,7 +73,7 @@ bool Callback<CallbackType>::checkIn()
|
|||||||
|
|
||||||
|
|
||||||
template<class CallbackType>
|
template<class CallbackType>
|
||||||
bool Callback<CallbackType>::checkOut()
|
bool Foam::Callback<CallbackType>::checkOut()
|
||||||
{
|
{
|
||||||
if (Callback<CallbackType>::link::registered())
|
if (Callback<CallbackType>::link::registered())
|
||||||
{
|
{
|
||||||
@ -100,8 +95,4 @@ bool Callback<CallbackType>::checkOut()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -30,10 +30,7 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::IOobject, 0);
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(IOobject, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -353,11 +353,11 @@ public:
|
|||||||
//- Write the standard OpenFOAM file/dictionary banner
|
//- Write the standard OpenFOAM file/dictionary banner
|
||||||
// Optionally without -*- C++ -*- editor hint (eg, for logs)
|
// Optionally without -*- C++ -*- editor hint (eg, for logs)
|
||||||
template<class Stream>
|
template<class Stream>
|
||||||
static inline void writeBanner(Stream& os, bool noHint=false);
|
static inline Stream& writeBanner(Stream& os, bool noHint=false);
|
||||||
|
|
||||||
//- Write the standard file section divider
|
//- Write the standard file section divider
|
||||||
template<class Stream>
|
template<class Stream>
|
||||||
static inline void writeDivider(Stream& os);
|
static inline Stream& writeDivider(Stream& os);
|
||||||
|
|
||||||
//- Write header
|
//- Write header
|
||||||
bool writeHeader(Ostream&) const;
|
bool writeHeader(Ostream&) const;
|
||||||
|
|||||||
@ -29,7 +29,7 @@ License
|
|||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Stream>
|
template<class Stream>
|
||||||
inline void Foam::IOobject::writeBanner(Stream& os, bool noHint)
|
inline Stream& Foam::IOobject::writeBanner(Stream& os, bool noHint)
|
||||||
{
|
{
|
||||||
static bool spacesSet(false);
|
static bool spacesSet(false);
|
||||||
static char spaces[40];
|
static char spaces[40];
|
||||||
@ -68,14 +68,18 @@ inline void Foam::IOobject::writeBanner(Stream& os, bool noHint)
|
|||||||
"| \\\\ / A nd | Web: www.OpenFOAM.org |\n"
|
"| \\\\ / A nd | Web: www.OpenFOAM.org |\n"
|
||||||
"| \\\\/ M anipulation | |\n"
|
"| \\\\/ M anipulation | |\n"
|
||||||
"\\*---------------------------------------------------------------------------*/\n";
|
"\\*---------------------------------------------------------------------------*/\n";
|
||||||
|
|
||||||
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Stream>
|
template<class Stream>
|
||||||
inline void Foam::IOobject::writeDivider(Stream& os)
|
inline Stream& Foam::IOobject::writeDivider(Stream& os)
|
||||||
{
|
{
|
||||||
os <<
|
os <<
|
||||||
"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n";
|
"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n";
|
||||||
|
|
||||||
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -43,8 +43,8 @@ bool Foam::IOobject::writeHeader(Ostream& os) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
writeBanner(os);
|
writeBanner(os)
|
||||||
os << "FoamFile\n{\n"
|
<< "FoamFile\n{\n"
|
||||||
<< " version " << os.version() << ";\n"
|
<< " version " << os.version() << ";\n"
|
||||||
<< " format " << os.format() << ";\n"
|
<< " format " << os.format() << ";\n"
|
||||||
<< " class " << type() << ";\n";
|
<< " class " << type() << ";\n";
|
||||||
@ -58,8 +58,7 @@ bool Foam::IOobject::writeHeader(Ostream& os) const
|
|||||||
<< " object " << name() << ";\n"
|
<< " object " << name() << ";\n"
|
||||||
<< "}" << nl;
|
<< "}" << nl;
|
||||||
|
|
||||||
writeDivider(os);
|
writeDivider(os) << endl;
|
||||||
os << endl;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,10 +35,8 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::IOdictionary, 0);
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(IOdictionary, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -30,10 +30,8 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::IFstream, 0);
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(IFstream, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -30,10 +30,7 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::OFstream, 0);
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(OFstream, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -28,17 +28,11 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
#include "error.H"
|
||||||
|
|
||||||
#include "token.H"
|
#include "token.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
bool Foam::checkStream(istream& is, const string& fnName)
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool checkStream(istream& is, const string& fnName)
|
|
||||||
{
|
{
|
||||||
if (!is.good())
|
if (!is.good())
|
||||||
{
|
{
|
||||||
@ -50,7 +44,7 @@ bool checkStream(istream& is, const string& fnName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool checkStream(ostream& os, const string& fnName)
|
bool Foam::checkStream(ostream& os, const string& fnName)
|
||||||
{
|
{
|
||||||
if (!os.good())
|
if (!os.good())
|
||||||
{
|
{
|
||||||
@ -62,8 +56,4 @@ bool checkStream(ostream& os, const string& fnName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -29,19 +29,13 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
#include "error.H"
|
||||||
|
|
||||||
#include "token.H"
|
#include "token.H"
|
||||||
#include "int.H"
|
#include "int.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
// Print state of ostream.
|
// Print state of ostream.
|
||||||
|
|
||||||
void state(ostream& to, const string& s)
|
void Foam::state(ostream& to, const string& s)
|
||||||
{
|
{
|
||||||
state_value osState = state_value(to.rdstate());
|
state_value osState = state_value(to.rdstate());
|
||||||
|
|
||||||
@ -82,7 +76,7 @@ void state(ostream& to, const string& s)
|
|||||||
|
|
||||||
|
|
||||||
// Print state of istream.
|
// Print state of istream.
|
||||||
void state(istream& from, const string& s)
|
void Foam::state(istream& from, const string& s)
|
||||||
{
|
{
|
||||||
state_value isState = state_value(from.rdstate());
|
state_value isState = state_value(from.rdstate());
|
||||||
|
|
||||||
@ -126,8 +120,4 @@ void state(istream& from, const string& s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -26,15 +26,12 @@ License
|
|||||||
|
|
||||||
#include "objectRegistry.H"
|
#include "objectRegistry.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
wordList objectRegistry::names() const
|
Foam::wordList
|
||||||
|
Foam::objectRegistry::names() const
|
||||||
{
|
{
|
||||||
wordList objectNames(size());
|
wordList objectNames(size());
|
||||||
|
|
||||||
@ -54,7 +51,8 @@ wordList objectRegistry::names() const
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
HashTable<const Type*> objectRegistry::lookupClass() const
|
Foam::HashTable<const Type*>
|
||||||
|
Foam::objectRegistry::lookupClass() const
|
||||||
{
|
{
|
||||||
HashTable<const Type*> objectsOfClass(size());
|
HashTable<const Type*> objectsOfClass(size());
|
||||||
|
|
||||||
@ -75,7 +73,7 @@ HashTable<const Type*> objectRegistry::lookupClass() const
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
bool objectRegistry::foundObject(const word& name) const
|
bool Foam::objectRegistry::foundObject(const word& name) const
|
||||||
{
|
{
|
||||||
const_iterator iter = find(name);
|
const_iterator iter = find(name);
|
||||||
|
|
||||||
@ -107,7 +105,7 @@ bool objectRegistry::foundObject(const word& name) const
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
const Type& objectRegistry::lookupObject(const word& name) const
|
const Type& Foam::objectRegistry::lookupObject(const word& name) const
|
||||||
{
|
{
|
||||||
const_iterator iter = find(name);
|
const_iterator iter = find(name);
|
||||||
|
|
||||||
@ -154,8 +152,4 @@ const Type& objectRegistry::lookupObject(const word& name) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -22,9 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
Constructors & destructor for regIOobject.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "regIOobject.H"
|
#include "regIOobject.H"
|
||||||
@ -159,16 +156,16 @@ bool Foam::regIOobject::checkOut()
|
|||||||
// Rename object and re-register with objectRegistry under new name
|
// Rename object and re-register with objectRegistry under new name
|
||||||
void Foam::regIOobject::rename(const word& newName)
|
void Foam::regIOobject::rename(const word& newName)
|
||||||
{
|
{
|
||||||
// TODO: verify that this works properly with unregistered objects
|
|
||||||
// I suspect that it incorrectly registers them
|
|
||||||
|
|
||||||
// Check out of objectRegistry
|
// Check out of objectRegistry
|
||||||
checkOut();
|
checkOut();
|
||||||
|
|
||||||
IOobject::rename(newName);
|
IOobject::rename(newName);
|
||||||
|
|
||||||
// Re-register object with objectRegistry
|
if (registerObject())
|
||||||
checkIn();
|
{
|
||||||
|
// Re-register object with objectRegistry
|
||||||
|
checkIn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -186,8 +183,11 @@ void Foam::regIOobject::operator=(const IOobject& io)
|
|||||||
|
|
||||||
IOobject::operator=(io);
|
IOobject::operator=(io);
|
||||||
|
|
||||||
// Re-register object with objectRegistry
|
if (registerObject())
|
||||||
checkIn();
|
{
|
||||||
|
// Re-register object with objectRegistry
|
||||||
|
checkIn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -34,12 +34,7 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
bool Foam::regIOobject::writeObject
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool regIOobject::writeObject
|
|
||||||
(
|
(
|
||||||
IOstream::streamFormat fmt,
|
IOstream::streamFormat fmt,
|
||||||
IOstream::versionNumber ver,
|
IOstream::versionNumber ver,
|
||||||
@ -131,7 +126,7 @@ bool regIOobject::writeObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool regIOobject::write() const
|
bool Foam::regIOobject::write() const
|
||||||
{
|
{
|
||||||
return writeObject
|
return writeObject
|
||||||
(
|
(
|
||||||
@ -141,9 +136,4 @@ bool regIOobject::write() const
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -285,9 +285,9 @@ Foam::argList::argList
|
|||||||
// Print the banner once only for parallel runs
|
// Print the banner once only for parallel runs
|
||||||
if (Pstream::master() && bannerEnabled)
|
if (Pstream::master() && bannerEnabled)
|
||||||
{
|
{
|
||||||
IOobject::writeBanner(Info, true);
|
IOobject::writeBanner(Info, true)
|
||||||
Info<< "Build : " << Foam::FOAMbuild << nl
|
<< "Build : " << Foam::FOAMbuild << nl
|
||||||
<< "Exec : " << argListString.c_str() << nl
|
<< "Exec : " << argListString.c_str() << nl
|
||||||
<< "Date : " << dateString.c_str() << nl
|
<< "Date : " << dateString.c_str() << nl
|
||||||
<< "Time : " << timeString.c_str() << nl
|
<< "Time : " << timeString.c_str() << nl
|
||||||
<< "Host : " << hostName() << nl
|
<< "Host : " << hostName() << nl
|
||||||
|
|||||||
@ -32,14 +32,9 @@ License
|
|||||||
#include "OStringStream.H"
|
#include "OStringStream.H"
|
||||||
#include "Pstream.H"
|
#include "Pstream.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::commSchedule, 0);
|
||||||
{
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(commSchedule, 0);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|||||||
@ -35,11 +35,8 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Constructor from components
|
// Constructor from components
|
||||||
labelList bandCompression(const labelListList& cellCellAddressing)
|
Foam::labelList Foam::bandCompression(const labelListList& cellCellAddressing)
|
||||||
{
|
{
|
||||||
labelList newOrder(cellCellAddressing.size());
|
labelList newOrder(cellCellAddressing.size());
|
||||||
|
|
||||||
@ -106,8 +103,4 @@ labelList bandCompression(const labelListList& cellCellAddressing)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -29,10 +29,8 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::lduMesh, 0);
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(lduMesh, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineTemplateTypeNameAndDebugWithName(cellIOList, "cellList", 0);
|
defineTemplateTypeNameAndDebugWithName(cellIOList, "cellList", 0);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -31,12 +31,7 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
bool Foam::operator==(const cellShape& a, const cellShape& b)
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool operator==(const cellShape& a, const cellShape& b)
|
|
||||||
{
|
{
|
||||||
// Basic rule: we assume that the sequence of labels in each list
|
// Basic rule: we assume that the sequence of labels in each list
|
||||||
// will be circular in the same order (but not necessarily in the
|
// will be circular in the same order (but not necessarily in the
|
||||||
@ -180,8 +175,4 @@ bool operator==(const cellShape& a, const cellShape& b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -27,17 +27,13 @@ License
|
|||||||
#include "face.H"
|
#include "face.H"
|
||||||
#include "scalarField.H"
|
#include "scalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Calculate area in contact given displacement of vertices relative to
|
// Calculate area in contact given displacement of vertices relative to
|
||||||
// the face plane. Positive displacement is above the face (no contact);
|
// the face plane. Positive displacement is above the face (no contact);
|
||||||
// negative is in contact
|
// negative is in contact
|
||||||
scalar face::areaInContact
|
Foam::scalar Foam::face::areaInContact
|
||||||
(
|
(
|
||||||
const pointField& meshPoints,
|
const pointField& meshPoints,
|
||||||
const scalarField& v
|
const scalarField& v
|
||||||
@ -162,8 +158,4 @@ scalar face::areaInContact
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -24,17 +24,14 @@ License
|
|||||||
|
|
||||||
Description
|
Description
|
||||||
Return location of contact sphere on the face
|
Return location of contact sphere on the face
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "face.H"
|
#include "face.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
Foam::scalar Foam::face::contactSphereDiameter
|
||||||
{
|
|
||||||
|
|
||||||
scalar face::contactSphereDiameter
|
|
||||||
(
|
(
|
||||||
const point& p,
|
const point& p,
|
||||||
const vector& n,
|
const vector& n,
|
||||||
@ -44,15 +41,12 @@ scalar face::contactSphereDiameter
|
|||||||
scalar magN = Foam::mag(n);
|
scalar magN = Foam::mag(n);
|
||||||
|
|
||||||
vector n1 = n/(magN + SMALL);
|
vector n1 = n/(magN + SMALL);
|
||||||
|
|
||||||
vector n2 = normal(meshPoints);
|
vector n2 = normal(meshPoints);
|
||||||
|
|
||||||
n2 /= Foam::mag(n2) + SMALL;
|
n2 /= Foam::mag(n2) + SMALL;
|
||||||
|
|
||||||
return 2*((centre(meshPoints) - p) & n2)/((n1 & n2) - 1.0);
|
return 2*((centre(meshPoints) - p) & n2)/((n1 & n2) - 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -34,9 +34,6 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Return potential intersection with face with a ray starting
|
// Return potential intersection with face with a ray starting
|
||||||
// at p, direction n (does not need to be normalized)
|
// at p, direction n (does not need to be normalized)
|
||||||
// Does face-center decomposition and returns triangle intersection
|
// Does face-center decomposition and returns triangle intersection
|
||||||
@ -46,7 +43,7 @@ namespace Foam
|
|||||||
// face plane and the ray and the distance is the distance between the
|
// face plane and the ray and the distance is the distance between the
|
||||||
// intersection point and the nearest point on the face
|
// intersection point and the nearest point on the face
|
||||||
|
|
||||||
pointHit face::ray
|
Foam::pointHit Foam::face::ray
|
||||||
(
|
(
|
||||||
const point& p,
|
const point& p,
|
||||||
const vector& n,
|
const vector& n,
|
||||||
@ -76,7 +73,7 @@ pointHit face::ray
|
|||||||
nextPoint = meshPoints[f[fcIndex(pI)]];
|
nextPoint = meshPoints[f[fcIndex(pI)]];
|
||||||
|
|
||||||
// Note: for best accuracy, centre point always comes last
|
// Note: for best accuracy, centre point always comes last
|
||||||
//
|
//
|
||||||
pointHit curHit = triPointRef
|
pointHit curHit = triPointRef
|
||||||
(
|
(
|
||||||
meshPoints[f[pI]],
|
meshPoints[f[pI]],
|
||||||
@ -133,7 +130,7 @@ pointHit face::ray
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pointHit face::intersection
|
Foam::pointHit Foam::face::intersection
|
||||||
(
|
(
|
||||||
const point& p,
|
const point& p,
|
||||||
const vector& q,
|
const vector& q,
|
||||||
@ -179,7 +176,7 @@ pointHit face::intersection
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pointHit face::nearestPoint
|
Foam::pointHit Foam::face::nearestPoint
|
||||||
(
|
(
|
||||||
const point& p,
|
const point& p,
|
||||||
const pointField& meshPoints
|
const pointField& meshPoints
|
||||||
@ -200,7 +197,7 @@ pointHit face::nearestPoint
|
|||||||
nextPoint = meshPoints[f[fcIndex(pI)]];
|
nextPoint = meshPoints[f[fcIndex(pI)]];
|
||||||
|
|
||||||
// Note: for best accuracy, centre point always comes last
|
// Note: for best accuracy, centre point always comes last
|
||||||
//
|
//
|
||||||
triPointRef tri
|
triPointRef tri
|
||||||
(
|
(
|
||||||
meshPoints[f[pI]],
|
meshPoints[f[pI]],
|
||||||
@ -232,8 +229,4 @@ pointHit face::nearestPoint
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -30,14 +30,10 @@ Description
|
|||||||
#include "cellShape.H"
|
#include "cellShape.H"
|
||||||
#include "cellModeller.H"
|
#include "cellModeller.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
cellShape tetCell::tetCellShape() const
|
Foam::cellShape Foam::tetCell::tetCellShape() const
|
||||||
{
|
{
|
||||||
static const cellModel* tetModelPtr_ = NULL;
|
static const cellModel* tetModelPtr_ = NULL;
|
||||||
|
|
||||||
@ -52,8 +48,4 @@ cellShape tetCell::tetCellShape() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -29,14 +29,9 @@ License
|
|||||||
#include "facePointPatch.H"
|
#include "facePointPatch.H"
|
||||||
#include "globalPointPatch.H"
|
#include "globalPointPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
pointBoundaryMesh::pointBoundaryMesh
|
Foam::pointBoundaryMesh::pointBoundaryMesh
|
||||||
(
|
(
|
||||||
const pointMesh& m,
|
const pointMesh& m,
|
||||||
const polyBoundaryMesh& basicBdry
|
const polyBoundaryMesh& basicBdry
|
||||||
@ -61,7 +56,7 @@ pointBoundaryMesh::pointBoundaryMesh
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void pointBoundaryMesh::calcGeometry()
|
void Foam::pointBoundaryMesh::calcGeometry()
|
||||||
{
|
{
|
||||||
forAll(*this, patchi)
|
forAll(*this, patchi)
|
||||||
{
|
{
|
||||||
@ -75,7 +70,8 @@ void pointBoundaryMesh::calcGeometry()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const globalPointPatch& pointBoundaryMesh::globalPatch() const
|
const Foam::globalPointPatch&
|
||||||
|
Foam::pointBoundaryMesh::globalPatch() const
|
||||||
{
|
{
|
||||||
const pointPatchList& patches = *this;
|
const pointPatchList& patches = *this;
|
||||||
|
|
||||||
@ -99,7 +95,7 @@ const globalPointPatch& pointBoundaryMesh::globalPatch() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void pointBoundaryMesh::movePoints(const pointField& p)
|
void Foam::pointBoundaryMesh::movePoints(const pointField& p)
|
||||||
{
|
{
|
||||||
pointPatchList& patches = *this;
|
pointPatchList& patches = *this;
|
||||||
|
|
||||||
@ -115,7 +111,7 @@ void pointBoundaryMesh::movePoints(const pointField& p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void pointBoundaryMesh::updateMesh()
|
void Foam::pointBoundaryMesh::updateMesh()
|
||||||
{
|
{
|
||||||
pointPatchList& patches = *this;
|
pointPatchList& patches = *this;
|
||||||
|
|
||||||
@ -131,8 +127,4 @@ void pointBoundaryMesh::updateMesh()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -29,27 +29,20 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineTypeNameAndDebug(coupledPointPatch, 0);
|
defineTypeNameAndDebug(Foam::coupledPointPatch, 0);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
coupledPointPatch::coupledPointPatch(const pointBoundaryMesh& bm)
|
Foam::coupledPointPatch::coupledPointPatch(const pointBoundaryMesh& bm)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
coupledPointPatch::~coupledPointPatch()
|
Foam::coupledPointPatch::~coupledPointPatch()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -28,9 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::pointPatch, 0);
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(pointPatch, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -40,10 +40,7 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::globalMeshData, 0);
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(globalMeshData, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Geometric matching tolerance. Factor of mesh bounding box.
|
// Geometric matching tolerance. Factor of mesh bounding box.
|
||||||
const Foam::scalar Foam::globalMeshData::matchTol_ = 1E-8;
|
const Foam::scalar Foam::globalMeshData::matchTol_ = 1E-8;
|
||||||
|
|||||||
@ -32,10 +32,8 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::polyBoundaryMesh, 0);
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(polyBoundaryMesh, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -39,10 +39,8 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::polyMesh, 0);
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(polyMesh, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Foam::word Foam::polyMesh::defaultRegion = "region0";
|
Foam::word Foam::polyMesh::defaultRegion = "region0";
|
||||||
Foam::word Foam::polyMesh::meshSubDir = "polyMesh";
|
Foam::word Foam::polyMesh::meshSubDir = "polyMesh";
|
||||||
|
|||||||
@ -31,10 +31,7 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::coupledPolyPatch, 0);
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(coupledPolyPatch, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Foam::scalar Foam::coupledPolyPatch::matchTol = 1E-3;
|
Foam::scalar Foam::coupledPolyPatch::matchTol = 1E-3;
|
||||||
|
|
||||||
|
|||||||
@ -30,10 +30,9 @@ License
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
namespace Foam
|
|
||||||
{
|
defineTypeNameAndDebug(Foam::primitiveMesh, 0);
|
||||||
defineTypeNameAndDebug(primitiveMesh, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -26,14 +26,10 @@ License
|
|||||||
|
|
||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void primitiveMesh::calcCellCells() const
|
void Foam::primitiveMesh::calcCellCells() const
|
||||||
{
|
{
|
||||||
// Loop through faceCells and mark up neighbours
|
// Loop through faceCells and mark up neighbours
|
||||||
|
|
||||||
@ -102,7 +98,7 @@ void primitiveMesh::calcCellCells() const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const labelListList& primitiveMesh::cellCells() const
|
const Foam::labelListList& Foam::primitiveMesh::cellCells() const
|
||||||
{
|
{
|
||||||
if (!ccPtr_)
|
if (!ccPtr_)
|
||||||
{
|
{
|
||||||
@ -113,7 +109,7 @@ const labelListList& primitiveMesh::cellCells() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const labelList& primitiveMesh::cellCells
|
const Foam::labelList& Foam::primitiveMesh::cellCells
|
||||||
(
|
(
|
||||||
const label cellI,
|
const label cellI,
|
||||||
DynamicList<label>& storage
|
DynamicList<label>& storage
|
||||||
@ -153,14 +149,10 @@ const labelList& primitiveMesh::cellCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const labelList& primitiveMesh::cellCells(const label cellI) const
|
const Foam::labelList& Foam::primitiveMesh::cellCells(const label cellI) const
|
||||||
{
|
{
|
||||||
return cellCells(cellI, labels_);
|
return cellCells(cellI, labels_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -30,14 +30,9 @@ Description
|
|||||||
|
|
||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void primitiveMesh::calcCellCentresAndVols() const
|
void Foam::primitiveMesh::calcCellCentresAndVols() const
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -75,7 +70,7 @@ void primitiveMesh::calcCellCentresAndVols() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void primitiveMesh::makeCellCentresAndVols
|
void Foam::primitiveMesh::makeCellCentresAndVols
|
||||||
(
|
(
|
||||||
const vectorField& fCtrs,
|
const vectorField& fCtrs,
|
||||||
const vectorField& fAreas,
|
const vectorField& fAreas,
|
||||||
@ -152,7 +147,7 @@ void primitiveMesh::makeCellCentresAndVols
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const vectorField& primitiveMesh::cellCentres() const
|
const Foam::vectorField& Foam::primitiveMesh::cellCentres() const
|
||||||
{
|
{
|
||||||
if (!cellCentresPtr_)
|
if (!cellCentresPtr_)
|
||||||
{
|
{
|
||||||
@ -163,7 +158,7 @@ const vectorField& primitiveMesh::cellCentres() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const scalarField& primitiveMesh::cellVolumes() const
|
const Foam::scalarField& Foam::primitiveMesh::cellVolumes() const
|
||||||
{
|
{
|
||||||
if (!cellVolumesPtr_)
|
if (!cellVolumesPtr_)
|
||||||
{
|
{
|
||||||
@ -174,8 +169,4 @@ const scalarField& primitiveMesh::cellVolumes() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -26,14 +26,9 @@ License
|
|||||||
|
|
||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void primitiveMesh::calcCells
|
void Foam::primitiveMesh::calcCells
|
||||||
(
|
(
|
||||||
cellList& cellFaceAddr,
|
cellList& cellFaceAddr,
|
||||||
const unallocLabelList& own,
|
const unallocLabelList& own,
|
||||||
@ -102,7 +97,7 @@ void primitiveMesh::calcCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void primitiveMesh::calcCells() const
|
void Foam::primitiveMesh::calcCells() const
|
||||||
{
|
{
|
||||||
// Loop through faceCells and mark up neighbours
|
// Loop through faceCells and mark up neighbours
|
||||||
|
|
||||||
@ -139,7 +134,7 @@ void primitiveMesh::calcCells() const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const cellList& primitiveMesh::cells() const
|
const Foam::cellList& Foam::primitiveMesh::cells() const
|
||||||
{
|
{
|
||||||
if (!cfPtr_)
|
if (!cfPtr_)
|
||||||
{
|
{
|
||||||
@ -150,8 +145,4 @@ const cellList& primitiveMesh::cells() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -30,22 +30,18 @@ License
|
|||||||
#include "mathematicalConstants.H"
|
#include "mathematicalConstants.H"
|
||||||
#include "SortableList.H"
|
#include "SortableList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
scalar primitiveMesh::closedThreshold_ = 1.0e-6;
|
Foam::scalar Foam::primitiveMesh::closedThreshold_ = 1.0e-6;
|
||||||
scalar primitiveMesh::aspectThreshold_ = 1000;
|
Foam::scalar Foam::primitiveMesh::aspectThreshold_ = 1000;
|
||||||
scalar primitiveMesh::nonOrthThreshold_ = 70; // deg
|
Foam::scalar Foam::primitiveMesh::nonOrthThreshold_ = 70; // deg
|
||||||
scalar primitiveMesh::skewThreshold_ = 4;
|
Foam::scalar Foam::primitiveMesh::skewThreshold_ = 4;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
bool primitiveMesh::checkClosedBoundary(const bool report) const
|
bool Foam::primitiveMesh::checkClosedBoundary(const bool report) const
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -97,7 +93,7 @@ bool primitiveMesh::checkClosedBoundary(const bool report) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkClosedCells
|
bool Foam::primitiveMesh::checkClosedCells
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
labelHashSet* setPtr,
|
labelHashSet* setPtr,
|
||||||
@ -266,7 +262,7 @@ bool primitiveMesh::checkClosedCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkFaceAreas
|
bool Foam::primitiveMesh::checkFaceAreas
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
labelHashSet* setPtr
|
labelHashSet* setPtr
|
||||||
@ -325,7 +321,7 @@ bool primitiveMesh::checkFaceAreas
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkCellVolumes
|
bool Foam::primitiveMesh::checkCellVolumes
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
labelHashSet* setPtr
|
labelHashSet* setPtr
|
||||||
@ -392,7 +388,7 @@ bool primitiveMesh::checkCellVolumes
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkFaceOrthogonality
|
bool Foam::primitiveMesh::checkFaceOrthogonality
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
labelHashSet* setPtr
|
labelHashSet* setPtr
|
||||||
@ -512,7 +508,7 @@ bool primitiveMesh::checkFaceOrthogonality
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkFacePyramids
|
bool Foam::primitiveMesh::checkFacePyramids
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
const scalar minPyrVol,
|
const scalar minPyrVol,
|
||||||
@ -596,7 +592,7 @@ bool primitiveMesh::checkFacePyramids
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkFaceSkewness
|
bool Foam::primitiveMesh::checkFaceSkewness
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
labelHashSet* setPtr
|
labelHashSet* setPtr
|
||||||
@ -740,7 +736,7 @@ bool primitiveMesh::checkFaceSkewness
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkPoints
|
bool Foam::primitiveMesh::checkPoints
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
labelHashSet* setPtr
|
labelHashSet* setPtr
|
||||||
@ -818,7 +814,7 @@ bool primitiveMesh::checkPoints
|
|||||||
// E.g. maxDeg = 10 allows for angles < 190 (or 10 degrees concavity)
|
// E.g. maxDeg = 10 allows for angles < 190 (or 10 degrees concavity)
|
||||||
// (if truly concave and points not visible from face centre the face-pyramid
|
// (if truly concave and points not visible from face centre the face-pyramid
|
||||||
// check in checkMesh will fail)
|
// check in checkMesh will fail)
|
||||||
bool primitiveMesh::checkFaceAngles
|
bool Foam::primitiveMesh::checkFaceAngles
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
const scalar maxDeg,
|
const scalar maxDeg,
|
||||||
@ -946,7 +942,7 @@ bool primitiveMesh::checkFaceAngles
|
|||||||
// Check warpage of faces. Is calculated as the difference between areas of
|
// Check warpage of faces. Is calculated as the difference between areas of
|
||||||
// individual triangles and the overall area of the face (which ifself is
|
// individual triangles and the overall area of the face (which ifself is
|
||||||
// is the average of the areas of the individual triangles).
|
// is the average of the areas of the individual triangles).
|
||||||
bool primitiveMesh::checkFaceFlatness
|
bool Foam::primitiveMesh::checkFaceFlatness
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
const scalar warnFlatness,
|
const scalar warnFlatness,
|
||||||
@ -1076,7 +1072,7 @@ bool primitiveMesh::checkFaceFlatness
|
|||||||
// - are only in a singe non-empty direction.
|
// - are only in a singe non-empty direction.
|
||||||
// Empty direction info is passed in as a vector of labels (synchronised)
|
// Empty direction info is passed in as a vector of labels (synchronised)
|
||||||
// which are 1 if the direction is non-empty, 0 if it is.
|
// which are 1 if the direction is non-empty, 0 if it is.
|
||||||
bool primitiveMesh::checkEdgeAlignment
|
bool Foam::primitiveMesh::checkEdgeAlignment
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
const Vector<label>& directions,
|
const Vector<label>& directions,
|
||||||
@ -1211,7 +1207,7 @@ bool primitiveMesh::checkEdgeAlignment
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkUpperTriangular
|
bool Foam::primitiveMesh::checkUpperTriangular
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
labelHashSet* setPtr
|
labelHashSet* setPtr
|
||||||
@ -1376,7 +1372,7 @@ bool primitiveMesh::checkUpperTriangular
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkCellsZipUp
|
bool Foam::primitiveMesh::checkCellsZipUp
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
labelHashSet* setPtr
|
labelHashSet* setPtr
|
||||||
@ -1477,7 +1473,7 @@ bool primitiveMesh::checkCellsZipUp
|
|||||||
|
|
||||||
|
|
||||||
// Vertices of face within point range and unique.
|
// Vertices of face within point range and unique.
|
||||||
bool primitiveMesh::checkFaceVertices
|
bool Foam::primitiveMesh::checkFaceVertices
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
labelHashSet* setPtr
|
labelHashSet* setPtr
|
||||||
@ -1553,7 +1549,7 @@ bool primitiveMesh::checkFaceVertices
|
|||||||
|
|
||||||
|
|
||||||
// Check if all points on face are shared between faces.
|
// Check if all points on face are shared between faces.
|
||||||
bool primitiveMesh::checkDuplicateFaces
|
bool Foam::primitiveMesh::checkDuplicateFaces
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label faceI,
|
||||||
const Map<label>& nCommonPoints,
|
const Map<label>& nCommonPoints,
|
||||||
@ -1595,7 +1591,7 @@ bool primitiveMesh::checkDuplicateFaces
|
|||||||
|
|
||||||
|
|
||||||
// Check that shared points are in consecutive order.
|
// Check that shared points are in consecutive order.
|
||||||
bool primitiveMesh::checkCommonOrder
|
bool Foam::primitiveMesh::checkCommonOrder
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label faceI,
|
||||||
const Map<label>& nCommonPoints,
|
const Map<label>& nCommonPoints,
|
||||||
@ -1758,7 +1754,7 @@ bool primitiveMesh::checkCommonOrder
|
|||||||
|
|
||||||
// Checks common vertices between faces. If more than 2 they should be
|
// Checks common vertices between faces. If more than 2 they should be
|
||||||
// consecutive on both faces.
|
// consecutive on both faces.
|
||||||
bool primitiveMesh::checkFaceFaces
|
bool Foam::primitiveMesh::checkFaceFaces
|
||||||
(
|
(
|
||||||
const bool report,
|
const bool report,
|
||||||
labelHashSet* setPtr
|
labelHashSet* setPtr
|
||||||
@ -1868,7 +1864,7 @@ bool primitiveMesh::checkFaceFaces
|
|||||||
|
|
||||||
|
|
||||||
// Checks cells with 1 or less internal faces. Give numerical problems.
|
// Checks cells with 1 or less internal faces. Give numerical problems.
|
||||||
bool primitiveMesh::checkCellDeterminant
|
bool Foam::primitiveMesh::checkCellDeterminant
|
||||||
(
|
(
|
||||||
const bool report, // report,
|
const bool report, // report,
|
||||||
labelHashSet* setPtr // setPtr
|
labelHashSet* setPtr // setPtr
|
||||||
@ -1990,7 +1986,7 @@ bool primitiveMesh::checkCellDeterminant
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool primitiveMesh::checkTopology(const bool report) const
|
bool Foam::primitiveMesh::checkTopology(const bool report) const
|
||||||
{
|
{
|
||||||
label noFailedChecks = 0;
|
label noFailedChecks = 0;
|
||||||
|
|
||||||
@ -2023,7 +2019,7 @@ bool primitiveMesh::checkTopology(const bool report) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkGeometry(const bool report) const
|
bool Foam::primitiveMesh::checkGeometry(const bool report) const
|
||||||
{
|
{
|
||||||
label noFailedChecks = 0;
|
label noFailedChecks = 0;
|
||||||
|
|
||||||
@ -2056,7 +2052,7 @@ bool primitiveMesh::checkGeometry(const bool report) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool primitiveMesh::checkMesh(const bool report) const
|
bool Foam::primitiveMesh::checkMesh(const bool report) const
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -2088,44 +2084,40 @@ bool primitiveMesh::checkMesh(const bool report) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
scalar primitiveMesh::setClosedThreshold(const scalar ct)
|
Foam::scalar Foam::primitiveMesh::setClosedThreshold(const scalar val)
|
||||||
{
|
{
|
||||||
scalar oldClosedThreshold = closedThreshold_;
|
scalar prev = closedThreshold_;
|
||||||
closedThreshold_ = ct;
|
closedThreshold_ = val;
|
||||||
|
|
||||||
return oldClosedThreshold;
|
return prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
scalar primitiveMesh::setAspectThreshold(const scalar at)
|
Foam::scalar Foam::primitiveMesh::setAspectThreshold(const scalar val)
|
||||||
{
|
{
|
||||||
scalar oldAspectThreshold = aspectThreshold_;
|
scalar prev = aspectThreshold_;
|
||||||
aspectThreshold_ = at;
|
aspectThreshold_ = val;
|
||||||
|
|
||||||
return oldAspectThreshold;
|
return prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
scalar primitiveMesh::setNonOrthThreshold(const scalar nt)
|
Foam::scalar Foam::primitiveMesh::setNonOrthThreshold(const scalar val)
|
||||||
{
|
{
|
||||||
scalar oldNonOrthThreshold = nonOrthThreshold_;
|
scalar prev = nonOrthThreshold_;
|
||||||
nonOrthThreshold_ = nt;
|
nonOrthThreshold_ = val;
|
||||||
|
|
||||||
return oldNonOrthThreshold;
|
return prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
scalar primitiveMesh::setSkewThreshold(const scalar st)
|
Foam::scalar Foam::primitiveMesh::setSkewThreshold(const scalar val)
|
||||||
{
|
{
|
||||||
scalar oldSkewThreshold = skewThreshold_;
|
scalar prev = skewThreshold_;
|
||||||
skewThreshold_ = st;
|
skewThreshold_ = val;
|
||||||
|
|
||||||
return oldSkewThreshold;
|
return prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -27,14 +27,10 @@ License
|
|||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
#include "demandDrivenData.H"
|
#include "demandDrivenData.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void primitiveMesh::printAllocated() const
|
void Foam::primitiveMesh::printAllocated() const
|
||||||
{
|
{
|
||||||
Pout<< "primitiveMesh allocated :" << endl;
|
Pout<< "primitiveMesh allocated :" << endl;
|
||||||
|
|
||||||
@ -98,7 +94,7 @@ void primitiveMesh::printAllocated() const
|
|||||||
{
|
{
|
||||||
Pout<< " Point-point" << endl;
|
Pout<< " Point-point" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cpPtr_)
|
if (cpPtr_)
|
||||||
{
|
{
|
||||||
Pout<< " Cell-point" << endl;
|
Pout<< " Cell-point" << endl;
|
||||||
@ -128,7 +124,7 @@ void primitiveMesh::printAllocated() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void primitiveMesh::clearGeom()
|
void Foam::primitiveMesh::clearGeom()
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -144,7 +140,7 @@ void primitiveMesh::clearGeom()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void primitiveMesh::clearAddressing()
|
void Foam::primitiveMesh::clearAddressing()
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -173,15 +169,11 @@ void primitiveMesh::clearAddressing()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void primitiveMesh::clearOut()
|
void Foam::primitiveMesh::clearOut()
|
||||||
{
|
{
|
||||||
clearGeom();
|
clearGeom();
|
||||||
clearAddressing();
|
clearAddressing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -27,14 +27,10 @@ License
|
|||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const labelListList& primitiveMesh::edgeCells() const
|
const Foam::labelListList& Foam::primitiveMesh::edgeCells() const
|
||||||
{
|
{
|
||||||
if (!ecPtr_)
|
if (!ecPtr_)
|
||||||
{
|
{
|
||||||
@ -59,7 +55,7 @@ const labelListList& primitiveMesh::edgeCells() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const labelList& primitiveMesh::edgeCells
|
const Foam::labelList& Foam::primitiveMesh::edgeCells
|
||||||
(
|
(
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
DynamicList<label>& storage
|
DynamicList<label>& storage
|
||||||
@ -129,14 +125,10 @@ const labelList& primitiveMesh::edgeCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const labelList& primitiveMesh::edgeCells(const label edgeI) const
|
const Foam::labelList& Foam::primitiveMesh::edgeCells(const label edgeI) const
|
||||||
{
|
{
|
||||||
return edgeCells(edgeI, labels_);
|
return edgeCells(edgeI, labels_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -27,14 +27,9 @@ License
|
|||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const labelListList& primitiveMesh::edgeFaces() const
|
const Foam::labelListList& Foam::primitiveMesh::edgeFaces() const
|
||||||
{
|
{
|
||||||
if (!efPtr_)
|
if (!efPtr_)
|
||||||
{
|
{
|
||||||
@ -60,7 +55,7 @@ const labelListList& primitiveMesh::edgeFaces() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const labelList& primitiveMesh::edgeFaces
|
const Foam::labelList& Foam::primitiveMesh::edgeFaces
|
||||||
(
|
(
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
DynamicList<label>& storage
|
DynamicList<label>& storage
|
||||||
@ -106,14 +101,10 @@ const labelList& primitiveMesh::edgeFaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const labelList& primitiveMesh::edgeFaces(const label edgeI) const
|
const Foam::labelList& Foam::primitiveMesh::edgeFaces(const label edgeI) const
|
||||||
{
|
{
|
||||||
return edgeFaces(edgeI, labels_);
|
return edgeFaces(edgeI, labels_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -33,14 +33,10 @@ Description
|
|||||||
|
|
||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void primitiveMesh::calcFaceCentresAndAreas() const
|
void Foam::primitiveMesh::calcFaceCentresAndAreas() const
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -75,7 +71,7 @@ void primitiveMesh::calcFaceCentresAndAreas() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void primitiveMesh::makeFaceCentresAndAreas
|
void Foam::primitiveMesh::makeFaceCentresAndAreas
|
||||||
(
|
(
|
||||||
const pointField& p,
|
const pointField& p,
|
||||||
vectorField& fCtrs,
|
vectorField& fCtrs,
|
||||||
@ -132,7 +128,7 @@ void primitiveMesh::makeFaceCentresAndAreas
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const vectorField& primitiveMesh::faceCentres() const
|
const Foam::vectorField& Foam::primitiveMesh::faceCentres() const
|
||||||
{
|
{
|
||||||
if (!faceCentresPtr_)
|
if (!faceCentresPtr_)
|
||||||
{
|
{
|
||||||
@ -143,7 +139,7 @@ const vectorField& primitiveMesh::faceCentres() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const vectorField& primitiveMesh::faceAreas() const
|
const Foam::vectorField& Foam::primitiveMesh::faceAreas() const
|
||||||
{
|
{
|
||||||
if (!faceAreasPtr_)
|
if (!faceAreasPtr_)
|
||||||
{
|
{
|
||||||
@ -154,8 +150,4 @@ const vectorField& primitiveMesh::faceAreas() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -27,15 +27,11 @@ License
|
|||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
#include "cell.H"
|
#include "cell.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Is the point in the cell bounding box
|
// Is the point in the cell bounding box
|
||||||
bool primitiveMesh::pointInCellBB(const point& p, label celli) const
|
bool Foam::primitiveMesh::pointInCellBB(const point& p, label celli) const
|
||||||
{
|
{
|
||||||
const pointField& points = this->points();
|
const pointField& points = this->points();
|
||||||
const faceList& f = faces();
|
const faceList& f = faces();
|
||||||
@ -67,7 +63,7 @@ bool primitiveMesh::pointInCellBB(const point& p, label celli) const
|
|||||||
|
|
||||||
|
|
||||||
// Is the point in the cell
|
// Is the point in the cell
|
||||||
bool primitiveMesh::pointInCell(const point& p, label celli) const
|
bool Foam::primitiveMesh::pointInCell(const point& p, label celli) const
|
||||||
{
|
{
|
||||||
const labelList& f = cells()[celli];
|
const labelList& f = cells()[celli];
|
||||||
const labelList& owner = this->faceOwner();
|
const labelList& owner = this->faceOwner();
|
||||||
@ -93,7 +89,7 @@ bool primitiveMesh::pointInCell(const point& p, label celli) const
|
|||||||
|
|
||||||
|
|
||||||
// Find the cell with the nearest cell centre
|
// Find the cell with the nearest cell centre
|
||||||
label primitiveMesh::findNearestCell(const point& location) const
|
Foam::label Foam::primitiveMesh::findNearestCell(const point& location) const
|
||||||
{
|
{
|
||||||
const vectorField& centres = cellCentres();
|
const vectorField& centres = cellCentres();
|
||||||
|
|
||||||
@ -116,7 +112,7 @@ label primitiveMesh::findNearestCell(const point& location) const
|
|||||||
|
|
||||||
|
|
||||||
// Find cell enclosing this location
|
// Find cell enclosing this location
|
||||||
label primitiveMesh::findCell(const point& location) const
|
Foam::label Foam::primitiveMesh::findCell(const point& location) const
|
||||||
{
|
{
|
||||||
if (nCells() == 0)
|
if (nCells() == 0)
|
||||||
{
|
{
|
||||||
@ -160,8 +156,4 @@ label primitiveMesh::findCell(const point& location) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -27,14 +27,10 @@ License
|
|||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const labelListList& primitiveMesh::pointFaces() const
|
const Foam::labelListList& Foam::primitiveMesh::pointFaces() const
|
||||||
{
|
{
|
||||||
if (!pfPtr_)
|
if (!pfPtr_)
|
||||||
{
|
{
|
||||||
@ -52,8 +48,4 @@ const labelListList& primitiveMesh::pointFaces() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -28,22 +28,17 @@ Description
|
|||||||
|
|
||||||
#include "patchZones.H"
|
#include "patchZones.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::patchZones, 0);
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(patchZones, 0);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Gets labels of changed faces and propagates them to the edges. Returns
|
// Gets labels of changed faces and propagates them to the edges. Returns
|
||||||
// labels of edges changed.
|
// labels of edges changed.
|
||||||
labelList patchZones::faceToEdge
|
Foam::labelList Foam::patchZones::faceToEdge
|
||||||
(
|
(
|
||||||
const labelList& changedFaces,
|
const labelList& changedFaces,
|
||||||
labelList& edgeRegion
|
labelList& edgeRegion
|
||||||
@ -78,7 +73,7 @@ labelList patchZones::faceToEdge
|
|||||||
|
|
||||||
|
|
||||||
// Reverse of faceToEdge: gets edges and returns faces
|
// Reverse of faceToEdge: gets edges and returns faces
|
||||||
labelList patchZones::edgeToFace(const labelList& changedEdges)
|
Foam::labelList Foam::patchZones::edgeToFace(const labelList& changedEdges)
|
||||||
{
|
{
|
||||||
labelList changedFaces(pp_.size(), -1);
|
labelList changedFaces(pp_.size(), -1);
|
||||||
label changedI = 0;
|
label changedI = 0;
|
||||||
@ -109,7 +104,7 @@ labelList patchZones::edgeToFace(const labelList& changedEdges)
|
|||||||
|
|
||||||
|
|
||||||
// Finds area, starting at faceI, delimited by borderEdge
|
// Finds area, starting at faceI, delimited by borderEdge
|
||||||
void patchZones::markZone(label faceI)
|
void Foam::patchZones::markZone(label faceI)
|
||||||
{
|
{
|
||||||
// List of faces whose faceZone has been set.
|
// List of faces whose faceZone has been set.
|
||||||
labelList changedFaces(1, faceI);
|
labelList changedFaces(1, faceI);
|
||||||
@ -155,7 +150,11 @@ void patchZones::markZone(label faceI)
|
|||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
// Construct from components
|
||||||
Foam::patchZones::patchZones(const primitivePatch& pp, const boolList& borderEdge)
|
Foam::patchZones::patchZones
|
||||||
|
(
|
||||||
|
const primitivePatch& pp,
|
||||||
|
const boolList& borderEdge
|
||||||
|
)
|
||||||
:
|
:
|
||||||
labelList(pp.size(), -1),
|
labelList(pp.size(), -1),
|
||||||
pp_(pp),
|
pp_(pp),
|
||||||
@ -178,7 +177,7 @@ Foam::patchZones::patchZones(const primitivePatch& pp, const boolList& borderEdg
|
|||||||
|
|
||||||
label faceI = 0;
|
label faceI = 0;
|
||||||
|
|
||||||
while(true)
|
while (true)
|
||||||
{
|
{
|
||||||
// Find first non-visited face
|
// Find first non-visited face
|
||||||
for (; faceI < pp_.size(); faceI++)
|
for (; faceI < pp_.size(); faceI++)
|
||||||
@ -204,8 +203,4 @@ Foam::patchZones::patchZones(const primitivePatch& pp, const boolList& borderEdg
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -31,10 +31,6 @@ Description
|
|||||||
#include "triPointRef.H"
|
#include "triPointRef.H"
|
||||||
#include "scalarField.H"
|
#include "scalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -45,7 +41,7 @@ namespace Foam
|
|||||||
// - triangle circumcentre
|
// - triangle circumcentre
|
||||||
// - edge mids
|
// - edge mids
|
||||||
template<class Point, class PointRef>
|
template<class Point, class PointRef>
|
||||||
pointHit tetrahedron<Point, PointRef>::containmentSphere
|
Foam::pointHit Foam::tetrahedron<Point, PointRef>::containmentSphere
|
||||||
(
|
(
|
||||||
const scalar tol
|
const scalar tol
|
||||||
) const
|
) const
|
||||||
@ -250,14 +246,17 @@ pointHit tetrahedron<Point, PointRef>::containmentSphere
|
|||||||
|
|
||||||
|
|
||||||
template<class Point, class PointRef>
|
template<class Point, class PointRef>
|
||||||
void tetrahedron<Point, PointRef>::gradNiSquared(scalarField& buffer) const
|
void Foam::tetrahedron<Point, PointRef>::gradNiSquared
|
||||||
|
(
|
||||||
|
scalarField& buffer
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
// Change of sign between face area vector and gradient
|
// Change of sign between face area vector and gradient
|
||||||
// does not matter because of square
|
// does not matter because of square
|
||||||
|
|
||||||
// Warning: Added a mag to produce positive coefficients even if
|
// Warning: Added a mag to produce positive coefficients even if
|
||||||
// the tetrahedron is twisted inside out. This is pretty
|
// the tetrahedron is twisted inside out. This is pretty
|
||||||
// dangerous, but essential for mesh motion.
|
// dangerous, but essential for mesh motion.
|
||||||
scalar magVol = Foam::mag(mag());
|
scalar magVol = Foam::mag(mag());
|
||||||
|
|
||||||
buffer[0] = (1.0/9.0)*magSqr(Sa())/magVol;
|
buffer[0] = (1.0/9.0)*magSqr(Sa())/magVol;
|
||||||
@ -268,15 +267,17 @@ void tetrahedron<Point, PointRef>::gradNiSquared(scalarField& buffer) const
|
|||||||
|
|
||||||
|
|
||||||
template<class Point, class PointRef>
|
template<class Point, class PointRef>
|
||||||
void tetrahedron<Point, PointRef>::gradNiDotGradNj(scalarField& buffer) const
|
void Foam::tetrahedron<Point, PointRef>::gradNiDotGradNj
|
||||||
|
(
|
||||||
|
scalarField& buffer
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
// Warning. Ordering of edges needs to be the same for a tetrahedron
|
// Warning. Ordering of edges needs to be the same for a tetrahedron
|
||||||
// class, a tetrahedron cell shape model and a tetCell
|
// class, a tetrahedron cell shape model and a tetCell
|
||||||
//
|
|
||||||
|
|
||||||
// Warning: Added a mag to produce positive coefficients even if
|
// Warning: Added a mag to produce positive coefficients even if
|
||||||
// the tetrahedron is twisted inside out. This is pretty
|
// the tetrahedron is twisted inside out. This is pretty
|
||||||
// dangerous, but essential for mesh motion.
|
// dangerous, but essential for mesh motion.
|
||||||
|
|
||||||
// Double change of sign between face area vector and gradient
|
// Double change of sign between face area vector and gradient
|
||||||
|
|
||||||
@ -296,7 +297,10 @@ void tetrahedron<Point, PointRef>::gradNiDotGradNj(scalarField& buffer) const
|
|||||||
|
|
||||||
|
|
||||||
template<class Point, class PointRef>
|
template<class Point, class PointRef>
|
||||||
void tetrahedron<Point, PointRef>::gradNiGradNi(tensorField& buffer) const
|
void Foam::tetrahedron<Point, PointRef>::gradNiGradNi
|
||||||
|
(
|
||||||
|
tensorField& buffer
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
// Change of sign between face area vector and gradient
|
// Change of sign between face area vector and gradient
|
||||||
// does not matter because of square
|
// does not matter because of square
|
||||||
@ -311,11 +315,13 @@ void tetrahedron<Point, PointRef>::gradNiGradNi(tensorField& buffer) const
|
|||||||
|
|
||||||
|
|
||||||
template<class Point, class PointRef>
|
template<class Point, class PointRef>
|
||||||
void tetrahedron<Point, PointRef>::gradNiGradNj(tensorField& buffer) const
|
void Foam::tetrahedron<Point, PointRef>::gradNiGradNj
|
||||||
|
(
|
||||||
|
tensorField& buffer
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
// Warning. Ordering of edges needs to be the same for a tetrahedron
|
// Warning. Ordering of edges needs to be the same for a tetrahedron
|
||||||
// class, a tetrahedron cell shape model and a tetCell
|
// class, a tetrahedron cell shape model and a tetCell
|
||||||
//
|
|
||||||
|
|
||||||
// Double change of sign between face area vector and gradient
|
// Double change of sign between face area vector and gradient
|
||||||
|
|
||||||
@ -333,8 +339,5 @@ void tetrahedron<Point, PointRef>::gradNiGradNj(tensorField& buffer) const
|
|||||||
buffer[5] = (1.0/9.0)*(sd * sc)/magVol;
|
buffer[5] = (1.0/9.0)*(sd * sc)/magVol;
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -27,6 +27,7 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "Hasher.H"
|
#include "Hasher.H"
|
||||||
|
#include "HasherInt.H"
|
||||||
|
|
||||||
#if defined (__GLIBC__)
|
#if defined (__GLIBC__)
|
||||||
# include <endian.h>
|
# include <endian.h>
|
||||||
@ -469,7 +470,7 @@ static unsigned jenkins_hashbig
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Functions * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
unsigned Foam::Hasher
|
unsigned Foam::Hasher
|
||||||
@ -513,7 +514,7 @@ unsigned Foam::Hasher
|
|||||||
// bytes. hashlittle() is more complicated than hashword() only because
|
// bytes. hashlittle() is more complicated than hashword() only because
|
||||||
// hashlittle() has to dance around fitting the key bytes into registers.
|
// hashlittle() has to dance around fitting the key bytes into registers.
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
unsigned Foam::HasherSingle
|
unsigned Foam::HasherInt
|
||||||
(
|
(
|
||||||
const uint32_t *k,
|
const uint32_t *k,
|
||||||
size_t length,
|
size_t length,
|
||||||
|
|||||||
@ -22,8 +22,8 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Namespace
|
InNamespace
|
||||||
Foam::Hashing
|
Foam
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Misc. hashing functions, mostly from Bob Jenkins.
|
Misc. hashing functions, mostly from Bob Jenkins.
|
||||||
@ -35,6 +35,7 @@ Description
|
|||||||
|
|
||||||
SeeAlso
|
SeeAlso
|
||||||
http://burtleburtle.net/bob/c/lookup3.c
|
http://burtleburtle.net/bob/c/lookup3.c
|
||||||
|
and HasherInt.H for a specialized version
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
Hasher.C
|
Hasher.C
|
||||||
@ -44,9 +45,7 @@ SourceFiles
|
|||||||
#ifndef Hasher_H
|
#ifndef Hasher_H
|
||||||
#define Hasher_H
|
#define Hasher_H
|
||||||
|
|
||||||
#include <climits>
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <stdint.h> // C++0x uses <cstdint>
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -61,27 +60,6 @@ namespace Foam
|
|||||||
// @param[in] seed - the previous hash, or an arbitrary value
|
// @param[in] seed - the previous hash, or an arbitrary value
|
||||||
unsigned Hasher(const void* data, size_t len, unsigned seed = 0);
|
unsigned Hasher(const void* data, size_t len, unsigned seed = 0);
|
||||||
|
|
||||||
//- An optimized version of Hasher
|
|
||||||
// @param[in] data - an array of uint32_t values
|
|
||||||
// @param[in] len - the number of values (not bytes)
|
|
||||||
// @param[in] seed - the previous hash, or an arbitrary value
|
|
||||||
unsigned HasherSingle(const uint32_t*, size_t length, unsigned seed = 0);
|
|
||||||
|
|
||||||
//- An optimized version of Hasher, returning dual hash values
|
|
||||||
// @param[in] data - an array of uint32_t values
|
|
||||||
// @param[in] len - the number of values (not bytes)
|
|
||||||
// @param[in] hash1 - the previous hash, or an arbitrary value
|
|
||||||
// on output, the primary hash value
|
|
||||||
// @param[in] hash1 - the previous hash, or an arbitrary value
|
|
||||||
// on output, the secondary hash value
|
|
||||||
unsigned HasherDual
|
|
||||||
(
|
|
||||||
const uint32_t*,
|
|
||||||
size_t len,
|
|
||||||
unsigned& hash1,
|
|
||||||
unsigned& hash2
|
|
||||||
);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
80
src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H
Normal file
80
src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 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
|
||||||
|
|
||||||
|
InNamespace
|
||||||
|
Foam
|
||||||
|
|
||||||
|
Description
|
||||||
|
Optimized hashing functions.
|
||||||
|
|
||||||
|
SeeAlso
|
||||||
|
Hasher.H
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef HasherInt_H
|
||||||
|
#define HasherInt_H
|
||||||
|
|
||||||
|
#include "Hasher.H"
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
#include <stdint.h> // C++0x uses <cstdint>
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//- An optimized version of Hasher
|
||||||
|
// @param[in] data - an array of uint32_t values
|
||||||
|
// @param[in] len - the number of values (not bytes)
|
||||||
|
// @param[in] seed - the previous hash, or an arbitrary value
|
||||||
|
unsigned HasherInt(const uint32_t*, size_t length, unsigned seed = 0);
|
||||||
|
|
||||||
|
//- An optimized version of Hasher, returning dual hash values
|
||||||
|
// @param[in] data - an array of uint32_t values
|
||||||
|
// @param[in] len - the number of values (not bytes)
|
||||||
|
// @param[in] hash1 - the previous hash, or an arbitrary value
|
||||||
|
// on output, the primary hash value
|
||||||
|
// @param[in] hash1 - the previous hash, or an arbitrary value
|
||||||
|
// on output, the secondary hash value
|
||||||
|
unsigned HasherDual
|
||||||
|
(
|
||||||
|
const uint32_t*,
|
||||||
|
size_t len,
|
||||||
|
unsigned& hash1,
|
||||||
|
unsigned& hash2
|
||||||
|
);
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user