mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: meshRefinement: utility functions for checking sync
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
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()
|
void Foam::meshRefinement::checkData()
|
||||||
{
|
{
|
||||||
Pout<< "meshRefinement::checkData() : Checking refinement structure."
|
Pout<< "meshRefinement::checkData() : Checking refinement structure."
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -879,6 +879,20 @@ public:
|
|||||||
//- Debugging: check that all faces still obey start()>end()
|
//- Debugging: check that all faces still obey start()>end()
|
||||||
void checkData();
|
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
|
//- Compare two lists over all boundary faces
|
||||||
template<class T>
|
template<class T>
|
||||||
void testSyncBoundaryFaceList
|
void testSyncBoundaryFaceList
|
||||||
|
|||||||
Reference in New Issue
Block a user