From 5c9f07df7a46e060c05a59391a0423840e94ba5e Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 30 Apr 2020 11:13:22 +0200 Subject: [PATCH 1/2] STYLE: include demandDrivenData.H wherever deleteDemandDrivenData is used - allows easier identification for future changes --- .../polyPatches/polyPatch/polyPatch.C | 3 ++- .../interfaceTrackingFvMesh.C | 1 + .../interfaceTrackingFvMesh.H | 1 + src/dynamicMesh/attachDetach/attachDetach.C | 6 +---- .../layerAdditionRemoval.C | 5 ++-- .../slidingInterface/coupleSlidingInterface.C | 3 ++- .../enrichedPatch/enrichedPatchCutFaces.C | 3 ++- .../slidingInterface/slidingInterface.C | 1 + .../slidingInterfaceAttachedAddressing.C | 3 ++- .../slidingInterfaceProjectPoints.C | 3 ++- .../faMesh/faMeshMapper/faAreaMapper.C | 4 +-- .../faMesh/faMeshMapper/faEdgeMapper.C | 4 +-- .../faMesh/faMeshMapper/faPatchMapper.C | 1 + .../constraint/processor/processorFaPatch.C | 1 + .../faMesh/faPatches/faPatch/faPatch.C | 1 + .../leastSquaresFaVectors.C | 25 ++++++------------- .../fvMatrices/fvMatrix/fvMatrix.C | 3 ++- .../fvMesh/fvMeshMapper/fvPatchMapper.C | 2 ++ .../fvMesh/fvMeshMapper/fvSurfaceMapper.C | 5 ++-- .../schemes/weightedFlux/weightedFlux.C | 1 + .../twoDPointCorrector/twoDPointCorrector.C | 3 ++- .../TDACChemistryModel/tabulation/ISAT/ISAT.C | 3 ++- .../tabulation/ISAT/binaryTree/binaryTree.C | 3 ++- .../mixerFvMesh/mixerFvMesh.C | 1 + 24 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C index e9a424b0a2..3e915b3e7e 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,6 +35,7 @@ License #include "entry.H" #include "dictionary.H" #include "pointPatchField.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.C b/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.C index 880c98ca0e..eb9383a825 100644 --- a/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.C +++ b/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.C @@ -45,6 +45,7 @@ License #include "twoDPointCorrector.H" #include "gravityMeshObject.H" #include "turbulentTransportModel.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.H b/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.H index 638ad8cce4..33c4c4c951 100644 --- a/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.H +++ b/src/dynamicFaMesh/interfaceTrackingFvMesh/interfaceTrackingFvMesh.H @@ -44,6 +44,7 @@ SourceFiles #include "surfaceFields.H" #include "surfactantProperties.H" #include "singlePhaseTransportModel.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/attachDetach/attachDetach.C b/src/dynamicMesh/attachDetach/attachDetach.C index eb05ece4de..151d104e24 100644 --- a/src/dynamicMesh/attachDetach/attachDetach.C +++ b/src/dynamicMesh/attachDetach/attachDetach.C @@ -24,11 +24,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - Attach/detach boundary mesh modifier. This modifier takes a set of - internal faces and converts them into boundary faces and vice versa - based on the given activation switch. - \*---------------------------------------------------------------------------*/ #include "attachDetach.H" @@ -38,6 +33,7 @@ Description #include "primitiveMesh.H" #include "polyTopoChange.H" #include "addToRunTimeSelectionTable.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C b/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C index 56c297267d..a7d9b46b61 100644 --- a/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C +++ b/src/dynamicMesh/layerAdditionRemoval/layerAdditionRemoval.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -23,9 +24,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - Cell layer addition/removal mesh modifier - \*---------------------------------------------------------------------------*/ #include "layerAdditionRemoval.H" @@ -35,6 +33,7 @@ Description #include "primitiveMesh.H" #include "polyTopoChange.H" #include "addToRunTimeSelectionTable.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/slidingInterface/coupleSlidingInterface.C b/src/dynamicMesh/slidingInterface/coupleSlidingInterface.C index 74fc0f4a87..500eba7ee1 100644 --- a/src/dynamicMesh/slidingInterface/coupleSlidingInterface.C +++ b/src/dynamicMesh/slidingInterface/coupleSlidingInterface.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,6 +42,7 @@ License #include "polyModifyPoint.H" #include "polyModifyFace.H" #include "polyRemoveFace.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C index 938cdfa2c0..3452c0d4fa 100644 --- a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C +++ b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,6 +36,7 @@ Description #include "labelPair.H" #include "primitiveMesh.H" #include "edgeHashes.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/slidingInterface/slidingInterface.C b/src/dynamicMesh/slidingInterface/slidingInterface.C index 6498192299..d674a6bd90 100644 --- a/src/dynamicMesh/slidingInterface/slidingInterface.C +++ b/src/dynamicMesh/slidingInterface/slidingInterface.C @@ -32,6 +32,7 @@ License #include "polyTopoChange.H" #include "addToRunTimeSelectionTable.H" #include "plane.H" +#include "demandDrivenData.H" // Index of debug signs: // p - adjusting a projection point diff --git a/src/dynamicMesh/slidingInterface/slidingInterfaceAttachedAddressing.C b/src/dynamicMesh/slidingInterface/slidingInterfaceAttachedAddressing.C index 193c67c871..cb9429a18c 100644 --- a/src/dynamicMesh/slidingInterface/slidingInterfaceAttachedAddressing.C +++ b/src/dynamicMesh/slidingInterface/slidingInterfaceAttachedAddressing.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,6 +30,7 @@ License #include "polyMesh.H" #include "mapPolyMesh.H" #include "polyTopoChanger.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/dynamicMesh/slidingInterface/slidingInterfaceProjectPoints.C b/src/dynamicMesh/slidingInterface/slidingInterfaceProjectPoints.C index a053758113..0ec1736e5a 100644 --- a/src/dynamicMesh/slidingInterface/slidingInterfaceProjectPoints.C +++ b/src/dynamicMesh/slidingInterface/slidingInterfaceProjectPoints.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,6 +30,7 @@ License #include "polyMesh.H" #include "line.H" #include "polyTopoChanger.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/finiteArea/faMesh/faMeshMapper/faAreaMapper.C b/src/finiteArea/faMesh/faMeshMapper/faAreaMapper.C index d46642f506..3f179bc6b7 100644 --- a/src/finiteArea/faMesh/faMeshMapper/faAreaMapper.C +++ b/src/finiteArea/faMesh/faMeshMapper/faAreaMapper.C @@ -23,13 +23,11 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - FV surface mapper. - \*---------------------------------------------------------------------------*/ #include "faAreaMapper.H" #include "mapPolyMesh.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/finiteArea/faMesh/faMeshMapper/faEdgeMapper.C b/src/finiteArea/faMesh/faMeshMapper/faEdgeMapper.C index 65366cd224..dd0684a39c 100644 --- a/src/finiteArea/faMesh/faMeshMapper/faEdgeMapper.C +++ b/src/finiteArea/faMesh/faMeshMapper/faEdgeMapper.C @@ -23,13 +23,11 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - FA edge mapper. - \*---------------------------------------------------------------------------*/ #include "faEdgeMapper.H" #include "mapPolyMesh.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/finiteArea/faMesh/faMeshMapper/faPatchMapper.C b/src/finiteArea/faMesh/faMeshMapper/faPatchMapper.C index 43b09850e9..569a2c02f3 100644 --- a/src/finiteArea/faMesh/faMeshMapper/faPatchMapper.C +++ b/src/finiteArea/faMesh/faMeshMapper/faPatchMapper.C @@ -31,6 +31,7 @@ License #include "faMesh.H" #include "mapPolyMesh.H" #include "faceMapper.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C b/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C index 53668ec07a..b05ae98dee 100644 --- a/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C +++ b/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C @@ -33,6 +33,7 @@ License #include "faBoundaryMesh.H" #include "faMesh.H" #include "globalMeshData.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C b/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C index be6d21cc90..2c954b2eea 100644 --- a/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C +++ b/src/finiteArea/faMesh/faPatches/faPatch/faPatch.C @@ -33,6 +33,7 @@ License #include "areaFields.H" #include "edgeFields.H" #include "polyMesh.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/finiteArea/finiteArea/gradSchemes/leastSquaresFaGrad/leastSquaresFaVectors.C b/src/finiteArea/finiteArea/gradSchemes/leastSquaresFaGrad/leastSquaresFaVectors.C index 04e2ad832e..730aeaa699 100644 --- a/src/finiteArea/finiteArea/gradSchemes/leastSquaresFaGrad/leastSquaresFaVectors.C +++ b/src/finiteArea/finiteArea/gradSchemes/leastSquaresFaGrad/leastSquaresFaVectors.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 Wikki Ltd + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +30,7 @@ License #include "edgeFields.H" #include "areaFields.H" #include "mapPolyMesh.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -61,12 +63,8 @@ Foam::leastSquaresFaVectors::~leastSquaresFaVectors() void Foam::leastSquaresFaVectors::makeLeastSquaresVectors() const { - if (debug) - { - Info<< "leastSquaresFaVectors::makeLeastSquaresVectors() :" - << "Constructing finite area least square gradient vectors" - << endl; - } + DebugInFunction + << "Constructing finite area least square gradient vectors" << nl; pVectorsPtr_ = new edgeVectorField ( @@ -213,12 +211,8 @@ void Foam::leastSquaresFaVectors::makeLeastSquaresVectors() const } } - if (debug) - { - Info<< "leastSquaresFaVectors::makeLeastSquaresVectors() :" - << "Finished constructing finite area least square gradient vectors" - << endl; - } + DebugInFunction + << "Done constructing finite area least square gradient vectors" << nl; } @@ -246,11 +240,8 @@ const Foam::edgeVectorField& Foam::leastSquaresFaVectors::nVectors() const bool Foam::leastSquaresFaVectors::movePoints() { - if (debug) - { - InfoIn("bool leastSquaresFaVectors::movePoints()") - << "Clearing least square data" << endl; - } + DebugInFunction + << "Clearing least square data" << nl; deleteDemandDrivenData(pVectorsPtr_); deleteDemandDrivenData(nVectorsPtr_); diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index 1aeeb961e0..1e1b5b6265 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -32,6 +32,7 @@ License #include "extrapolatedCalculatedFvPatchFields.H" #include "coupledFvPatchFields.H" #include "UIndirectList.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMesh/fvMeshMapper/fvPatchMapper.C b/src/finiteVolume/fvMesh/fvMeshMapper/fvPatchMapper.C index 1aa1dca8af..f20ee1c78e 100644 --- a/src/finiteVolume/fvMesh/fvMeshMapper/fvPatchMapper.C +++ b/src/finiteVolume/fvMesh/fvMeshMapper/fvPatchMapper.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,6 +32,7 @@ License #include "fvMesh.H" #include "mapPolyMesh.H" #include "faceMapper.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C b/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C index 0fc3a3115e..a03873f01a 100644 --- a/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C +++ b/src/finiteVolume/fvMesh/fvMeshMapper/fvSurfaceMapper.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -23,15 +24,13 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - FV surface mapper. - \*---------------------------------------------------------------------------*/ #include "fvSurfaceMapper.H" #include "fvMesh.H" #include "mapPolyMesh.H" #include "faceMapper.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/weightedFlux/weightedFlux.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/weightedFlux/weightedFlux.C index 3f09d27bd7..2c05456f9c 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/weightedFlux/weightedFlux.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/weightedFlux/weightedFlux.C @@ -26,6 +26,7 @@ License \*---------------------------------------------------------------------------*/ #include "weightedFlux.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // diff --git a/src/meshTools/twoDPointCorrector/twoDPointCorrector.C b/src/meshTools/twoDPointCorrector/twoDPointCorrector.C index 5ad768485a..29fcae294f 100644 --- a/src/meshTools/twoDPointCorrector/twoDPointCorrector.C +++ b/src/meshTools/twoDPointCorrector/twoDPointCorrector.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -32,6 +32,7 @@ License #include "emptyPolyPatch.H" #include "SubField.H" #include "meshTools.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/ISAT.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/ISAT.C index fba683dfd3..4164a3cab1 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/ISAT.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/ISAT.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,6 +28,7 @@ License #include "ISAT.H" #include "LUscalarMatrix.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryTree/binaryTree.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryTree/binaryTree.C index 5ec78f440b..3455b29606 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryTree/binaryTree.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/ISAT/binaryTree/binaryTree.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,6 +28,7 @@ License #include "binaryTree.H" #include "SortableList.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // diff --git a/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C b/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C index b43173f6c7..688ddc4af5 100644 --- a/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C +++ b/src/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C @@ -33,6 +33,7 @@ License #include "addToRunTimeSelectionTable.H" #include "mapPolyMesh.H" #include "unitConversion.H" +#include "demandDrivenData.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // From 8a5d108fd20300dadcd088644260828896d95ed7 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 30 Apr 2020 12:46:00 +0200 Subject: [PATCH 2/2] STYLE: update PrimitivePatch (#1648) - simplified templating, which cleans up code and does not appear to break any normal user coding. ENH: unique_ptr instead of homegrown demand-driven handling. --- .../test/primitivePatch/Test-PrimitivePatch.C | 2 +- .../extrudeMesh/extrudedMesh/extrudedMesh.H | 19 +- .../extrudedMesh/extrudedMeshTemplates.C | 27 +- .../backgroundMeshDecomposition.H | 2 +- .../automatic/automatic.C | 4 +- .../nonUniformField/nonUniformField.H | 6 +- .../primitiveMesh/PatchTools/PatchTools.H | 154 ++------ .../PatchTools/PatchToolsCheck.C | 20 +- .../PatchTools/PatchToolsEdgeOwner.C | 24 +- .../PatchTools/PatchToolsGatherAndMerge.C | 49 +-- .../PatchTools/PatchToolsMatch.C | 30 +- .../PatchTools/PatchToolsNormals.C | 29 +- .../PatchTools/PatchToolsSearch.C | 47 +-- .../PatchTools/PatchToolsSortEdges.C | 20 +- .../PatchTools/PatchToolsSortPoints.C | 12 +- .../PrimitivePatch/PrimitivePatch.C | 362 ++++++------------ .../PrimitivePatch/PrimitivePatch.H | 115 +++--- .../PrimitivePatch/PrimitivePatchAddressing.C | 51 +-- .../PrimitivePatch/PrimitivePatchBdryPoints.C | 24 +- .../PrimitivePatch/PrimitivePatchCheck.C | 68 +--- .../PrimitivePatch/PrimitivePatchClear.C | 105 ++--- .../PrimitivePatch/PrimitivePatchEdgeLoops.C | 40 +- .../PrimitivePatchLocalPointOrder.C | 24 +- .../PrimitivePatch/PrimitivePatchMeshData.C | 199 ++++------ .../PrimitivePatch/PrimitivePatchMeshEdges.C | 52 +-- .../PrimitivePatchPointAddressing.C | 53 +-- .../PrimitivePatchProjectPoints.C | 58 ++- .../primitivePatch/indirectPrimitivePatch.H | 2 +- .../primitivePatch/primitiveFacePatch.H | 2 +- .../primitivePatch/primitivePatch.H | 2 +- .../primitivePatch/uindirectPrimitivePatch.H | 2 +- src/dynamicMesh/boundaryMesh/bMesh.H | 3 +- .../pairPatchAgglomeration.H | 4 +- .../extendedEdgeMesh/extendedEdgeMesh.C | 2 +- .../extendedEdgeMesh/extendedEdgeMesh.H | 2 +- .../extendedFeatureEdgeMesh.C | 3 +- .../extendedFeatureEdgeMesh.H | 2 +- .../triSurfaceMesh/triSurfaceMesh.C | 2 +- .../triSurfaceSearch/triSurfaceRegionSearch.H | 11 +- src/surfMesh/MeshedSurface/MeshedSurface.H | 4 +- src/surfMesh/polySurface/polySurface.H | 4 +- src/surfMesh/surfMesh/surfMesh.H | 4 +- .../surfaceFormats/ac3d/AC3DsurfaceFormat.C | 22 +- src/surfMesh/triSurface/triSurface.H | 4 +- 44 files changed, 553 insertions(+), 1118 deletions(-) diff --git a/applications/test/primitivePatch/Test-PrimitivePatch.C b/applications/test/primitivePatch/Test-PrimitivePatch.C index 1f947f394c..a74deb4bdf 100644 --- a/applications/test/primitivePatch/Test-PrimitivePatch.C +++ b/applications/test/primitivePatch/Test-PrimitivePatch.C @@ -249,7 +249,7 @@ int main(int argc, char *argv[]) faceList patchFaces(patch); pointField allPoints(patch.points()); - PrimitivePatch storedPatch + PrimitivePatch, pointField> storedPatch ( patchFaces, allPoints, diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H index 9899c700f2..ae9d8e0590 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2015 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -53,7 +54,7 @@ class extrudedMesh : public polyMesh { - // Private data + // Private Data const extrudeModel& model_; @@ -64,26 +65,26 @@ class extrudedMesh static bool sameOrder(const face&, const edge&); //- Construct and return the extruded mesh points - template class FaceList, class PointField> + template pointField extrudedPoints ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& ); //- Construct and return the extruded mesh faces - template class FaceList, class PointField> + template faceList extrudedFaces ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& ); //- Construct and return the extruded mesh cells - template class FaceList, class PointField> + template cellList extrudedCells ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& ); @@ -100,11 +101,11 @@ public: // Constructors //- Construct from the primitivePatch to extrude - template class FaceList, class PointField> + template extrudedMesh ( const IOobject&, - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& ); }; diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMeshTemplates.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMeshTemplates.C index a2b2058061..0671cd12fc 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMeshTemplates.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMeshTemplates.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2012 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,15 +31,10 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -template -< - class Face, - template class FaceList, - class PointField -> +template Foam::pointField Foam::extrudedMesh::extrudedPoints ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& model ) { @@ -68,10 +64,10 @@ Foam::pointField Foam::extrudedMesh::extrudedPoints } -template class FaceList, class PointField> +template Foam::faceList Foam::extrudedMesh::extrudedFaces ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& model ) { @@ -194,10 +190,10 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces } -template class FaceList, class PointField> +template Foam::cellList Foam::extrudedMesh::extrudedCells ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& model ) { @@ -302,16 +298,11 @@ Foam::cellList Foam::extrudedMesh::extrudedCells // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -< - class Face, - template class FaceList, - class PointField -> +template Foam::extrudedMesh::extrudedMesh ( const IOobject& io, - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& model ) : diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H index e8603d1d45..c0dbded989 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H @@ -81,7 +81,7 @@ SourceFiles namespace Foam { -typedef PrimitivePatch bPatch; +typedef PrimitivePatch<::Foam::List, const pointField> bPatch; typedef treeDataPrimitivePatch treeDataBPatch; class Time; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C index 778882f08c..3b50972776 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -199,7 +199,7 @@ Foam::tmp Foam::automatic::load() PrimitivePatchInterpolation < - PrimitivePatch + PrimitivePatch<::Foam::List, pointField> > patchInterpolate(surface_); const Map