diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index dd8bfc5246..f99aaab857 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -62,7 +62,7 @@ Description #include "fvMeshTools.H" #include "profiling.H" #include "processorMeshes.H" -#include "vtkSetWriter.H" +#include "snappyVoxelMeshDriver.H" using namespace Foam; @@ -325,7 +325,8 @@ autoPtr createRefinementSurfaces maxLevel, gapLevel, scalarField(nRegions, -GREAT), //perpendicularAngle, - patchInfo + patchInfo, + false //dryRun ) ); @@ -537,8 +538,61 @@ void extractSurface } +label checkAlignment(const polyMesh& mesh, const scalar tol, Ostream& os) +{ + // Check all edges aligned with one of the coordinate axes + const faceList& faces = mesh.faces(); + const pointField& points = mesh.points(); + + label nUnaligned = 0; + + forAll(faces, facei) + { + const face& f = faces[facei]; + forAll(f, fp) + { + label fp1 = f.fcIndex(fp); + const linePointRef e(edge(f[fp], f[fp1]).line(points)); + const vector v(e.vec()); + const scalar magV(mag(v)); + if (magV > ROOTVSMALL) + { + for + ( + direction dir = 0; + dir < pTraits::nComponents; + ++dir + ) + { + const scalar s(mag(v[dir])); + if (s > magV*tol && s < magV*(1-tol)) + { + ++nUnaligned; + break; + } + } + } + } + } + + reduce(nUnaligned, sumOp