diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index cbfa048359..d390deae03 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -810,7 +810,7 @@ meshes/preservePatchTypes/preservePatchTypes.C interpolations = interpolations interpolation = $(interpolations)/interpolation -$(interpolations)/patchToPatchInterpolation/PatchToPatchInterpolationName.C +$(interpolations)/patchToPatchInterpolation/PatchToPatchInterpolationBase.C $(interpolations)/interpolationTable/tableReaders/tableReaders.C $(interpolations)/interpolationTable/tableReaders/openFoam/openFoamTableReaders.C diff --git a/src/OpenFOAM/db/typeInfo/className.H b/src/OpenFOAM/db/typeInfo/className.H index 0fdd8cb3ff..f74f66fa38 100644 --- a/src/OpenFOAM/db/typeInfo/className.H +++ b/src/OpenFOAM/db/typeInfo/className.H @@ -55,7 +55,7 @@ Description class TemplateNameString##Name \ { \ public: \ - TemplateNameString##Name() {} \ + TemplateNameString##Name() noexcept = default; \ ClassNameNoDebug(#TemplateNameString); \ } @@ -81,7 +81,7 @@ public: \ class TemplateNameString##Name \ { \ public: \ - TemplateNameString##Name() {} \ + TemplateNameString##Name() noexcept = default; \ ClassName(#TemplateNameString); \ } diff --git a/src/OpenFOAM/interpolations/patchToPatchInterpolation/CalcPatchToPatchWeights.C b/src/OpenFOAM/interpolations/patchToPatchInterpolation/CalcPatchToPatchWeights.C index af6065d838..f21b82f00a 100644 --- a/src/OpenFOAM/interpolations/patchToPatchInterpolation/CalcPatchToPatchWeights.C +++ b/src/OpenFOAM/interpolations/patchToPatchInterpolation/CalcPatchToPatchWeights.C @@ -35,12 +35,6 @@ License namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -template -scalar PatchToPatchInterpolation::projectionTol_ = 0.05; - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template @@ -48,15 +42,14 @@ void PatchToPatchInterpolation::calcPointAddressing() const { // Calculate pointWeights - pointWeightsPtr_ = new FieldField(toPatch_.nPoints()); - FieldField& pointWeights = *pointWeightsPtr_; + pointWeightsPtr_.reset(new FieldField(toPatch_.nPoints())); + auto& pointWeights = *pointWeightsPtr_; - pointDistancePtr_ = new scalarField(toPatch_.nPoints(), GREAT); - scalarField& pointDistance = *pointDistancePtr_; + pointDistancePtr_.reset(new scalarField(toPatch_.nPoints(), GREAT)); + auto& pointDistance = *pointDistancePtr_; const pointField& fromPatchPoints = fromPatch_.localPoints(); - const List& fromPatchFaces = - fromPatch_.localFaces(); + const auto& fromPatchFaces = fromPatch_.localFaces(); const pointField& toPatchPoints = toPatch_.localPoints(); const vectorField& projectionDirection = toPatch_.pointNormals(); @@ -71,8 +64,8 @@ void PatchToPatchInterpolation::calcPointAddressing() const List proj = toPatch_.projectPoints(fromPatch_, projectionDirection, alg_, dir_); - pointAddressingPtr_ = new labelList(proj.size(), -1); - labelList& pointAddressing = *pointAddressingPtr_; + pointAddressingPtr_.reset(new labelList(proj.size(), -1)); + auto& pointAddressing = *pointAddressingPtr_; bool doWeights = false; @@ -80,8 +73,7 @@ void PatchToPatchInterpolation::calcPointAddressing() const { doWeights = false; - const typename FromPatch::face_type& hitFace = - fromPatchFaces[proj[pointi].hitObject()]; + const auto& hitFace = fromPatchFaces[proj[pointi].hitObject()]; point hitPoint = Zero; @@ -229,7 +221,7 @@ void PatchToPatchInterpolation::calcPointAddressing() const } else { - pointWeights.set(pointi, new scalarField(0)); + pointWeights.set(pointi, new scalarField()); } } } @@ -238,11 +230,11 @@ void PatchToPatchInterpolation::calcPointAddressing() const template void PatchToPatchInterpolation::calcFaceAddressing() const { - faceWeightsPtr_ = new FieldField(toPatch_.size()); - FieldField& faceWeights = *faceWeightsPtr_; + faceWeightsPtr_.reset(new FieldField(toPatch_.size())); + auto& faceWeights = *faceWeightsPtr_; - faceDistancePtr_ = new scalarField(toPatch_.size(), GREAT); - scalarField& faceDistance = *faceDistancePtr_; + faceDistancePtr_.reset(new scalarField(toPatch_.size(), GREAT)); + auto& faceDistance = *faceDistancePtr_; if (debug) { @@ -250,7 +242,7 @@ void PatchToPatchInterpolation::calcFaceAddressing() const } const pointField& fromPatchPoints = fromPatch_.points(); - const typename FromPatch::FaceListType& fromPatchFaces = fromPatch_; + const auto& fromPatchFaces = fromPatch_; const labelListList& fromPatchFaceFaces = fromPatch_.faceFaces(); vectorField fromPatchFaceCentres(fromPatchFaces.size()); @@ -262,7 +254,7 @@ void PatchToPatchInterpolation::calcFaceAddressing() const } const pointField& toPatchPoints = toPatch_.points(); - const typename ToPatch::FaceListType& toPatchFaces = toPatch_; + const auto& toPatchFaces = toPatch_; const vectorField& projectionDirection = toPatch_.faceNormals(); @@ -275,8 +267,8 @@ void PatchToPatchInterpolation::calcFaceAddressing() const dir_ ); - faceAddressingPtr_ = new labelList(proj.size(), -1); - labelList& faceAddressing = *faceAddressingPtr_; + faceAddressingPtr_.reset(new labelList(proj.size(), -1)); + auto& faceAddressing = *faceAddressingPtr_; forAll(faceAddressing, facei) { @@ -285,8 +277,7 @@ void PatchToPatchInterpolation::calcFaceAddressing() const // A hit exists faceAddressing[facei] = proj[facei].hitObject(); - const typename FromPatch::face_type& hitFace = - fromPatchFaces[faceAddressing[facei]]; + const auto& hitFace = fromPatchFaces[faceAddressing[facei]]; pointHit curHit = hitFace.ray @@ -349,7 +340,7 @@ void PatchToPatchInterpolation::calcFaceAddressing() const } else { - faceWeights.set(facei, new scalarField(0)); + faceWeights.set(facei, new scalarField()); } } } diff --git a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolate.C b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolate.C index 7cbf11f3f7..d783737831 100644 --- a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolate.C +++ b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolate.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,15 +52,10 @@ PatchToPatchInterpolation::pointInterpolate << abort(FatalError); } - tmp> tresult - ( - new Field(toPatch_.nPoints(), Zero) - ); + auto tresult = tmp>::New(toPatch_.nPoints(), Zero); + auto& result = tresult.ref(); - Field& result = tresult.ref(); - - const List& fromPatchLocalFaces = - fromPatch_.localFaces(); + const auto& fromPatchLocalFaces = fromPatch_.localFaces(); const FieldField& weights = pointWeights(); @@ -116,12 +111,8 @@ PatchToPatchInterpolation::faceInterpolate << abort(FatalError); } - tmp> tresult - ( - new Field(toPatch_.size(), Zero) - ); - - Field& result = tresult.ref(); + auto tresult = tmp>::New(toPatch_.size(), Zero); + auto& result = tresult.ref(); const labelListList& fromPatchFaceFaces = fromPatch_.faceFaces(); diff --git a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C index 5cf85c6af0..e6f4a466b1 100644 --- a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C +++ b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,19 +27,12 @@ License \*---------------------------------------------------------------------------*/ #include "PatchToPatchInterpolation.H" -#include "demandDrivenData.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -template -const scalar -PatchToPatchInterpolation::directHitTol = 1e-5; - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template @@ -96,12 +90,12 @@ PatchToPatchInterpolation::faceWeights() const template void PatchToPatchInterpolation::clearOut() { - deleteDemandDrivenData(pointAddressingPtr_); - deleteDemandDrivenData(pointWeightsPtr_); - deleteDemandDrivenData(pointDistancePtr_); - deleteDemandDrivenData(faceAddressingPtr_); - deleteDemandDrivenData(faceWeightsPtr_); - deleteDemandDrivenData(faceDistancePtr_); + pointAddressingPtr_.reset(nullptr); + pointWeightsPtr_.reset(nullptr); + pointDistancePtr_.reset(nullptr); + faceAddressingPtr_.reset(nullptr); + faceWeightsPtr_.reset(nullptr); + faceDistancePtr_.reset(nullptr); } diff --git a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.H b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.H index 3c847c1038..134e648446 100644 --- a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.H +++ b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,8 +38,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef PatchToPatchInterpolation_H -#define PatchToPatchInterpolation_H +#ifndef Foam_PatchToPatchInterpolation_H +#define Foam_PatchToPatchInterpolation_H #include "className.H" #include "labelList.H" @@ -54,10 +55,55 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class PatchToPatchInterpolationName Declaration + Class PatchToPatchInterpolationBase Declaration \*---------------------------------------------------------------------------*/ -TemplateName(PatchToPatchInterpolation); +class PatchToPatchInterpolationBase +{ +protected: + + // Protected Static Data + + //- Relative merge tolerance for projected points missing the target + // Expressed as the fraction of min involved edge size + static scalar projectionTol_; + + //- Direct hit tolerance + static const scalar directHitTol; + + +public: + + //- Runtime type information + ClassName("PatchToPatchInterpolation"); + + + // Constructors + + //- Default construct + PatchToPatchInterpolationBase() noexcept = default; + + + // Member Functions + + //- Access to projection tolerance + static scalar projectionTol() noexcept + { + return projectionTol_; + } + + //- Change propagation tolerance, return previous value + static scalar setProjectionTol(const scalar tol) + { + if (tol < -VSMALL) + { + FatalErrorInFunction << abort(FatalError); + } + scalar old(projectionTol_); + projectionTol_ = tol; + return old; + } +}; /*---------------------------------------------------------------------------*\ @@ -67,9 +113,9 @@ TemplateName(PatchToPatchInterpolation); template class PatchToPatchInterpolation : - public PatchToPatchInterpolationName + public PatchToPatchInterpolationBase { - // Private data + // Private Data //- Reference to the source patch const FromPatch& fromPatch_; @@ -84,34 +130,28 @@ class PatchToPatchInterpolation intersection::direction dir_; - // Static data + // Point Addressing - //- Relative merge tolerance for projected points missing the target - // Expressed as the fraction of min involved edge size - static scalar projectionTol_; + //- Face into which each point of target patch is projected + mutable std::unique_ptr pointAddressingPtr_; + + //- Weighting factors + mutable std::unique_ptr> pointWeightsPtr_; + + //- Distance to intersection for patch points + mutable std::unique_ptr pointDistancePtr_; - // Point addressing + // Face Addressing - //- Face into which each point of target patch is projected - mutable labelList* pointAddressingPtr_; + //- Face into which each face centre of target patch is projected + mutable std::unique_ptr faceAddressingPtr_; - //- Weighting factors - mutable FieldField* pointWeightsPtr_; + //- Weighting factors + mutable std::unique_ptr> faceWeightsPtr_; - //- Distance to intersection for patch points - mutable scalarField* pointDistancePtr_; - - // Face addressing - - //- Face into which each face centre of target patch is projected - mutable labelList* faceAddressingPtr_; - - //- Weighting factors - mutable FieldField* faceWeightsPtr_; - - //- Distance to intersection for patch face centres - mutable scalarField* faceDistancePtr_; + //- Distance to intersection for patch face centres + mutable std::unique_ptr faceDistancePtr_; // Private Member Functions @@ -145,12 +185,6 @@ class PatchToPatchInterpolation const FieldField& faceWeights() const; - // Private static data members - - //- Direct hit tolerance - static const scalar directHitTol; - - public: // Constructors @@ -171,21 +205,6 @@ public: // Member Functions - //- Set the projection tolerance, returning the previous value - static scalar setProjectionTol(const scalar t) - { - if (t < -VSMALL) - { - FatalErrorInFunction - << abort(FatalError); - } - - scalar oldTol = projectionTol_; - projectionTol_ = t; - - return oldTol; - } - //- Return ype of intersection algorithm to use in projection intersection::algorithm projectionAlgo() const { diff --git a/src/meshTools/algorithms/PointEdgeWave/PointEdgeWaveName.C b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolationBase.C similarity index 85% rename from src/meshTools/algorithms/PointEdgeWave/PointEdgeWaveName.C rename to src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolationBase.C index 7c8b972825..71b4f5ef54 100644 --- a/src/meshTools/algorithms/PointEdgeWave/PointEdgeWaveName.C +++ b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolationBase.C @@ -25,14 +25,19 @@ License \*---------------------------------------------------------------------------*/ -#include "PointEdgeWave.H" +#include "PatchToPatchInterpolation.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(PointEdgeWaveName, 0); + defineTypeNameAndDebug(PatchToPatchInterpolationBase, 0); } +Foam::scalar Foam::PatchToPatchInterpolationBase::projectionTol_ = 0.05; + +const Foam::scalar Foam::PatchToPatchInterpolationBase::directHitTol = 1e-5; + + // ************************************************************************* // diff --git a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolationName.C b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolationName.C deleted file mode 100644 index 04e9466edb..0000000000 --- a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolationName.C +++ /dev/null @@ -1,38 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | www.openfoam.com - \\/ M anipulation | -------------------------------------------------------------------------------- - Copyright (C) 2011-2012 OpenFOAM Foundation -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "PatchToPatchInterpolation.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -defineTypeNameAndDebug(PatchToPatchInterpolationName, 0); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBase.H b/src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBase.H index b36df15cce..6047d77e2f 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBase.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBase.H @@ -33,8 +33,8 @@ Description \*---------------------------------------------------------------------------*/ -#ifndef blendedSchemeBase_H -#define blendedSchemeBase_H +#ifndef Foam_blendedSchemeBase_H +#define Foam_blendedSchemeBase_H #include "className.H" #include "tmp.H" @@ -57,12 +57,10 @@ class blendedSchemeBase : public blendedSchemeBaseName { - public: //- Constructor - blendedSchemeBase() - {} + blendedSchemeBase() = default; //- Destructor virtual ~blendedSchemeBase() = default; diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index 393e081018..116463e51c 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -69,19 +69,19 @@ meshTools/meshTools.C algorithms = algorithms pWave = $(algorithms)/PointEdgeWave -$(pWave)/PointEdgeWaveName.C +$(pWave)/PointEdgeWaveBase.C $(pWave)/pointEdgePoint.C patchWave = $(algorithms)/PatchEdgeFaceWave -$(patchWave)/PatchEdgeFaceWaveName.C +$(patchWave)/PatchEdgeFaceWaveBase.C $(patchWave)/patchEdgeFaceInfo.C $(patchWave)/patchPatchDist.C $(patchWave)/patchEdgeFaceRegions.C meshWave = $(algorithms)/MeshWave -$(meshWave)/MeshWaveName.C -$(meshWave)/FaceCellWaveName.C +$(meshWave)/MeshWaveBase.C +$(meshWave)/FaceCellWaveBase.C regionSplit/regionSplit.C @@ -90,7 +90,7 @@ regionSplit/localPointRegion.C regionSplit2D/regionSplit2D.C indexedOctree/treeDataFace.C -indexedOctree/treeDataPrimitivePatchName.C +indexedOctree/treeDataPrimitivePatchBase.C indexedOctree/treeDataTriSurface.C diff --git a/src/meshTools/algorithms/MeshWave/FaceCellWave.C b/src/meshTools/algorithms/MeshWave/FaceCellWave.C index 04a7865b80..92ad54e4d0 100644 --- a/src/meshTools/algorithms/MeshWave/FaceCellWave.C +++ b/src/meshTools/algorithms/MeshWave/FaceCellWave.C @@ -41,16 +41,6 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template -const Foam::scalar Foam::FaceCellWave::geomTol_ = 1e-6; - -template -Foam::scalar Foam::FaceCellWave::propagationTol_ = 0.01; - -template -int Foam::FaceCellWave::dummyTrackData_ = 12345; - - namespace Foam { template @@ -145,7 +135,7 @@ bool Foam::FaceCellWave::updateCell { if (changedCell_.set(celli)) { - changedCells_.append(celli); + changedCells_.push_back(celli); } } @@ -193,7 +183,7 @@ bool Foam::FaceCellWave::updateFace { if (changedFace_.set(facei)) { - changedFaces_.append(facei); + changedFaces_.push_back(facei); } } @@ -239,7 +229,7 @@ bool Foam::FaceCellWave::updateFace { if (changedFace_.set(facei)) { - changedFaces_.append(facei); + changedFaces_.push_back(facei); } } @@ -333,7 +323,7 @@ void Foam::FaceCellWave::setFaceInfo // Mark facei as visited and changed (both on list and on face itself) changedFace_.set(facei); - changedFaces_.append(facei); + changedFaces_.push_back(facei); } @@ -361,7 +351,7 @@ void Foam::FaceCellWave::setFaceInfo // Mark facei as changed, both on list and on face itself. changedFace_.set(facei); - changedFaces_.append(facei); + changedFaces_.push_back(facei); } } @@ -840,13 +830,13 @@ void Foam::FaceCellWave::handleExplicitConnections() if (changedFace_.test(f0)) { // f0 changed. Update information on f1. - changedBaffles_.append(taggedInfoType(f1, allFaceInfo_[f0])); + changedBaffles_.push_back(taggedInfoType(f1, allFaceInfo_[f0])); } if (changedFace_.test(f1)) { // f1 changed. Update information on f0. - changedBaffles_.append(taggedInfoType(f0, allFaceInfo_[f1])); + changedBaffles_.push_back(taggedInfoType(f0, allFaceInfo_[f1])); } } @@ -887,24 +877,19 @@ Foam::FaceCellWave::FaceCellWave TrackingData& td ) : - mesh_(mesh), + FaceCellWaveBase(mesh), + explicitConnections_(), allFaceInfo_(allFaceInfo), allCellInfo_(allCellInfo), td_(td), - changedFace_(mesh_.nFaces(), false), - changedCell_(mesh_.nCells(), false), - changedFaces_(mesh_.nFaces()), - changedCells_(mesh_.nCells()), changedBaffles_(2*explicitConnections_.size()), hasCyclicPatches_(hasPatch()), hasCyclicAMIPatches_ ( returnReduceOr(hasPatch()) ), - nEvals_(0), - nUnvisitedCells_(mesh_.nCells()), - nUnvisitedFaces_(mesh_.nFaces()) + nEvals_(0) { if ( @@ -935,24 +920,19 @@ Foam::FaceCellWave::FaceCellWave TrackingData& td ) : - mesh_(mesh), + FaceCellWaveBase(mesh), + explicitConnections_(), allFaceInfo_(allFaceInfo), allCellInfo_(allCellInfo), td_(td), - changedFace_(mesh_.nFaces(), false), - changedCell_(mesh_.nCells(), false), - changedFaces_(mesh_.nFaces()), - changedCells_(mesh_.nCells()), changedBaffles_(2*explicitConnections_.size()), hasCyclicPatches_(hasPatch()), hasCyclicAMIPatches_ ( returnReduceOr(hasPatch()) ), - nEvals_(0), - nUnvisitedCells_(mesh_.nCells()), - nUnvisitedFaces_(mesh_.nFaces()) + nEvals_(0) { if ( @@ -980,8 +960,8 @@ Foam::FaceCellWave::FaceCellWave FatalErrorInFunction << "Maximum number of iterations reached. Increase maxIter." << nl << " maxIter:" << maxIter << nl - << " nChangedCells:" << changedCells_.size() << nl - << " nChangedFaces:" << changedFaces_.size() << endl + << " nChangedCells:" << nChangedCells() << nl + << " nChangedFaces:" << nChangedFaces() << endl << exit(FatalError); } } @@ -1001,15 +981,12 @@ Foam::FaceCellWave::FaceCellWave TrackingData& td ) : - mesh_(mesh), + FaceCellWaveBase(mesh), + explicitConnections_(explicitConnections), allFaceInfo_(allFaceInfo), allCellInfo_(allCellInfo), td_(td), - changedFace_(mesh_.nFaces(), false), - changedCell_(mesh_.nCells(), false), - changedFaces_(mesh_.nFaces()), - changedCells_(mesh_.nCells()), changedBaffles_(2*explicitConnections_.size()), hasCyclicPatches_(hasPatch()), hasCyclicAMIPatches_ @@ -1017,9 +994,7 @@ Foam::FaceCellWave::FaceCellWave handleCyclicAMI && returnReduceOr(hasPatch()) ), - nEvals_(0), - nUnvisitedCells_(mesh_.nCells()), - nUnvisitedFaces_(mesh_.nFaces()) + nEvals_(0) { if ( @@ -1047,8 +1022,8 @@ Foam::FaceCellWave::FaceCellWave FatalErrorInFunction << "Maximum number of iterations reached. Increase maxIter." << nl << " maxIter:" << maxIter << nl - << " nChangedCells:" << changedCells_.size() << nl - << " nChangedFaces:" << changedFaces_.size() << endl + << " nChangedCells:" << nChangedCells() << nl + << " nChangedFaces:" << nChangedFaces() << endl << exit(FatalError); } } @@ -1056,20 +1031,6 @@ Foam::FaceCellWave::FaceCellWave // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -Foam::label Foam::FaceCellWave::nUnvisitedCells() const -{ - return nUnvisitedCells_; -} - - -template -Foam::label Foam::FaceCellWave::nUnvisitedFaces() const -{ - return nUnvisitedFaces_; -} - - template Foam::label Foam::FaceCellWave::faceToCell() { @@ -1139,11 +1100,11 @@ Foam::label Foam::FaceCellWave::faceToCell() if (debug & 2) { - Pout<< " Changed cells : " << changedCells_.size() << endl; + Pout<< " Changed cells : " << nChangedCells() << endl; } // Number of changedCells over all procs - return returnReduce(changedCells_.size(), sumOp