Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2011-03-08 15:42:06 +00:00
5 changed files with 70 additions and 39 deletions

View File

@ -1074,18 +1074,33 @@ int Foam::system(const std::string& command)
void* Foam::dlOpen(const fileName& lib)
{
if (POSIX::debug)
{
Info<< "dlOpen(const fileName&)"
<< " : dlopen of " << lib << endl;
}
return ::dlopen(lib.c_str(), RTLD_LAZY|RTLD_GLOBAL);
}
bool Foam::dlClose(void* handle)
{
if (POSIX::debug)
{
Info<< "dlClose(void*)"
<< " : dlclose" << endl;
}
return ::dlclose(handle) == 0;
}
void* Foam::dlSym(void* handle, const std::string& symbol)
{
if (POSIX::debug)
{
Info<< "dlSym(void*, const std::string&)"
<< " : dlsym of " << symbol << endl;
}
// clear any old errors - see manpage dlopen
(void) ::dlerror();
@ -1110,6 +1125,12 @@ bool Foam::dlSymFound(void* handle, const std::string& symbol)
{
if (handle && !symbol.empty())
{
if (POSIX::debug)
{
Info<< "dlSymFound(void*, const std::string&)"
<< " : dlsym of " << symbol << endl;
}
// clear any old errors - see manpage dlopen
(void) ::dlerror();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -97,16 +97,18 @@ struct HashTableCore
{}
};
static const iteratorEnd endIter;
//- iteratorEnd set to beyond the end of any HashTable
inline static iteratorEnd cend()
inline static const iteratorEnd& cend()
{
return iteratorEnd();
return endIter;
}
//- iteratorEnd set to beyond the end of any HashTable
inline static iteratorEnd end()
inline static const iteratorEnd& end()
{
return iteratorEnd();
return endIter;
}
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,6 +37,9 @@ const Foam::label Foam::HashTableCore::maxTableSize
)
);
const Foam::HashTableCore::iteratorEnd Foam::HashTableCore::endIter;
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::label Foam::HashTableCore::canonicalSize(const label size)

View File

@ -25,6 +25,7 @@ License
#include "cloud.H"
#include "Time.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -211,8 +211,6 @@ void Foam::triSurface::checkTriangles(const bool verbose)
boolList valid(size(), true);
bool hasInvalid = false;
const labelListList& fFaces = faceFaces();
forAll(*this, faceI)
{
const labelledTri& f = (*this)[faceI];
@ -236,47 +234,53 @@ void Foam::triSurface::checkTriangles(const bool verbose)
else
{
// duplicate triangle check
const labelList& neighbours = fFaces[faceI];
const labelList& fEdges = faceEdges()[faceI];
// Check if faceNeighbours use same points as this face.
// Note: discards normal information - sides of baffle are merged.
forAll(neighbours, neighbourI)
forAll(fEdges, fp)
{
if (neighbours[neighbourI] <= faceI)
const labelList& eFaces = edgeFaces()[fEdges[fp]];
forAll(eFaces, i)
{
// lower numbered faces already checked
continue;
}
label neighbour = eFaces[i];
const labelledTri& n = (*this)[neighbours[neighbourI]];
if
(
((f[0] == n[0]) || (f[0] == n[1]) || (f[0] == n[2]))
&& ((f[1] == n[0]) || (f[1] == n[1]) || (f[1] == n[2]))
&& ((f[2] == n[0]) || (f[2] == n[1]) || (f[2] == n[2]))
)
{
valid[faceI] = false;
hasInvalid = true;
if (verbose)
if (neighbour > faceI)
{
WarningIn
// lower numbered faces already checked
const labelledTri& n = (*this)[neighbour];
if
(
"triSurface::checkTriangles(bool verbose)"
) << "triangles share the same vertices:\n"
<< " face 1 :" << faceI << endl;
printTriangle(Warning, " ", f, points());
((f[0] == n[0]) || (f[0] == n[1]) || (f[0] == n[2]))
&& ((f[1] == n[0]) || (f[1] == n[1]) || (f[1] == n[2]))
&& ((f[2] == n[0]) || (f[2] == n[1]) || (f[2] == n[2]))
)
{
valid[faceI] = false;
hasInvalid = true;
Warning
<< endl
<< " face 2 :"
<< neighbours[neighbourI] << endl;
printTriangle(Warning, " ", n, points());
if (verbose)
{
WarningIn
(
"triSurface::checkTriangles(bool verbose)"
) << "triangles share the same vertices:\n"
<< " face 1 :" << faceI << endl;
printTriangle(Warning, " ", f, points());
Warning
<< endl
<< " face 2 :"
<< neighbour << endl;
printTriangle(Warning, " ", n, points());
}
break;
}
}
break;
}
}
}