diff --git a/src/OpenFOAM/interpolations/patchToPatchInterpolation/patchToPatchInterpolation.H b/src/OpenFOAM/interpolations/patchToPatchInterpolation/patchToPatchInterpolation.H index 0443e08b9696efccbcad18a1c408b7e88f29d2b6..34fde341e379c13f36e6e7d62b8e9baf3fa1867d 100644 --- a/src/OpenFOAM/interpolations/patchToPatchInterpolation/patchToPatchInterpolation.H +++ b/src/OpenFOAM/interpolations/patchToPatchInterpolation/patchToPatchInterpolation.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -23,26 +24,26 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. +Typedef + Foam::patchToPatchInterpolation + +Description + Foam::patchToPatchInterpolation + \*---------------------------------------------------------------------------*/ #ifndef patchToPatchInterpolation_H #define patchToPatchInterpolation_H #include "PatchToPatchInterpolation.H" -#include "PrimitivePatch.H" -#include "face.H" -#include "SubList.H" -#include "pointField.H" +#include "primitivePatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef PatchToPatchInterpolation - < - PrimitivePatch<face, SubList, const pointField&>, - PrimitivePatch<face, SubList, const pointField&> - > patchToPatchInterpolation; + typedef PatchToPatchInterpolation<primitivePatch, primitivePatch> + patchToPatchInterpolation; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C index a7597b5e60d55e3d55774aca80b51adce6ee2aa4..ccc578f7a1cc27a1aa78673b86cac5ad576d2f0b 100644 --- a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C +++ b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C @@ -64,7 +64,7 @@ void PrimitivePatchInterpolation<Patch>::makeFaceToPointWeights() const const List<typename Patch::face_type>& faces = patch_.localFaces(); faceToPointWeightsPtr_ = new scalarListList(points.size()); - scalarListList& weights = *faceToPointWeightsPtr_; + auto& weights = *faceToPointWeightsPtr_; // get reference to addressing const labelListList& pointFaces = patch_.pointFaces(); @@ -122,7 +122,7 @@ void PrimitivePatchInterpolation<Patch>::makeFaceToEdgeWeights() const const labelListList& edgeFaces = patch_.edgeFaces(); faceToEdgeWeightsPtr_ = new scalarList(patch_.nInternalEdges()); - scalarList& weights = *faceToEdgeWeightsPtr_; + auto& weights = *faceToEdgeWeightsPtr_; forAll(weights, edgei) { @@ -301,12 +301,8 @@ tmp<Field<Type>> PrimitivePatchInterpolation<Patch>::faceToEdgeInterpolate << abort(FatalError); } - tmp<Field<Type>> tresult - ( - new Field<Type>(patch_.nEdges(), Zero) - ); - - Field<Type>& result = tresult.ref(); + auto tresult = tmp<Field<Type>>::New(patch_.nEdges(), Zero); + auto& result = tresult.ref(); const edgeList& edges = patch_.edges(); const labelListList& edgeFaces = patch_.edgeFaces(); diff --git a/src/OpenFOAM/interpolations/primitivePatchInterpolation/primitivePatchInterpolation.H b/src/OpenFOAM/interpolations/primitivePatchInterpolation/primitivePatchInterpolation.H index 814f75d4503340759bd041e2e539b4a59c35e691..93f26a19221f9c882c7508afae98574632cddb89 100644 --- a/src/OpenFOAM/interpolations/primitivePatchInterpolation/primitivePatchInterpolation.H +++ b/src/OpenFOAM/interpolations/primitivePatchInterpolation/primitivePatchInterpolation.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,19 +36,14 @@ Description #define primitivePatchInterpolation_H #include "PrimitivePatchInterpolation.H" -#include "PrimitivePatch.H" -#include "face.H" -#include "SubList.H" -#include "pointField.H" +#include "primitivePatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef PrimitivePatchInterpolation - < - PrimitivePatch<face, SubList, const pointField&> - > primitivePatchInterpolation; + typedef PrimitivePatchInterpolation<primitivePatch> + primitivePatchInterpolation; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/indirectPrimitivePatch.H b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/indirectPrimitivePatch.H index 9c2bd3e3dabe5e0a668b28d3b75ca674a7246887..a170f8cfd5104586eb9dc94be1e917e0a0532f8c 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/indirectPrimitivePatch.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/indirectPrimitivePatch.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,7 +28,8 @@ Typedef Foam::indirectPrimitivePatch Description - A PrimitivePatch using an IndirectList for the faces. + A PrimitivePatch with an IndirectList for the faces, const reference + for the point field. \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitiveFacePatch.H b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitiveFacePatch.H index a072d7547662ef0f05f6c07badb8e69fa32e40ad..0406e4cbc1050eb0bf3a4ed5a2e906fbd8a7fc27 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitiveFacePatch.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitiveFacePatch.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,7 +28,10 @@ Typedef Foam::primitiveFacePatch Description - Foam::primitiveFacePatch + A PrimitivePatch with List storage for the faces, + const reference for the point field. + + Can be used to store faces. \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitivePatch.H b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitivePatch.H index a3e116da17e716131b51b7d109f60f78d7878556..2b78ffc6378e0992c175da9b1d986a72f573e7f7 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitivePatch.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/primitivePatch.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,7 +28,10 @@ Typedef Foam::primitivePatch Description - Addressing for a faceList slice. + A PrimitivePatch with a SubList addressing for the faces, + const reference for the point field. + + Can be used as addressing for a faceList slice. \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/uindirectPrimitivePatch.H b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/uindirectPrimitivePatch.H index 236fffcbae1a0a7ecceb13a771d18681cdc4da10..4c5ca8a6a340b6703118454252af018f56a00513 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/uindirectPrimitivePatch.H +++ b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/uindirectPrimitivePatch.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,7 +28,8 @@ Typedef Foam::uindirectPrimitivePatch Description - A PrimitivePatch using a UIndirectList for the faces. + A PrimitivePatch with UIndirectList for the faces, const reference + for the point field. \*---------------------------------------------------------------------------*/ diff --git a/src/dynamicMesh/boundaryMesh/boundaryMesh.C b/src/dynamicMesh/boundaryMesh/boundaryMesh.C index 99da7db4530691ece2d198d03b25042e4a07b12d..7df285f68a0eccba7b347a43f9373514abb29a1f 100644 --- a/src/dynamicMesh/boundaryMesh/boundaryMesh.C +++ b/src/dynamicMesh/boundaryMesh/boundaryMesh.C @@ -36,6 +36,7 @@ License #include "triSurface.H" #include "SortableList.H" #include "OFstream.H" +#include "primitiveFacePatch.H" #include "uindirectPrimitivePatch.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -538,11 +539,7 @@ void Foam::boundaryMesh::read(const polyMesh& mesh) // // Temporary primitivePatch to calculate compact points & faces. - PrimitivePatch<face, List, const pointField&> globalPatch - ( - bFaces, - mesh.points() - ); + primitiveFacePatch globalPatch(bFaces, mesh.points()); // Store in local(compact) addressing clearOut(); diff --git a/src/dynamicMesh/boundaryMesh/boundaryMesh.H b/src/dynamicMesh/boundaryMesh/boundaryMesh.H index e2096828b5cbe0218dccf9721149cded6ff375bd..c7602a7e9dde811ae358dc312f5f65bb37c62c52 100644 --- a/src/dynamicMesh/boundaryMesh/boundaryMesh.H +++ b/src/dynamicMesh/boundaryMesh/boundaryMesh.H @@ -50,7 +50,7 @@ SourceFiles namespace Foam { -// Forward declaration of classes +// Forward Declarations class Time; class polyMesh; class primitiveMesh; @@ -61,7 +61,7 @@ class primitiveMesh; class boundaryMesh { - // Static data + // Static Data //- Normal along which to divide faces into categories // (used in getNearest) @@ -73,7 +73,7 @@ class boundaryMesh static const scalar distanceTol_; - // Private data + // Private Data //- All boundary mesh data. Reconstructed every time faces are repatched bMesh* meshPtr_; diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIPatchToPatchInterpolation.H b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIPatchToPatchInterpolation.H index 4108f54300774a88f66842f636cb3f71e89a70da..c11f82dc3a0f5295149eebd85bfa8e5f8bd7c062 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIPatchToPatchInterpolation.H +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIPatchToPatchInterpolation.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,20 +30,14 @@ License #define AMIPatchToPatchInterpolation_H #include "AMIInterpolation.H" -#include "PrimitivePatch.H" -#include "face.H" -#include "SubList.H" -#include "pointField.H" +#include "primitivePatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef AMIInterpolation - < - PrimitivePatch<face, SubList, const pointField&>, - PrimitivePatch<face, SubList, const pointField&> - > AMIPatchToPatchInterpolation; + typedef AMIInterpolation<primitivePatch, primitivePatch> + AMIPatchToPatchInterpolation; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //