From fd8eebab13b3881f2ba20e9c58c8c0ae9dbc8b77 Mon Sep 17 00:00:00 2001 From: laurence Date: Tue, 11 Dec 2012 17:22:06 +0000 Subject: [PATCH] ENH: Latest version of cvMesh. Squash of commits. --- .../utilities/mesh/generation/cvMesh/Allwmake | 3 +- .../mesh/generation/cvMesh/Make/options | 9 +- .../cellSizeAndAlignmentGrid/Make/files | 2 + .../cellSizeAndAlignmentGrid/Make/options | 40 + .../cellSizeAndAlignmentGrid.C | 711 +++++ .../cvMesh/checkCvMesh/meshQualityDict | 73 + .../DelaunayMesh/DelaunayMesh.C | 233 ++ .../DelaunayMesh/DelaunayMesh.H | 238 ++ .../DelaunayMesh/DelaunayMeshI.H | 119 + .../DelaunayMesh/DelaunayMeshIO.C | 406 +++ .../DelaunayMesh/DistributedDelaunayMesh.C | 932 ++++++ .../DelaunayMesh/DistributedDelaunayMesh.H | 207 ++ .../cvMesh/conformalVoronoiMesh/Make/files | 18 +- .../cvMesh/conformalVoronoiMesh/Make/options | 7 +- .../PrintTable/PrintTable.C | 241 ++ .../PrintTable/PrintTable.H | 137 + .../PrintTable/PrintTableI.H | 42 + .../backgroundMeshDecomposition.C | 747 ++--- .../backgroundMeshDecomposition.H | 70 +- .../backgroundMeshDecompositionI.H | 7 +- .../cellAspectRatioControl.C | 110 + .../cellAspectRatioControl.H | 115 + .../cellShapeControl/cellShapeControl.C | 920 ++++++ .../cellShapeControl/cellShapeControl.H | 212 ++ .../cellShapeControl/cellShapeControlI.H | 55 + .../cellShapeControlMesh.C | 760 +++++ .../cellShapeControlMesh.H | 168 + .../cellShapeControlMeshI.H | 68 + .../cellSizeAndAlignmentControl.C | 121 + .../cellSizeAndAlignmentControl.H | 166 + .../cellSizeAndAlignmentControls.C | 78 + .../cellSizeAndAlignmentControls.H | 110 + .../fileControl/fileControl.C | 236 ++ .../fileControl/fileControl.H | 134 + .../searchableSurfaceControl.C | 640 ++++ .../searchableSurfaceControl.H | 166 + .../cellSizeControlSurfaces.C | 452 ++- .../cellSizeControlSurfaces.H | 110 + .../cellSizeFunction/cellSizeFunction.C | 7 +- .../cellSizeFunction/cellSizeFunction.H | 14 +- .../automatic/automatic.C | 85 +- .../automatic/automatic.H | 5 + .../CGALTriangulation3DKernel.H | 62 + .../CGALTriangulation3Ddefs.H | 77 +- .../conformalVoronoiMesh.C | 1269 ++++---- .../conformalVoronoiMesh.H | 626 ++-- .../conformalVoronoiMeshCalcDualMesh.C | 2738 +++++++---------- .../conformalVoronoiMeshConformToSurface.C | 2293 +++++--------- ...alVoronoiMeshFeaturePointSpecialisations.C | 116 +- .../conformalVoronoiMeshFeaturePoints.C | 999 +++--- .../conformalVoronoiMeshI.H | 275 +- .../conformalVoronoiMeshIO.C | 840 ++++- .../{ => indexedCell}/indexedCell.C | 48 +- .../{ => indexedCell}/indexedCell.H | 48 +- .../indexedCell/indexedCellChecks.C | 128 + .../indexedCell/indexedCellChecks.H | 77 + .../indexedCell/indexedCellEnum.C | 46 + .../indexedCell/indexedCellEnum.H | 80 + .../{ => indexedCell}/indexedCellI.H | 316 +- .../conformalVoronoiMesh/indexedVertex.C | 115 - .../indexedVertex/indexedVertex.C | 185 ++ .../{ => indexedVertex}/indexedVertex.H | 222 +- .../indexedVertex/indexedVertexEnum.C | 88 + .../indexedVertex/indexedVertexEnum.H | 95 + .../{ => indexedVertex}/indexedVertexI.H | 257 +- .../conformalVoronoiMesh/pointConversion.H | 99 + .../pointFeatureEdgesTypes.H | 48 +- .../conformationSurfaces.C | 8 +- .../conformationSurfaces.H | 3 - .../cvControls/cvControls.C | 362 +-- .../cvControls/cvControls.H | 216 +- .../cvControls/cvControlsI.H | 102 +- .../autoDensity/autoDensity.C | 8 +- .../bodyCentredCubic/bodyCentredCubic.C | 2 +- .../faceCentredCubic/faceCentredCubic.C | 2 +- .../initialPointsMethod/pointFile/pointFile.C | 2 +- .../uniformGrid/uniformGrid.C | 2 +- .../utilities/mesh/generation/cvMesh/cvMesh.C | 21 +- .../cvMesh/cvMeshBackgroundMesh/Make/options | 6 +- .../cvMeshBackgroundMesh.C | 17 +- .../mesh/generation/cvMesh/cvMeshDict | 42 +- wmake/rules/General/CGAL | 1 + 82 files changed, 14596 insertions(+), 6319 deletions(-) create mode 100644 applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/files create mode 100644 applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/options create mode 100644 applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C create mode 100644 applications/utilities/mesh/generation/cvMesh/checkCvMesh/meshQualityDict create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshI.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMeshIO.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/PrintTable/PrintTable.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/PrintTable/PrintTable.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/PrintTable/PrintTableI.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellAspectRatioControl/cellAspectRatioControl.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellAspectRatioControl/cellAspectRatioControl.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControlI.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMeshI.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControl.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControls.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/cellSizeAndAlignmentControls.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/fileControl/fileControl.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/fileControl/fileControl.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/CGALTriangulation3DKernel.H rename applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/{ => indexedCell}/indexedCell.C (67%) rename applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/{ => indexedCell}/indexedCell.H (84%) create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellChecks.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellChecks.H create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCellEnum.H rename applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/{ => indexedCell}/indexedCellI.H (51%) delete mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.C rename applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/{ => indexedVertex}/indexedVertex.H (57%) create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.C create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertexEnum.H rename applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/{ => indexedVertex}/indexedVertexI.H (56%) create mode 100644 applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/pointConversion.H diff --git a/applications/utilities/mesh/generation/cvMesh/Allwmake b/applications/utilities/mesh/generation/cvMesh/Allwmake index eb453138ce..d88e8cee4a 100755 --- a/applications/utilities/mesh/generation/cvMesh/Allwmake +++ b/applications/utilities/mesh/generation/cvMesh/Allwmake @@ -4,7 +4,8 @@ set -x wmake libso conformalVoronoiMesh wmake -wmake cvMeshBackgroundMesh +#wmake cvMeshBackgroundMesh (cd cvMeshSurfaceSimplify && ./Allwmake) +wmake cellSizeAndAlignmentGrid # ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/mesh/generation/cvMesh/Make/options b/applications/utilities/mesh/generation/cvMesh/Make/options index 27241b2965..9461fa3725 100644 --- a/applications/utilities/mesh/generation/cvMesh/Make/options +++ b/applications/utilities/mesh/generation/cvMesh/Make/options @@ -2,7 +2,7 @@ EXE_DEBUG = -DFULLDEBUG -g -O0 EXE_FROUNDING_MATH = -frounding-math EXE_NDEBUG = -DNDEBUG -CGAL_EXACT = +CGAL_EXACT = /*-DCGAL_DONT_USE_LAZY_KERNEL*/ CGAL_INEXACT = -DCGAL_INEXACT include $(GENERAL_RULES)/CGAL @@ -19,7 +19,9 @@ EXE_INC = \ -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/triSurface/lnInclude + -I$(LIB_SRC)/triSurface/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -IvectorTools EXE_LIBS = \ $(CGAL_LIBS) \ @@ -32,4 +34,5 @@ EXE_LIBS = \ -ledgeMesh \ -lfileFormats \ -ltriSurface \ - -ldynamicMesh + -ldynamicMesh \ + -lsampling diff --git a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/files b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/files new file mode 100644 index 0000000000..83b77fdc77 --- /dev/null +++ b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/files @@ -0,0 +1,2 @@ +cellSizeAndAlignmentGrid.C +EXE = $(FOAM_USER_APPBIN)/cellSizeAndAlignmentGrid diff --git a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/options b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/options new file mode 100644 index 0000000000..31d0d80858 --- /dev/null +++ b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/options @@ -0,0 +1,40 @@ +EXE_DEBUG = -DFULLDEBUG -g -O0 +EXE_FROUNDING_MATH = -frounding-math +EXE_NDEBUG = -DNDEBUG + +CGAL_EXACT = /*-DCGAL_DONT_USE_LAZY_KERNEL*/ +CGAL_INEXACT = -DCGAL_INEXACT + +include $(GENERAL_RULES)/CGAL + + +EXE_INC = \ + ${EXE_FROUNDING_MATH} \ + ${EXE_NDEBUG} \ + ${CGAL_INEXACT} \ + ${CGAL_INC} \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/triSurface/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ + -I$(LIB_SRC)/edgeMesh/lnInclude \ + -I$(HOME)/OpenFOAM/OpenFOAM-dev/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/lnInclude \ + -I$(HOME)/OpenFOAM/OpenFOAM-dev/applications/utilities/mesh/generation/cvMesh/vectorTools + +EXE_LIBS = \ + $(CGAL_LIBS) \ + -lmpfr \ + -lboost_thread \ + -lconformalVoronoiMesh \ + -lfiniteVolume \ + -lmeshTools \ + -ldecompositionMethods \ + -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \ + -ledgeMesh \ + -ltriSurface \ + -ldynamicMesh \ + -lsampling \ + -lfileFormats diff --git a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C new file mode 100644 index 0000000000..27cc47f823 --- /dev/null +++ b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C @@ -0,0 +1,711 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + Test-distributedDelaunayMesh + +Description + +\*---------------------------------------------------------------------------*/ + +#include "CGALTriangulation3DKernel.H" + +#include "indexedVertex.H" +#include "indexedCell.H" + +#include "argList.H" +#include "Time.H" +#include "DistributedDelaunayMesh.H" +#include "backgroundMeshDecomposition.H" +#include "searchableSurfaces.H" +#include "conformationSurfaces.H" +#include "PrintTable.H" +#include "Random.H" +#include "boundBox.H" +#include "point.H" +#include "cellShapeControlMesh.H" +#include "triadField.H" +#include "scalarIOField.H" +#include "pointIOField.H" +#include "triadIOField.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +template +Foam::tmp > filterFarPoints +( + const Triangulation& mesh, + const Field& field +) +{ + tmp > tNewField(new Field(field.size())); + Field& newField = tNewField(); + + label added = 0; + label count = 0; + + for + ( + typename Triangulation::Finite_vertices_iterator vit = + mesh.finite_vertices_begin(); + vit != mesh.finite_vertices_end(); + ++vit + ) + { + if (vit->real()) + { + newField[added++] = field[count]; + } + + count++; + } + + newField.resize(added); + + return tNewField; +} + + +template +autoPtr buildMap +( + const T& mesh, + labelListList& pointPoints +) +{ + pointPoints.setSize(mesh.vertexCount()); + + globalIndex globalIndexing(mesh.vertexCount()); + + for + ( + typename T::Finite_vertices_iterator vit = mesh.finite_vertices_begin(); + vit != mesh.finite_vertices_end(); + ++vit + ) + { + if (!vit->real()) + { + continue; + } + + std::list adjVerts; + mesh.finite_adjacent_vertices(vit, std::back_inserter(adjVerts)); + + DynamicList