diff --git a/src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.C b/src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.C index 274549fb3c..26f6241d5f 100644 --- a/src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.C +++ b/src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.C @@ -72,12 +72,6 @@ Foam::patchIdentifier::patchIdentifier {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::patchIdentifier::~patchIdentifier() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::patchIdentifier::inGroup(const word& name) const diff --git a/src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.H b/src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.H index 760744a87e..902cbd8b10 100644 --- a/src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.H +++ b/src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.H @@ -43,10 +43,8 @@ SourceFiles namespace Foam { +// Forward declarations class dictionary; - -// Forward declaration of friend functions and operators - class patchIdentifier; Ostream& operator<<(Ostream& os, const patchIdentifier& p); @@ -92,7 +90,7 @@ public: const label index ); - //- Copy construct from geometric patch, resetting the index + //- Copy construct, resetting the index patchIdentifier ( const patchIdentifier& p, @@ -101,7 +99,7 @@ public: //- Destructor - virtual ~patchIdentifier(); + virtual ~patchIdentifier() = default; // Member Functions diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index 4b987064da..c83897b724 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,7 +37,7 @@ License namespace Foam { -defineTypeNameAndDebug(polyBoundaryMesh, 0); + defineTypeNameAndDebug(polyBoundaryMesh, 0); } @@ -220,11 +220,11 @@ void Foam::polyBoundaryMesh::calcGeometry() // Dummy. pBufs.finishedSends(); - forAll(patchSchedule, patchEvali) + for (const auto& patchEval : patchSchedule) { - const label patchi = patchSchedule[patchEvali].patch; + const label patchi = patchEval.patch; - if (patchSchedule[patchEvali].init) + if (patchEval.init) { operator[](patchi).initGeometry(pBufs); } @@ -260,10 +260,8 @@ Foam::polyBoundaryMesh::neighbourEdges() const neighbourEdges[patchi].setSize(pp.nEdges() - pp.nInternalEdges()); - forAll(neighbourEdges[patchi], i) + for (labelPair& edgeInfo : neighbourEdges[patchi]) { - labelPair& edgeInfo = neighbourEdges[patchi][i]; - edgeInfo[0] = -1; edgeInfo[1] = -1; } @@ -349,12 +347,12 @@ Foam::polyBoundaryMesh::neighbourEdges() const if (edgeInfo[0] == -1 || edgeInfo[1] == -1) { - label edgeI = pp.nInternalEdges() + i; - const edge& e = pp.edges()[edgeI]; + const label edgei = pp.nInternalEdges() + i; + const edge& e = pp.edges()[edgei]; FatalErrorInFunction << "Not all boundary edges of patches match up." << nl - << "Edge " << edgeI << " on patch " << pp.name() + << "Edge " << edgei << " on patch " << pp.name() << " end points " << pp.localPoints()[e[0]] << ' ' << pp.localPoints()[e[1]] << " is not matched to an" << " edge on any other patch." << nl @@ -375,23 +373,20 @@ const Foam::labelList& Foam::polyBoundaryMesh::patchID() const { patchIDPtr_.reset ( - new labelList - ( - mesh_.nFaces() - - mesh_.nInternalFaces() - ) + new labelList(mesh_.nFaces() - mesh_.nInternalFaces()) ); - labelList& patchID = patchIDPtr_(); + labelList& list = *patchIDPtr_; - const polyBoundaryMesh& bm = *this; + const polyPatchList& patches = *this; - forAll(bm, patchi) + forAll(patches, patchi) { - label bFacei = bm[patchi].start() - mesh_.nInternalFaces(); - forAll(bm[patchi], i) - { - patchID[bFacei++] = patchi; - } + SubList