From 50995706a639569fffe33ace90d01ff699bc773d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 4 Nov 2021 17:30:48 +0100 Subject: [PATCH] STYLE: remove unused private fields (foamyMesh) - simplify handling of warnings for surfaceBooleanFeatures --- .../cv2DControls/cv2DControls.C | 2 -- .../cv2DControls/cv2DControls.H | 5 ++--- .../cellShapeControl/cellShapeControl.C | 8 -------- .../cellShapeControl/cellShapeControl.H | 8 ++------ .../cellShapeControlMesh/cellShapeControlMesh.C | 13 +++---------- .../cellShapeControlMesh/cellShapeControlMesh.H | 8 +++++--- .../conformationSurfaces/conformationSurfaces.C | 5 ++--- .../conformationSurfaces/conformationSurfaces.H | 4 +--- .../foamyMesh/foamyQuadMesh/shortEdgeFilter2D.C | 11 ++--------- .../foamyMesh/foamyQuadMesh/shortEdgeFilter2D.H | 6 +++--- .../surface/surfaceBooleanFeatures/Make/options | 10 ++++++---- .../PolyhedronReader/Make/options | 2 +- 12 files changed, 27 insertions(+), 55 deletions(-) diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoi2DMesh/cv2DControls/cv2DControls.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoi2DMesh/cv2DControls/cv2DControls.C index 96dfbe8fb7..7f39576bd6 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoi2DMesh/cv2DControls/cv2DControls.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoi2DMesh/cv2DControls/cv2DControls.C @@ -36,8 +36,6 @@ Foam::cv2DControls::cv2DControls const boundBox& bb ) : - dict_(controlDict), - motionControl_(controlDict.subDict("motionControl")), conformationControl_(controlDict.subDict("surfaceConformation")), diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoi2DMesh/cv2DControls/cv2DControls.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoi2DMesh/cv2DControls/cv2DControls.H index de2d494a49..8ef35eea6c 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoi2DMesh/cv2DControls/cv2DControls.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoi2DMesh/cv2DControls/cv2DControls.H @@ -60,10 +60,9 @@ Ostream& operator<<(Ostream&, const cv2DControls&); class cv2DControls { - // Private data + // Private Data - //- Description of data_ - const dictionary& dict_; + //- Description of data const dictionary& motionControl_; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C index 1a1492a221..8b5d394e19 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.C @@ -56,8 +56,6 @@ Foam::cellShapeControl::cellShapeControl ( foamyHexMeshControls.foamyHexMeshDict().subDict("motionControl") ), - runTime_(runTime), - allGeometry_(allGeometry), geometryToConformTo_(geometryToConformTo), defaultCellSize_(foamyHexMeshControls.defaultCellSize()), minimumCellSize_(foamyHexMeshControls.minimumCellSize()), @@ -73,12 +71,6 @@ Foam::cellShapeControl::cellShapeControl {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::cellShapeControl::~cellShapeControl() -{} - - // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // Foam::scalarField Foam::cellShapeControl::cellSize diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.H index 3846f4036e..9e4277fa99 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControl/cellShapeControl.H @@ -66,11 +66,7 @@ class cellShapeControl : public dictionary { - // Private data - - const Time& runTime_; - - const searchableSurfaces& allGeometry_; + // Private Data const conformationSurfaces& geometryToConformTo_; @@ -114,7 +110,7 @@ public: //- Destructor - ~cellShapeControl(); + ~cellShapeControl() = default; // Member Functions diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C index 6761680938..f1c8d5018c 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C @@ -41,10 +41,10 @@ License namespace Foam { defineTypeNameAndDebug(cellShapeControlMesh, 0); - -word cellShapeControlMesh::meshSubDir = "cellShapeControlMesh"; } +Foam::word Foam::cellShapeControlMesh::meshSubDir = "cellShapeControlMesh"; + // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // @@ -367,8 +367,7 @@ Foam::cellShapeControlMesh::cellShapeControlMesh(const Time& runTime) runTime, meshSubDir ), - runTime_(runTime), - defaultCellSize_(0.0) + runTime_(runTime) { if (this->vertexCount()) { @@ -442,12 +441,6 @@ Foam::cellShapeControlMesh::cellShapeControlMesh(const Time& runTime) } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::cellShapeControlMesh::~cellShapeControlMesh() -{} - - // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // void Foam::cellShapeControlMesh::barycentricCoords diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H index 75bba54b86..1510b81181 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.H @@ -55,6 +55,7 @@ SourceFiles namespace Foam { +// Forward Declarations class cellSizeAndAlignmentControls; /*---------------------------------------------------------------------------*\ @@ -74,13 +75,13 @@ public: private: - // Private data + // Private Data const Time& runTime_; mutable Cell_handle oldCellHandle_; - const scalar defaultCellSize_; + /// const scalar defaultCellSize_; // Private Member Functions @@ -103,11 +104,12 @@ public: // Constructors + //- Construct from runTime explicit cellShapeControlMesh(const Time& runTime); //- Destructor - ~cellShapeControlMesh(); + ~cellShapeControlMesh() = default; // Member Functions diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C index 0fb81bc8c1..ffdaefb13f 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.C @@ -275,7 +275,6 @@ Foam::conformationSurfaces::conformationSurfaces ) : runTime_(runTime), - rndGen_(rndGen), allGeometry_(allGeometry), features_(), locationInMesh_(surfaceConformationDict.get("locationInMesh")), @@ -287,7 +286,7 @@ Foam::conformationSurfaces::conformationSurfaces regionOffset_(), patchInfo_(), globalBounds_(), - referenceVolumeTypes_(0) + referenceVolumeTypes_() { const dictionary& surfacesDict ( @@ -565,7 +564,7 @@ Foam::conformationSurfaces::conformationSurfaces // Extend the global bounds to stop the bound box sitting on the surfaces // to be conformed to - //globalBounds_ = globalBounds_.extend(rndGen_, 1e-4); + //globalBounds_ = globalBounds_.extend(rndGen, 1e-4); vector newSpan = 1e-4*globalBounds_.span(); diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H index 5a00eb57e4..79447260b7 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformationSurfaces/conformationSurfaces.H @@ -57,12 +57,10 @@ class conformationSurfaces { typedef extendedFeatureEdgeMesh::sideVolumeType sideVolumeType; - // Private data + // Private Data const Time& runTime_; - Random& rndGen_; - //- Reference to the searchableSurfaces object holding all geometry data const searchableSurfaces& allGeometry_; diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/shortEdgeFilter2D.C b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/shortEdgeFilter2D.C index 80ba11fc9c..b4804e5add 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/shortEdgeFilter2D.C +++ b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/shortEdgeFilter2D.C @@ -134,14 +134,13 @@ Foam::shortEdgeFilter2D::shortEdgeFilter2D const dictionary& dict ) : - cv2Dmesh_(cv2Dmesh), shortEdgeFilterFactor_(dict.get("shortEdgeFilterFactor")), edgeAttachedToBoundaryFactor_ ( dict.getOrDefault("edgeAttachedToBoundaryFactor", 2.0) ), - patchNames_(wordList()), - patchSizes_(labelList()), + patchNames_(), + patchSizes_(), mapEdgesRegion_(), indirectPatchEdge_() { @@ -201,12 +200,6 @@ Foam::shortEdgeFilter2D::shortEdgeFilter2D } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::shortEdgeFilter2D::~shortEdgeFilter2D() -{} - - // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // void Foam::shortEdgeFilter2D::filter() diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/shortEdgeFilter2D.H b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/shortEdgeFilter2D.H index 315e459444..49acc4e98b 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/shortEdgeFilter2D.H +++ b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/shortEdgeFilter2D.H @@ -53,8 +53,6 @@ class shortEdgeFilter2D { // Private Data - const CV2D& cv2Dmesh_; - MeshedSurface ms_; const scalar shortEdgeFilterFactor_; @@ -98,13 +96,15 @@ public: //- Runtime type information ClassName("shortEdgeFilter2D"); + // Constructors + //- Construct from components shortEdgeFilter2D(const CV2D& cv2Dmesh, const dictionary& dict); //- Destructor - ~shortEdgeFilter2D(); + ~shortEdgeFilter2D() = default; // Access Functions diff --git a/applications/utilities/surface/surfaceBooleanFeatures/Make/options b/applications/utilities/surface/surfaceBooleanFeatures/Make/options index ef8abccf93..554b39c891 100644 --- a/applications/utilities/surface/surfaceBooleanFeatures/Make/options +++ b/applications/utilities/surface/surfaceBooleanFeatures/Make/options @@ -1,20 +1,22 @@ EXE_NDEBUG = -DNDEBUG /* EXE_NDEBUG = -g -O0 -DFULLDEBUG */ -c++CGALWARN = -Wno-old-style-cast /*-- Define NO_CGAL in COMP_FLAGS to avoid using CGAL altogether */ /*-- Define CGAL_INEXACT to use inexact CGAL constructions */ -ifeq (,$(findstring NO_CGAL,$(COMP_FLAGS))) -include $(GENERAL_RULES)/cgal +ifneq (,$(findstring NO_CGAL,$(COMP_FLAGS))) + include $(GENERAL_RULES)/no-cgal + c++LESSWARN := +else + include $(GENERAL_RULES)/cgal endif EXE_INC = \ ${ROUNDING_MATH} \ ${EXE_NDEBUG} \ ${CGAL_INC} \ - ${c++CGALWARN} \ + ${c++LESSWARN} \ $(COMP_FLAGS) \ -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ diff --git a/applications/utilities/surface/surfaceBooleanFeatures/PolyhedronReader/Make/options b/applications/utilities/surface/surfaceBooleanFeatures/PolyhedronReader/Make/options index 7a400a830d..3f7a39676c 100644 --- a/applications/utilities/surface/surfaceBooleanFeatures/PolyhedronReader/Make/options +++ b/applications/utilities/surface/surfaceBooleanFeatures/PolyhedronReader/Make/options @@ -11,7 +11,7 @@ EXE_INC = \ ${ROUNDING_MATH} \ ${EXE_NDEBUG} \ ${CGAL_INC} \ - ${c++CGALWARN} \ + ${c++LESSWARN} \ -I.. \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude