From f0a196a90848866312154f1d90da2c54d3716237 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 24 Feb 2023 15:46:23 +0100 Subject: [PATCH] STYLE: include primitivePatch.H (instead of PrimitivePatch.H) - further de-clutter in the future ENH: PrimitivePatchInterpolation with unique_ptr for memory management --- .../backgroundMeshDecomposition.H | 2 - .../automatic/automatic.H | 2 +- .../fieldFromFile/fieldFromFile.H | 2 +- .../nonUniformField/nonUniformField.H | 2 +- .../PrimitivePatchInterpolation.C | 102 +++++++----------- .../PrimitivePatchInterpolation.H | 10 +- .../primitivePatchInterpolation.H | 2 +- .../primitiveMesh/PatchTools/PatchTools.H | 4 +- .../PrimitivePatch/PrimitivePatch.H | 7 +- .../primitivePatch/indirectPrimitivePatch.H | 4 +- .../primitivePatch/primitivePatch.H | 4 - .../vtk/output/foamVtkPatchWriter.H | 2 +- src/dynamicMesh/boundaryMesh/bMesh.H | 9 +- src/dynamicMesh/boundaryMesh/boundaryMesh.H | 2 +- .../polyMeshAdder/faceCoupleInfo.H | 2 - .../polyTopoChange/hexRef8/hexRef8.H | 1 - .../enrichedPatch/enrichedPatch.H | 1 - .../AMIInterpolation/findNearestMaskedOp.H | 2 +- .../cyclicACMIPointPatchField.H | 2 +- .../cyclicAMIPointPatchField.H | 2 +- .../PatchEdgeFaceWave/PatchEdgeFaceWave.H | 2 +- .../extendedEdgeMesh/extendedEdgeMesh.H | 6 +- .../indexedOctree/treeDataPrimitivePatch.C | 24 ++--- src/meshTools/meshTools/meshTools.H | 6 +- .../sensitivityBezierIncompressible.H | 8 +- .../sensitivityBezierFIIncompressible.H | 2 +- .../sensitivitySurfaceIncompressible.C | 2 +- .../adjoint/parameterization/Bezier/Bezier.H | 7 +- .../sampledPatchInternalFieldTemplates.C | 2 +- src/surfMesh/MeshedSurface/MeshedSurface.H | 7 +- src/surfMesh/polySurface/polySurface.H | 2 +- src/surfMesh/surfMesh/surfMesh.H | 2 +- .../surfaceFormats/ac3d/AC3DsurfaceFormat.C | 2 +- src/surfMesh/triSurface/triSurface.H | 7 +- 34 files changed, 102 insertions(+), 141 deletions(-) diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H index 3a489a38ca..a0dd1bd11d 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H @@ -68,9 +68,7 @@ SourceFiles #include "globalIndex.H" #include "treeBoundBox.H" #include "primitivePatch.H" -#include "face.H" #include "labelList.H" -#include "pointField.H" #include "indexedOctree.H" #include "treeDataPrimitivePatch.H" #include "volumeType.H" diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.H index 3b8da3bbf0..df9922ba12 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.H @@ -38,7 +38,7 @@ SourceFiles #include "cellSizeCalculationType.H" #include "triSurfaceFields.H" -#include "PrimitivePatchInterpolation.H" +#include "primitivePatchInterpolation.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.H index 7fb636e2af..fe301e4262 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.H @@ -38,7 +38,7 @@ SourceFiles #include "cellSizeCalculationType.H" #include "triSurfaceFields.H" -#include "PrimitivePatchInterpolation.H" +#include "primitivePatchInterpolation.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/nonUniformField/nonUniformField.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/nonUniformField/nonUniformField.H index 13436971f6..0fedf3c683 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/nonUniformField/nonUniformField.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/nonUniformField/nonUniformField.H @@ -38,7 +38,7 @@ SourceFiles #define nonUniformField_H #include "triSurfaceFields.H" -#include "PrimitivePatchInterpolation.H" +#include "primitivePatchInterpolation.H" #include "surfaceCellSizeFunction.H" #include "cellSizeCalculationType.H" diff --git a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C index ccc578f7a1..3a1a5bc0db 100644 --- a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C +++ b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,19 +27,12 @@ License \*---------------------------------------------------------------------------*/ #include "PrimitivePatchInterpolation.H" -#include "faceList.H" -#include "demandDrivenData.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -const scalarListList& -PrimitivePatchInterpolation::faceToPointWeights() const +const Foam::scalarListList& +Foam::PrimitivePatchInterpolation::faceToPointWeights() const { if (!faceToPointWeightsPtr_) { @@ -51,7 +44,7 @@ PrimitivePatchInterpolation::faceToPointWeights() const template -void PrimitivePatchInterpolation::makeFaceToPointWeights() const +void Foam::PrimitivePatchInterpolation::makeFaceToPointWeights() const { if (faceToPointWeightsPtr_) { @@ -60,10 +53,10 @@ void PrimitivePatchInterpolation::makeFaceToPointWeights() const << abort(FatalError); } - const pointField& points = patch_.localPoints(); - const List& faces = patch_.localFaces(); + const auto& points = patch_.localPoints(); + const auto& faces = patch_.localFaces(); - faceToPointWeightsPtr_ = new scalarListList(points.size()); + faceToPointWeightsPtr_.reset(new scalarListList(points.size())); auto& weights = *faceToPointWeightsPtr_; // get reference to addressing @@ -94,8 +87,8 @@ void PrimitivePatchInterpolation::makeFaceToPointWeights() const template -const scalarList& -PrimitivePatchInterpolation::faceToEdgeWeights() const +const Foam::scalarList& +Foam::PrimitivePatchInterpolation::faceToEdgeWeights() const { if (!faceToEdgeWeightsPtr_) { @@ -107,7 +100,7 @@ PrimitivePatchInterpolation::faceToEdgeWeights() const template -void PrimitivePatchInterpolation::makeFaceToEdgeWeights() const +void Foam::PrimitivePatchInterpolation::makeFaceToEdgeWeights() const { if (faceToEdgeWeightsPtr_) { @@ -116,12 +109,12 @@ void PrimitivePatchInterpolation::makeFaceToEdgeWeights() const << abort(FatalError); } - const pointField& points = patch_.localPoints(); - const List& faces = patch_.localFaces(); + const auto& points = patch_.localPoints(); + const auto& faces = patch_.localFaces(); const edgeList& edges = patch_.edges(); const labelListList& edgeFaces = patch_.edgeFaces(); - faceToEdgeWeightsPtr_ = new scalarList(patch_.nInternalEdges()); + faceToEdgeWeightsPtr_.reset(new scalarList(patch_.nInternalEdges())); auto& weights = *faceToEdgeWeightsPtr_; forAll(weights, edgei) @@ -142,17 +135,20 @@ void PrimitivePatchInterpolation::makeFaceToEdgeWeights() const template -void PrimitivePatchInterpolation::clearWeights() +void Foam::PrimitivePatchInterpolation::clearWeights() { - deleteDemandDrivenData(faceToPointWeightsPtr_); - deleteDemandDrivenData(faceToEdgeWeightsPtr_); + faceToPointWeightsPtr_.reset(nullptr); + faceToEdgeWeightsPtr_.reset(nullptr); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -PrimitivePatchInterpolation::PrimitivePatchInterpolation(const Patch& p) +Foam::PrimitivePatchInterpolation::PrimitivePatchInterpolation +( + const Patch& p +) : patch_(p), faceToPointWeightsPtr_(nullptr), @@ -160,20 +156,12 @@ PrimitivePatchInterpolation::PrimitivePatchInterpolation(const Patch& p) {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -PrimitivePatchInterpolation::~PrimitivePatchInterpolation() -{ - clearWeights(); -} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template template -tmp> PrimitivePatchInterpolation::faceToPointInterpolate +Foam::tmp> +Foam::PrimitivePatchInterpolation::faceToPointInterpolate ( const Field& ff ) const @@ -187,15 +175,8 @@ tmp> PrimitivePatchInterpolation::faceToPointInterpolate << abort(FatalError); } - tmp> tresult - ( - new Field - ( - patch_.nPoints(), Zero - ) - ); - - Field& result = tresult.ref(); + auto tresult = tmp>::New(patch_.nPoints(), Zero); + auto& result = tresult.ref(); const labelListList& pointFaces = patch_.pointFaces(); const scalarListList& weights = faceToPointWeights(); @@ -217,7 +198,8 @@ tmp> PrimitivePatchInterpolation::faceToPointInterpolate template template -tmp> PrimitivePatchInterpolation::faceToPointInterpolate +Foam::tmp> +Foam::PrimitivePatchInterpolation::faceToPointInterpolate ( const tmp>& tff ) const @@ -230,7 +212,8 @@ tmp> PrimitivePatchInterpolation::faceToPointInterpolate template template -tmp> PrimitivePatchInterpolation::pointToFaceInterpolate +Foam::tmp> +Foam::PrimitivePatchInterpolation::pointToFaceInterpolate ( const Field& pf ) const @@ -243,18 +226,10 @@ tmp> PrimitivePatchInterpolation::pointToFaceInterpolate << abort(FatalError); } - tmp> tresult - ( - new Field - ( - patch_.size(), - Zero - ) - ); + auto tresult = tmp>::New(patch_.size(), Zero); + auto& result = tresult.ref(); - Field& result = tresult.ref(); - - const List& localFaces = patch_.localFaces(); + const auto& localFaces = patch_.localFaces(); forAll(result, facei) { @@ -274,7 +249,8 @@ tmp> PrimitivePatchInterpolation::pointToFaceInterpolate template template -tmp> PrimitivePatchInterpolation::pointToFaceInterpolate +Foam::tmp> +Foam::PrimitivePatchInterpolation::pointToFaceInterpolate ( const tmp>& tpf ) const @@ -287,7 +263,8 @@ tmp> PrimitivePatchInterpolation::pointToFaceInterpolate template template -tmp> PrimitivePatchInterpolation::faceToEdgeInterpolate +Foam::tmp> +Foam::PrimitivePatchInterpolation::faceToEdgeInterpolate ( const Field& pf ) const @@ -327,7 +304,8 @@ tmp> PrimitivePatchInterpolation::faceToEdgeInterpolate template template -tmp> PrimitivePatchInterpolation::faceToEdgeInterpolate +Foam::tmp> +Foam::PrimitivePatchInterpolation::faceToEdgeInterpolate ( const tmp>& tpf ) const @@ -339,7 +317,7 @@ tmp> PrimitivePatchInterpolation::faceToEdgeInterpolate template -bool PrimitivePatchInterpolation::movePoints() +bool Foam::PrimitivePatchInterpolation::movePoints() { clearWeights(); @@ -347,8 +325,4 @@ bool PrimitivePatchInterpolation::movePoints() } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.H b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.H index 22f9b65335..c952be4c9b 100644 --- a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.H +++ b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.H @@ -39,6 +39,7 @@ SourceFiles #define PrimitivePatchInterpolation_H #include "scalarList.H" +#include "faceList.H" #include "Field.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -46,6 +47,9 @@ SourceFiles namespace Foam { +// Forward Declarations +template class PrimitivePatchInterpolation; + /*---------------------------------------------------------------------------*\ Class PrimitivePatchInterpolation Declaration \*---------------------------------------------------------------------------*/ @@ -62,10 +66,10 @@ class PrimitivePatchInterpolation // Demand-driven data //- Face-to-point weights - mutable scalarListList* faceToPointWeightsPtr_; + mutable std::unique_ptr faceToPointWeightsPtr_; //- Face-to-edge weights - mutable scalarList* faceToEdgeWeightsPtr_; + mutable std::unique_ptr faceToEdgeWeightsPtr_; // Private Member Functions @@ -105,7 +109,7 @@ public: //- Destructor - ~PrimitivePatchInterpolation(); + ~PrimitivePatchInterpolation() = default; // Member Functions diff --git a/src/OpenFOAM/interpolations/primitivePatchInterpolation/primitivePatchInterpolation.H b/src/OpenFOAM/interpolations/primitivePatchInterpolation/primitivePatchInterpolation.H index 93f26a1922..266f251eba 100644 --- a/src/OpenFOAM/interpolations/primitivePatchInterpolation/primitivePatchInterpolation.H +++ b/src/OpenFOAM/interpolations/primitivePatchInterpolation/primitivePatchInterpolation.H @@ -35,8 +35,8 @@ Description #ifndef primitivePatchInterpolation_H #define primitivePatchInterpolation_H -#include "PrimitivePatchInterpolation.H" #include "primitivePatch.H" +#include "PrimitivePatchInterpolation.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchTools.H b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchTools.H index 0a96cfb0cd..56fbd59a90 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchTools.H +++ b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchTools.H @@ -48,9 +48,9 @@ SourceFiles #ifndef Foam_PatchTools_H #define Foam_PatchTools_H -#include "PrimitivePatch.H" -#include "globalIndex.H" #include "autoPtr.H" +#include "globalIndex.H" +#include "primitivePatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H index 3355bacdde..0c83b4c273 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H +++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatch.H @@ -57,9 +57,11 @@ SourceFiles #include "boolList.H" #include "labelList.H" #include "edgeList.H" -#include "point.H" +#include "face.H" +#include "pointField.H" #include "intersection.H" #include "HashSet.H" +#include "SubList.H" #include "objectHit.H" #include "PrimitivePatchBase.H" @@ -69,8 +71,9 @@ namespace Foam { // Forward Declarations -class face; template class Map; +template class PrimitivePatch; + /*---------------------------------------------------------------------------*\ Class PrimitivePatch Declaration diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/indirectPrimitivePatch.H b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/indirectPrimitivePatch.H index 4de24fb4b2..ee1b9d9906 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/indirectPrimitivePatch.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/indirectPrimitivePatch.H @@ -43,10 +43,8 @@ Description #ifndef Foam_indirectPrimitivePatch_H #define Foam_indirectPrimitivePatch_H -#include "PrimitivePatch.H" -#include "face.H" +#include "primitivePatch.H" #include "IndirectList.H" -#include "pointField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitivePatch.H b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitivePatch.H index 9fda6d684f..f6279b5990 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitivePatch.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitivePatch.H @@ -48,10 +48,6 @@ Description #define Foam_primitivePatch_H #include "PrimitivePatch.H" -#include "face.H" -#include "SubList.H" -#include "List.H" -#include "pointField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/conversion/vtk/output/foamVtkPatchWriter.H b/src/conversion/vtk/output/foamVtkPatchWriter.H index b6e5297706..429c212b1c 100644 --- a/src/conversion/vtk/output/foamVtkPatchWriter.H +++ b/src/conversion/vtk/output/foamVtkPatchWriter.H @@ -53,7 +53,7 @@ SourceFiles #include "foamVtkPatchMeshWriter.H" #include "volFields.H" #include "pointFields.H" -#include "PrimitivePatchInterpolation.H" +#include "primitivePatchInterpolation.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/boundaryMesh/bMesh.H b/src/dynamicMesh/boundaryMesh/bMesh.H index a41a250204..5aab8f0915 100644 --- a/src/dynamicMesh/boundaryMesh/bMesh.H +++ b/src/dynamicMesh/boundaryMesh/bMesh.H @@ -33,13 +33,10 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef bMesh_H -#define bMesh_H +#ifndef Foam_bMesh_H +#define Foam_bMesh_H -#include "PrimitivePatch.H" -#include "face.H" -#include "List.H" -#include "pointField.H" +#include "primitivePatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/boundaryMesh/boundaryMesh.H b/src/dynamicMesh/boundaryMesh/boundaryMesh.H index 0b20ef4100..a7367be57b 100644 --- a/src/dynamicMesh/boundaryMesh/boundaryMesh.H +++ b/src/dynamicMesh/boundaryMesh/boundaryMesh.H @@ -43,7 +43,7 @@ SourceFiles #include "boundaryPatch.H" #include "className.H" #include "polyPatch.H" -#include "PrimitivePatch.H" +#include "primitivePatch.H" #include "PtrList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.H b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.H index 5424b736b2..2e2df56b3d 100644 --- a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.H +++ b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.H @@ -137,7 +137,6 @@ SourceFiles #define Foam_faceCoupleInfo_H #include "edgeHashes.H" -#include "pointField.H" #include "indirectPrimitivePatch.H" #include "primitivePatch.H" @@ -147,7 +146,6 @@ namespace Foam { // Forward Declarations -class face; class primitiveMesh; class polyPatch; class polyMesh; diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.H b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.H index 681ef62f0d..d82f7b4fef 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.H +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.H @@ -39,7 +39,6 @@ SourceFiles #define hexRef8_H #include "labelIOList.H" -#include "face.H" #include "HashSet.H" #include "DynamicList.H" #include "primitivePatch.H" diff --git a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H index bec45a2d29..2689d449f8 100644 --- a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H +++ b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H @@ -55,7 +55,6 @@ SourceFiles #define Foam_enrichedPatch_H #include "Map.H" -#include "point.H" #include "primitivePatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/findNearestMaskedOp.H b/src/meshTools/AMIInterpolation/AMIInterpolation/findNearestMaskedOp.H index 2290021efb..3d66906b7b 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/findNearestMaskedOp.H +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/findNearestMaskedOp.H @@ -43,7 +43,7 @@ public: if (!excludeIndices_.found(index)) { - const typename PatchType::FaceType& f = patch[index]; + const auto& f = patch[index]; pointHit nearHit = f.nearestPoint(sample, points); scalar distSqr = sqr(nearHit.distance()); diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H index fa2d54f387..17755d5295 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPointPatchField/cyclicACMIPointPatchField.H @@ -40,7 +40,7 @@ SourceFiles #include "coupledPointPatchField.H" #include "cyclicACMIPointPatch.H" -#include "PrimitivePatchInterpolation.H" +#include "primitivePatchInterpolation.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H index 78a8148c09..5840a30269 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPointPatchField/cyclicAMIPointPatchField.H @@ -40,7 +40,7 @@ SourceFiles #include "coupledPointPatchField.H" #include "cyclicAMIPointPatch.H" -#include "PrimitivePatchInterpolation.H" +#include "primitivePatchInterpolation.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/algorithms/PatchEdgeFaceWave/PatchEdgeFaceWave.H b/src/meshTools/algorithms/PatchEdgeFaceWave/PatchEdgeFaceWave.H index e96c54e1ef..0a59fb7ac8 100644 --- a/src/meshTools/algorithms/PatchEdgeFaceWave/PatchEdgeFaceWave.H +++ b/src/meshTools/algorithms/PatchEdgeFaceWave/PatchEdgeFaceWave.H @@ -42,7 +42,7 @@ SourceFiles #include "bitSet.H" #include "scalarField.H" -#include "PrimitivePatch.H" +#include "primitivePatch.H" #include "vectorTensorTransform.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.H b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.H index f495b8e8f6..254b48969b 100644 --- a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.H +++ b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.H @@ -56,14 +56,14 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef extendedEdgeMesh_H -#define extendedEdgeMesh_H +#ifndef Foam_extendedEdgeMesh_H +#define Foam_extendedEdgeMesh_H #include "edgeMesh.H" #include "indexedOctree.H" #include "treeDataEdge.H" #include "treeDataPoint.H" -#include "PrimitivePatch.H" +#include "primitivePatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/indexedOctree/treeDataPrimitivePatch.C b/src/meshTools/indexedOctree/treeDataPrimitivePatch.C index 74d7a76448..7cafbe5dc3 100644 --- a/src/meshTools/indexedOctree/treeDataPrimitivePatch.C +++ b/src/meshTools/indexedOctree/treeDataPrimitivePatch.C @@ -199,9 +199,9 @@ Foam::volumeType Foam::treeDataPrimitivePatch::getVolumeType << " nearest face:" << facei; } - const typename PatchType::face_type& localF = patch_.localFaces()[facei]; - const typename PatchType::face_type& f = patch_[facei]; - const pointField& points = patch_.points(); + const auto& localF = patch_.localFaces()[facei]; + const auto& f = patch_[facei]; + const auto& points = patch_.points(); // Retest to classify where on face info is. Note: could be improved. We // already have point. @@ -412,8 +412,8 @@ bool Foam::treeDataPrimitivePatch::overlaps // 2. Check if one or more face points inside - const pointField& points = patch_.points(); - const typename PatchType::face_type& f = patch_[index]; + const auto& points = patch_.points(); + const auto& f = patch_[index]; if (f.size() == 3) { @@ -469,8 +469,8 @@ bool Foam::treeDataPrimitivePatch::overlaps return false; } - const pointField& points = patch_.points(); - const face& f = patch_[index]; + const auto& points = patch_.points(); + const auto& f = patch_[index]; pointHit nearHit = f.nearestPoint(centre, points); @@ -498,11 +498,11 @@ void Foam::treeDataPrimitivePatch::findNearest point& nearestPoint ) const { - const pointField& points = patch_.points(); + const auto& points = patch_.points(); for (const label index : indices) { - const typename PatchType::face_type& f = patch_[index]; + const auto& f = patch_[index]; const pointHit nearHit = f.nearestPoint(sample, points); const scalar distSqr = sqr(nearHit.distance()); @@ -606,7 +606,7 @@ bool Foam::treeDataPrimitivePatch::findSelfIntersectOp::operator() const treeDataPrimitivePatch& shape = tree_.shapes(); const PatchType& patch = shape.patch(); - const typename PatchType::face_type& f = patch.localFaces()[index]; + const auto& f = patch.localFaces()[index]; const edge& e = patch.edges()[edgeID_]; if (!f.found(e[0]) && !f.found(e[1])) @@ -631,8 +631,8 @@ bool Foam::treeDataPrimitivePatch::findIntersection const treeDataPrimitivePatch& shape = tree.shapes(); const PatchType& patch = shape.patch(); - const pointField& points = patch.points(); - const typename PatchType::face_type& f = patch[index]; + const auto& points = patch.points(); + const auto& f = patch[index]; // Do quick rejection test if (shape.cacheBb_) diff --git a/src/meshTools/meshTools/meshTools.H b/src/meshTools/meshTools/meshTools.H index fd5996864d..007d3b519d 100644 --- a/src/meshTools/meshTools/meshTools.H +++ b/src/meshTools/meshTools/meshTools.H @@ -34,14 +34,13 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef meshTools_H -#define meshTools_H +#ifndef Foam_meshTools_H +#define Foam_meshTools_H #include "label.H" #include "vector.H" #include "triad.H" #include "labelList.H" -#include "pointField.H" #include "faceList.H" #include "cellList.H" #include "primitivePatch.H" @@ -51,6 +50,7 @@ SourceFiles namespace Foam { +// Forward Declarations class polyMesh; class primitiveMesh; class treeBoundBox; diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivityBezier/sensitivityBezierIncompressible.H b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivityBezier/sensitivityBezierIncompressible.H index c31b3ff5ed..0422edadeb 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivityBezier/sensitivityBezierIncompressible.H +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivityBezier/sensitivityBezierIncompressible.H @@ -25,7 +25,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . - Class Foam::incompressible::sensitivityBezier @@ -37,8 +36,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef sensitivityBezierIncompressible_H -#define sensitivityBezierIncompressible_H +#ifndef Foam_sensitivityBezierIncompressible_H +#define Foam_sensitivityBezierIncompressible_H #include "primitiveFieldsFwd.H" #include "volFieldsFwd.H" @@ -46,8 +45,7 @@ SourceFiles #include "surfaceFieldsFwd.H" #include "volPointInterpolation.H" #include "SIBaseIncompressible.H" -#include "PrimitivePatchInterpolation.H" -#include "PrimitivePatch.H" +#include "primitivePatchInterpolation.H" #include "deltaBoundary.H" #include "Bezier.H" diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivityBezierFI/sensitivityBezierFIIncompressible.H b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivityBezierFI/sensitivityBezierFIIncompressible.H index 9f83d24fb5..56df11726d 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivityBezierFI/sensitivityBezierFIIncompressible.H +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivityBezierFI/sensitivityBezierFIIncompressible.H @@ -46,7 +46,7 @@ SourceFiles #include "surfaceFieldsFwd.H" #include "volPointInterpolation.H" #include "FIBaseIncompressible.H" -#include "PrimitivePatchInterpolation.H" +#include "primitivePatchInterpolation.H" #include "deltaBoundary.H" #include "Bezier.H" diff --git a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivitySurface/sensitivitySurfaceIncompressible.C b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivitySurface/sensitivitySurfaceIncompressible.C index 5914db0798..8844079cfd 100644 --- a/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivitySurface/sensitivitySurfaceIncompressible.C +++ b/src/optimisation/adjointOptimisation/adjoint/optimisation/adjointSensitivity/incompressible/sensitivitySurface/sensitivitySurfaceIncompressible.C @@ -29,7 +29,7 @@ License #include "sensitivitySurfaceIncompressible.H" #include "incompressibleAdjointSolver.H" -#include "PrimitivePatchInterpolation.H" +#include "primitivePatchInterpolation.H" #include "syncTools.H" #include "addToRunTimeSelectionTable.H" #include "faMatrices.H" diff --git a/src/optimisation/adjointOptimisation/adjoint/parameterization/Bezier/Bezier.H b/src/optimisation/adjointOptimisation/adjoint/parameterization/Bezier/Bezier.H index 00470e7616..3d3896ac22 100644 --- a/src/optimisation/adjointOptimisation/adjoint/parameterization/Bezier/Bezier.H +++ b/src/optimisation/adjointOptimisation/adjoint/parameterization/Bezier/Bezier.H @@ -36,16 +36,15 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef Bezier_H -#define Bezier_H +#ifndef Foam_Bezier_H +#define Foam_Bezier_H #include "primitiveFieldsFwd.H" #include "volFieldsFwd.H" #include "pointFieldsFwd.H" #include "surfaceFieldsFwd.H" #include "volPointInterpolation.H" -#include "PrimitivePatchInterpolation.H" -#include "PrimitivePatch.H" +#include "primitivePatchInterpolation.H" #include "deltaBoundary.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalFieldTemplates.C b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalFieldTemplates.C index 97943c9abe..4d5e5d2d40 100644 --- a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalFieldTemplates.C +++ b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalFieldTemplates.C @@ -28,7 +28,7 @@ License #include "sampledPatchInternalField.H" #include "interpolationCellPoint.H" -#include "PrimitivePatchInterpolation.H" +#include "primitivePatchInterpolation.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/surfMesh/MeshedSurface/MeshedSurface.H b/src/surfMesh/MeshedSurface/MeshedSurface.H index 87c7181ee6..8f7214257e 100644 --- a/src/surfMesh/MeshedSurface/MeshedSurface.H +++ b/src/surfMesh/MeshedSurface/MeshedSurface.H @@ -52,12 +52,11 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef MeshedSurface_H -#define MeshedSurface_H +#ifndef Foam_MeshedSurface_H +#define Foam_MeshedSurface_H -#include "PrimitivePatch.H" +#include "primitivePatch.H" #include "PatchTools.H" -#include "pointField.H" #include "face.H" #include "labelledTri.H" #include "bitSet.H" diff --git a/src/surfMesh/polySurface/polySurface.H b/src/surfMesh/polySurface/polySurface.H index 2a23c6fe0f..3256c2ec68 100644 --- a/src/surfMesh/polySurface/polySurface.H +++ b/src/surfMesh/polySurface/polySurface.H @@ -42,7 +42,7 @@ SourceFiles #define Foam_polySurface_H #include "objectRegistry.H" -#include "PrimitivePatch.H" +#include "primitivePatch.H" #include "meshedSurf.H" #include "polySurfaceFieldsFwd.H" diff --git a/src/surfMesh/surfMesh/surfMesh.H b/src/surfMesh/surfMesh/surfMesh.H index e324a1ebaf..078126c098 100644 --- a/src/surfMesh/surfMesh/surfMesh.H +++ b/src/surfMesh/surfMesh/surfMesh.H @@ -43,7 +43,7 @@ SourceFiles #include "surfaceRegistry.H" #include "MeshedSurfaceIOAllocator.H" -#include "PrimitivePatch.H" +#include "primitivePatch.H" #include "surfZoneIOList.H" #include "surfFieldsFwd.H" diff --git a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C index 46a401ba08..6e84873870 100644 --- a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C @@ -28,7 +28,7 @@ License #include "AC3DsurfaceFormat.H" #include "StringStream.H" -#include "PrimitivePatch.H" +#include "primitivePatch.H" #include "faceTraits.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/surfMesh/triSurface/triSurface.H b/src/surfMesh/triSurface/triSurface.H index 899d76ecd9..f8f0b4519f 100644 --- a/src/surfMesh/triSurface/triSurface.H +++ b/src/surfMesh/triSurface/triSurface.H @@ -38,12 +38,11 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef triSurface_H -#define triSurface_H +#ifndef Foam_triSurface_H +#define Foam_triSurface_H -#include "PrimitivePatch.H" +#include "primitivePatch.H" #include "PatchTools.H" -#include "pointField.H" #include "labelledTri.H" #include "boolList.H" #include "bitSet.H"