mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Edge alignment check for 2D cases
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
#include "cellSet.H"
|
||||
#include "faceSet.H"
|
||||
#include "pointSet.H"
|
||||
#include "EdgeMap.H"
|
||||
|
||||
Foam::label Foam::checkGeometry(const polyMesh& mesh, const bool allGeometry)
|
||||
{
|
||||
@ -21,12 +22,33 @@ Foam::label Foam::checkGeometry(const polyMesh& mesh, const bool allGeometry)
|
||||
// Min length
|
||||
scalar minDistSqr = magSqr(1e-6*(globalBb.max() - globalBb.min()));
|
||||
|
||||
Info<< " Mesh (non-empty) directions "
|
||||
<< (mesh.directions() + Vector<label>::one)/2 << endl;
|
||||
|
||||
// Non-empty directions
|
||||
const Vector<label> validDirs = (mesh.directions() + Vector<label>::one)/2;
|
||||
|
||||
Info<< " Mesh (non-empty) directions " << validDirs << endl;
|
||||
|
||||
scalar nGeomDims = mesh.nGeometricD();
|
||||
|
||||
Info<< " Mesh (non-empty, non-wedge) dimensions "
|
||||
<< mesh.nGeometricD() << endl;
|
||||
|
||||
<< nGeomDims << endl;
|
||||
|
||||
if (nGeomDims < 3)
|
||||
{
|
||||
pointSet nonAlignedPoints(mesh, "nonAlignedEdges", mesh.nPoints()/100);
|
||||
|
||||
if (mesh.checkEdgeAlignment(true, validDirs, &nonAlignedPoints))
|
||||
{
|
||||
noFailedChecks++;
|
||||
|
||||
if (nonAlignedPoints.size() > 0)
|
||||
{
|
||||
Pout<< " <<Writing " << nonAlignedPoints.size()
|
||||
<< " points on non-aligned edges to set "
|
||||
<< nonAlignedPoints.name() << endl;
|
||||
nonAlignedPoints.write();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mesh.checkClosedBoundary(true)) noFailedChecks++;
|
||||
|
||||
@ -209,7 +231,7 @@ Foam::label Foam::checkGeometry(const polyMesh& mesh, const bool allGeometry)
|
||||
cells.write();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return noFailedChecks;
|
||||
}
|
||||
|
||||
@ -36,7 +36,9 @@ Foam::label Foam::checkTopology(const polyMesh& mesh, const bool allTopology)
|
||||
if (mesh.checkUpperTriangular(true, &faces))
|
||||
{
|
||||
noFailedChecks++;
|
||||
|
||||
}
|
||||
if (faces.size() > 0)
|
||||
{
|
||||
Pout<< " <<Writing " << faces.size()
|
||||
<< " unordered faces to set " << faces.name() << endl;
|
||||
faces.write();
|
||||
|
||||
Reference in New Issue
Block a user