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

This commit is contained in:
laurence
2013-01-11 12:11:30 +00:00
5 changed files with 148 additions and 21 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -538,6 +538,9 @@ Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::faceTetIndices
label cI
)
{
static label nWarnings = 0;
static const label maxWarnings = 100;
const faceList& pFaces = mesh.faces();
const labelList& pOwner = mesh.faceOwner();
@ -553,19 +556,27 @@ Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::faceTetIndices
if (tetBasePtI == -1)
{
WarningIn
(
"Foam::List<Foam::tetIndices> "
"Foam::polyMeshTetDecomposition::faceTetIndices"
"("
"const polyMesh&, "
"label, "
"label"
")"
)
<< "No base point for face " << fI << ", " << f
<< ", produces a valid tet decomposition."
<< endl;
if (nWarnings < maxWarnings)
{
WarningIn
(
"Foam::List<Foam::tetIndices> "
"Foam::polyMeshTetDecomposition::faceTetIndices"
"("
"const polyMesh&, "
"label, "
"label"
")"
) << "No base point for face " << fI << ", " << f
<< ", produces a valid tet decomposition."
<< endl;
nWarnings++;
}
if (nWarnings == maxWarnings)
{
Warning<< "Suppressing any further warnings." << endl;
nWarnings++;
}
tetBasePtI = 0;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,9 +43,11 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const pointData& wDist)
}
}
Foam::Istream& Foam::operator>>(Istream& is, pointData& wDist)
{
return is >> static_cast<pointEdgePoint&>(wDist) >> wDist.s_ >> wDist.v_;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -258,6 +258,106 @@ void Foam::meshRefinement::updateIntersections(const labelList& changedFaces)
}
void Foam::meshRefinement::testSyncPointList
(
const string& msg,
const polyMesh& mesh,
const List<scalar>& fld
)
{
if (fld.size() != mesh.nPoints())
{
FatalErrorIn
(
"meshRefinement::testSyncPointList(const polyMesh&"
", const List<scalar>&)"
) << msg << endl
<< "fld size:" << fld.size() << " mesh points:" << mesh.nPoints()
<< abort(FatalError);
}
Pout<< "Checking field " << msg << endl;
scalarField minFld(fld);
syncTools::syncPointList
(
mesh,
minFld,
minEqOp<scalar>(),
GREAT
);
scalarField maxFld(fld);
syncTools::syncPointList
(
mesh,
maxFld,
maxEqOp<scalar>(),
-GREAT
);
forAll(minFld, pointI)
{
const scalar& minVal = minFld[pointI];
const scalar& maxVal = maxFld[pointI];
if (mag(minVal-maxVal) > SMALL)
{
Pout<< msg << " at:" << mesh.points()[pointI] << nl
<< " minFld:" << minVal << nl
<< " maxFld:" << maxVal << nl
<< endl;
}
}
}
void Foam::meshRefinement::testSyncPointList
(
const string& msg,
const polyMesh& mesh,
const List<point>& fld
)
{
if (fld.size() != mesh.nPoints())
{
FatalErrorIn
(
"meshRefinement::testSyncPointList(const polyMesh&"
", const List<point>&)"
) << msg << endl
<< "fld size:" << fld.size() << " mesh points:" << mesh.nPoints()
<< abort(FatalError);
}
Pout<< "Checking field " << msg << endl;
pointField minFld(fld);
syncTools::syncPointList
(
mesh,
minFld,
minMagSqrEqOp<point>(),
point(GREAT, GREAT, GREAT)
);
pointField maxFld(fld);
syncTools::syncPointList
(
mesh,
maxFld,
maxMagSqrEqOp<point>(),
vector::zero
);
forAll(minFld, pointI)
{
const point& minVal = minFld[pointI];
const point& maxVal = maxFld[pointI];
if (mag(minVal-maxVal) > SMALL)
{
Pout<< msg << " at:" << mesh.points()[pointI] << nl
<< " minFld:" << minVal << nl
<< " maxFld:" << maxVal << nl
<< endl;
}
}
}
void Foam::meshRefinement::checkData()
{
Pout<< "meshRefinement::checkData() : Checking refinement structure."

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -879,6 +879,20 @@ public:
//- Debugging: check that all faces still obey start()>end()
void checkData();
static void testSyncPointList
(
const string& msg,
const polyMesh& mesh,
const List<scalar>& fld
);
static void testSyncPointList
(
const string& msg,
const polyMesh& mesh,
const List<point>& fld
);
//- Compare two lists over all boundary faces
template<class T>
void testSyncBoundaryFaceList

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,8 +25,8 @@ Class
Foam::pointEdgePoint
Description
Holds information regarding nearest wall point. Used in pointEdgeWave.
(so not standard meshWave)
Holds information regarding nearest wall point. Used in PointEdgeWave.
(so not standard FaceCellWave)
To be used in wall distance calculation.
SourceFiles
@ -116,7 +116,7 @@ public:
inline scalar distSqr() const;
// Needed by meshWave
// Needed by PointEdgeWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.