From 18e8d2bead02e1553a754571fb8b46166fa32887 Mon Sep 17 00:00:00 2001 From: laurence Date: Tue, 29 Jan 2013 16:51:53 +0000 Subject: [PATCH] STYLE: cleanup --- .../cellAspectRatioControl.C | 5 ++-- .../cellShapeControlMesh.H | 11 ++++---- .../conformationSurfaces.C | 26 ++++++++++++++++++- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellAspectRatioControl/cellAspectRatioControl.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellAspectRatioControl/cellAspectRatioControl.C index dfba259e67..fe5b913438 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellAspectRatioControl/cellAspectRatioControl.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellAspectRatioControl/cellAspectRatioControl.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,8 @@ Foam::cellAspectRatioControl::cellAspectRatioControl { Info<< nl << " Cell Aspect Ratio Control" << nl << " Ratio : " << aspectRatio_ << nl - << " Direction : " << aspectRatioDirection_ << nl << endl; + << " Direction : " << aspectRatioDirection_ + << endl; } diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H index 3c2ce88db2..db7e226505 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H @@ -141,14 +141,15 @@ public: const Foam::point& pt ); - void distribute - ( - const backgroundMeshDecomposition& decomposition - ); + void distribute(const backgroundMeshDecomposition& decomposition); tensorField dumpAlignments() const; - void insertBoundingPoints(const boundBox& bb); + void insertBoundingPoints + ( + const boundBox& bb, + const cellSizeAndAlignmentControls& sizeControls + ); void writeTriangulation(); diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C index 64f753fb99..d830210f1d 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ License #include "conformationSurfaces.H" #include "conformalVoronoiMesh.H" +#include "triSurface.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -250,6 +251,9 @@ Foam::conformationSurfaces::conformationSurfaces Info<< endl << "Testing for locationInMesh " << locationInMesh_ << endl; + vector sum = vector::zero; + label totalTriangles = 0; + forAll(surfaces_, s) { const searchableSurface& surface(allGeometry_[surfaces_[s]]); @@ -273,7 +277,27 @@ Foam::conformationSurfaces::conformationSurfaces << " surface " << surface.name() << endl; } + + if (isA(surface)) + { + const triSurface& triSurf = refCast(surface); + + const pointField& surfPts = triSurf.points(); + + forAll(triSurf, sI) + { + sum += triSurf[sI].normal(surfPts); + } + + totalTriangles += triSurf.size(); + } } + + Info<< " Sum of all the surface normals (if near zero, surface is" + << " probably closed):" << nl + << " Sum = " << sum/totalTriangles << nl + << " mag(Sum) = " << mag(sum)/totalTriangles + << endl; }