From b2eff135e6dabe0d6934da0131bbb41c003a3027 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 25 Mar 2022 12:41:50 +0000 Subject: [PATCH] FaceCellWave: Removed unnecessary intermediate MeshWave class --- .../mesh/advanced/selectCells/selectCells.C | 20 +- .../meshCut/directions/directions.C | 13 +- .../meshCut/wallLayerCells/wallLayerCells.C | 15 +- .../inverseFaceDistanceDiffusivity.C | 14 +- src/meshTools/Make/files | 5 +- .../{MeshWave => FaceCellWave}/FaceCellWave.C | 2 +- .../{MeshWave => FaceCellWave}/FaceCellWave.H | 30 +-- .../FaceCellWaveName.C | 2 +- src/meshTools/algorithms/MeshWave/MeshWave.C | 96 --------- src/meshTools/algorithms/MeshWave/MeshWave.H | 186 ------------------ .../algorithms/MeshWave/MeshWaveName.C | 36 ---- .../cellClassification/cellClassification.C | 23 ++- .../cellClassification/cellClassification.H | 4 +- .../patchDist/patchDistWave/patchDistWave.H | 14 +- .../patchDistWave/patchDistWaveTemplates.C | 53 +++-- 15 files changed, 108 insertions(+), 405 deletions(-) rename src/meshTools/algorithms/{MeshWave => FaceCellWave}/FaceCellWave.C (99%) rename src/meshTools/algorithms/{MeshWave => FaceCellWave}/FaceCellWave.H (96%) rename src/meshTools/algorithms/{MeshWave => FaceCellWave}/FaceCellWaveName.C (95%) delete mode 100644 src/meshTools/algorithms/MeshWave/MeshWave.C delete mode 100644 src/meshTools/algorithms/MeshWave/MeshWave.H delete mode 100644 src/meshTools/algorithms/MeshWave/MeshWaveName.C diff --git a/applications/utilities/mesh/advanced/selectCells/selectCells.C b/applications/utilities/mesh/advanced/selectCells/selectCells.C index 48365940a9..7822b3bb07 100644 --- a/applications/utilities/mesh/advanced/selectCells/selectCells.C +++ b/applications/utilities/mesh/advanced/selectCells/selectCells.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,7 @@ Description #include "cellClassification.H" #include "cellSet.H" #include "cellInfo.H" -#include "MeshWave.H" +#include "FaceCellWave.H" #include "edgeStats.H" #include "treeDataTriSurface.H" #include "indexedOctree.H" @@ -297,27 +297,27 @@ label selectOutsideCells } // Floodfill starting from outsideFaces (of type meshInfo) - MeshWave regionCalc + List faceInfoList(mesh.nFaces()), cellInfoList(mesh.nCells()); + FaceCellWave regionCalc ( mesh, outsideFaces.shrink(), outsideFacesInfo.shrink(), - mesh.globalData().nTotalCells()+1 // max iterations + faceInfoList, + cellInfoList, + mesh.globalData().nTotalCells() + 1 // max iterations ); - // Now regionCalc should hold info on cells that are reachable from + // Now cellInfoList should hold info on cells that are reachable from // changedFaces. Use these to subset cellType - const List& allCellInfo = regionCalc.allCellInfo(); - label nChanged = 0; - - forAll(allCellInfo, celli) + forAll(cellInfoList, celli) { if (cellType[celli] == MESH) { // Original cell was selected for meshing. Check if cell was // reached from outsidePoints - if (allCellInfo[celli].type() != MESH) + if (cellInfoList[celli].type() != MESH) { cellType[celli] = NONMESH; nChanged++; diff --git a/src/dynamicMesh/meshCut/directions/directions.C b/src/dynamicMesh/meshCut/directions/directions.C index 058550ab5e..15380ede77 100644 --- a/src/dynamicMesh/meshCut/directions/directions.C +++ b/src/dynamicMesh/meshCut/directions/directions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,7 +27,7 @@ License #include "polyMesh.H" #include "twoDPointCorrector.H" #include "directionInfo.H" -#include "MeshWave.H" +#include "FaceCellWave.H" #include "OFstream.H" #include "meshTools.H" #include "hexMatcher.H" @@ -203,16 +203,17 @@ Foam::vectorField Foam::directions::propagateDirection } } - MeshWave directionCalc + List faceInfo(mesh.nFaces()), cellInfo(mesh.nCells()); + FaceCellWave directionCalc ( mesh, changedFaces, changedFacesInfo, - mesh.globalData().nTotalCells()+1 + faceInfo, + cellInfo, + mesh.globalData().nTotalCells() + 1 ); - const List& cellInfo = directionCalc.allCellInfo(); - vectorField dirField(cellInfo.size()); label nUnset = 0; diff --git a/src/dynamicMesh/meshCut/wallLayerCells/wallLayerCells.C b/src/dynamicMesh/meshCut/wallLayerCells/wallLayerCells.C index 0d7401bc6a..25051e704d 100644 --- a/src/dynamicMesh/meshCut/wallLayerCells/wallLayerCells.C +++ b/src/dynamicMesh/meshCut/wallLayerCells/wallLayerCells.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ License #include "wallLayerCells.H" #include "DynamicList.H" -#include "MeshWave.H" +#include "FaceCellWave.H" #include "wallNormalInfo.H" #include "OFstream.H" @@ -137,23 +137,24 @@ Foam::wallLayerCells::wallLayerCells // (cannot use local patchIDs since we might get info from neighbouring // processor) - MeshWave regionCalc + List faceInfo(mesh.nFaces()), cellInfo(mesh.nCells()); + FaceCellWave regionCalc ( mesh, changedFaces, changedFacesInfo, + faceInfo, + cellInfo, 0 ); regionCalc.iterate(nLayers); - // Now regionCalc should hold info on faces that are reachable from + // Now faceInfo should hold info on faces that are reachable from // changedFaces within nLayers iterations. We use face info since that is // guaranteed to be consistent across processor boundaries. - const List& faceInfo = regionCalc.allFaceInfo(); - if (debug) { InfoInFunction << "Dumping selected faces to selectedFaces.obj" << endl; @@ -204,8 +205,6 @@ Foam::wallLayerCells::wallLayerCells DynamicList refineCells(3*nWalls); - const List& cellInfo = regionCalc.allCellInfo(); - forAll(cellInfo, celli) { const wallNormalInfo& info = cellInfo[celli]; diff --git a/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C index 6abc44c4ea..cf2fdd45ff 100644 --- a/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,7 +27,7 @@ License #include "surfaceFields.H" #include "HashSet.H" #include "wallPoint.H" -#include "MeshWave.H" +#include "FaceCellWave.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -128,17 +128,17 @@ Foam::inverseFaceDistanceDiffusivity::operator()() const faceDist.setSize(nPatchFaces); changedFaces.setSize(nPatchFaces); - MeshWave waveInfo + List faceInfo(mesh().nFaces()), cellInfo(mesh().nCells()); + FaceCellWave waveInfo ( mesh(), changedFaces, faceDist, - mesh().globalData().nTotalCells()+1 // max iterations + faceInfo, + cellInfo, + mesh().globalData().nTotalCells() + 1 // max iterations ); - const List& faceInfo = waveInfo.allFaceInfo(); - const List& cellInfo = waveInfo.allCellInfo(); - for (label facei=0; facei changedCells_; - //- Contains cyclics const bool hasCyclicPatches_; @@ -119,11 +131,15 @@ protected: //- Number of evaluations label nEvals_; - //- Number of unvisited cells/faces + //- Number of unvisited cells label nUnvisitedCells_; + + //- Number of unvisited faces label nUnvisitedFaces_; + // Protected member functions + //- Updates cellInfo with information from neighbour. Updates all // statistics. bool updateCell @@ -242,16 +258,6 @@ protected: void handleExplicitConnections(); - // Protected static data - - static const scalar geomTol_; - static scalar propagationTol_; - - //- Used as default trackdata value to satisfy default template - // argument. - static int dummyTrackData_; - - public: // Static Functions diff --git a/src/meshTools/algorithms/MeshWave/FaceCellWaveName.C b/src/meshTools/algorithms/FaceCellWave/FaceCellWaveName.C similarity index 95% rename from src/meshTools/algorithms/MeshWave/FaceCellWaveName.C rename to src/meshTools/algorithms/FaceCellWave/FaceCellWaveName.C index ece68f6c08..28659a2d2d 100644 --- a/src/meshTools/algorithms/MeshWave/FaceCellWaveName.C +++ b/src/meshTools/algorithms/FaceCellWave/FaceCellWaveName.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/meshTools/algorithms/MeshWave/MeshWave.C b/src/meshTools/algorithms/MeshWave/MeshWave.C deleted file mode 100644 index 5614bf1662..0000000000 --- a/src/meshTools/algorithms/MeshWave/MeshWave.C +++ /dev/null @@ -1,96 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -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 "MeshWave.H" -#include "polyMesh.H" - - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -template -int Foam::MeshWave::dummyTrackData_ = 12345; - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -// Iterate, propagating changedFacesInfo across mesh, until no change (or -// maxIter reached). -template -Foam::MeshWave::MeshWave -( - const polyMesh& mesh, - const labelList& changedFaces, - const List& changedFacesInfo, - const label maxIter, - TrackingData& td -) -: - allFaceInfo_(mesh.nFaces()), - allCellInfo_(mesh.nCells()), - calc_ - ( - mesh, - changedFaces, - changedFacesInfo, - allFaceInfo_, - allCellInfo_, - maxIter, - td - ) -{} - - -// Iterate, propagating changedFacesInfo across mesh, until no change (or -// maxIter reached). Initial cell values specified. -template -Foam::MeshWave::MeshWave -( - const polyMesh& mesh, - const labelList& changedFaces, - const List& changedFacesInfo, - const List& allCellInfo, - const label maxIter, - TrackingData& td -) -: - allFaceInfo_(mesh.nFaces()), - allCellInfo_(allCellInfo), - calc_ - ( - mesh, - changedFaces, - changedFacesInfo, - allFaceInfo_, - allCellInfo_, - maxIter, - td - ) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - -// ************************************************************************* // diff --git a/src/meshTools/algorithms/MeshWave/MeshWave.H b/src/meshTools/algorithms/MeshWave/MeshWave.H deleted file mode 100644 index 157a029bf4..0000000000 --- a/src/meshTools/algorithms/MeshWave/MeshWave.H +++ /dev/null @@ -1,186 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -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 . - -Class - Foam::MeshWave - -Description - FaceCellWave plus data - -SourceFiles - MeshWave.C - -\*---------------------------------------------------------------------------*/ - -#ifndef MeshWave_H -#define MeshWave_H - -#include "FaceCellWave.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class MeshWaveName Declaration -\*---------------------------------------------------------------------------*/ - -TemplateName(MeshWave); - - -/*---------------------------------------------------------------------------*\ - Class MeshWave Declaration -\*---------------------------------------------------------------------------*/ - -template -class MeshWave -: - public MeshWaveName -{ - // Private Data - - //- Wall information for all faces - List allFaceInfo_; - - //- Wall information for all cells - List allCellInfo_; - - //- Wave calculation engine. - FaceCellWave calc_; - - - // Private static data - - //- Used as default trackdata value to satisfy default template - // argument. - static int dummyTrackData_; - - -public: - - // Constructors - - //- Construct from mesh and list of changed faces with the Type - // for these faces. Iterates until nothing changes or maxIter reached. - // (maxIter can be 0) - MeshWave - ( - const polyMesh& mesh, - const labelList& initialChangedFaces, - const List& changedFacesInfo, - const label maxIter, - TrackingData& td = dummyTrackData_ - ); - - //- Construct from mesh, list of changed faces with the Type - // for these faces and initial field. - // Iterates until nothing changes or maxIter reached. - // (maxIter can be 0) - MeshWave - ( - const polyMesh& mesh, - const labelList& initialChangedFaces, - const List& changedFacesInfo, - const List& allCellInfo, - const label maxIter, - TrackingData& td = dummyTrackData_ - ); - - //- Disallow default bitwise copy construction - MeshWave(const MeshWave&) = delete; - - - // Member Functions - - //- Get allFaceInfo - const List& allFaceInfo() const - { - return allFaceInfo_; - } - - //- Get allCellInfo - const List& allCellInfo() const - { - return allCellInfo_; - } - - //- Additional data to be passed into container - const TrackingData& data() const - { - return calc_.data(); - } - - //- Additional data to be passed into container - TrackingData& data() - { - return calc_.data(); - } - - //- Iterate until no changes or maxIter reached. Returns actual - // number of iterations. - label iterate(const label maxIter) - { - return calc_.iterate(maxIter); - } - - //- Get number of unvisited cells, i.e. cells that were not (yet) - // reached from walking across mesh. This can happen from - // - not enough iterations done - // - a disconnected mesh - // - a mesh without walls in it - label getUnsetCells() const - { - return calc_.getUnsetCells(); - } - - //- Get number of unvisited faces - label getUnsetFaces() const - { - return calc_.getUnsetFaces(); - } - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const MeshWave&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "MeshWave.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/meshTools/algorithms/MeshWave/MeshWaveName.C b/src/meshTools/algorithms/MeshWave/MeshWaveName.C deleted file mode 100644 index d0cdfb30d7..0000000000 --- a/src/meshTools/algorithms/MeshWave/MeshWaveName.C +++ /dev/null @@ -1,36 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -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 "MeshWave.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -defineTypeNameAndDebug(MeshWaveName, 0); -} - - -// ************************************************************************* // diff --git a/src/meshTools/cellClassification/cellClassification.C b/src/meshTools/cellClassification/cellClassification.C index 145a1555a9..7e05473486 100644 --- a/src/meshTools/cellClassification/cellClassification.C +++ b/src/meshTools/cellClassification/cellClassification.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,7 @@ License #include "meshSearch.H" #include "cellInfo.H" #include "polyMesh.H" -#include "MeshWave.H" +#include "FaceCellWave.H" #include "ListOps.H" #include "meshTools.H" #include "cpuTime.H" @@ -320,21 +320,20 @@ void Foam::cellClassification::markCells cellInfo(cellClassification::OUTSIDE) ); - MeshWave cellInfoCalc + List faceInfoList(mesh().nFaces()); + FaceCellWave cellInfoCalc ( mesh_, - changedFaces, // Labels of changed faces - changedFacesInfo, // Information on changed faces - cellInfoList, // Information on all cells - mesh_.globalData().nTotalCells()+1 // max iterations + changedFaces, // Labels of changed faces + changedFacesInfo, // Information on changed faces + faceInfoList, + cellInfoList, // Information on all cells + mesh_.globalData().nTotalCells() + 1 // max iterations ); - // Get information out of cellInfoList - const List& allInfo = cellInfoCalc.allCellInfo(); - - forAll(allInfo, celli) + forAll(cellInfoList, celli) { - label t = allInfo[celli].type(); + label t = cellInfoList[celli].type(); if (t == cellClassification::NOTSET) { diff --git a/src/meshTools/cellClassification/cellClassification.H b/src/meshTools/cellClassification/cellClassification.H index 7c36141847..438f4af5f7 100644 --- a/src/meshTools/cellClassification/cellClassification.H +++ b/src/meshTools/cellClassification/cellClassification.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -160,7 +160,7 @@ private: //- Mark all faces intersected by or intersecting surface boolList markFaces(const triSurfaceSearch&) const; - //- Divide cells into cut/inside/outside by using MeshWave from cut + //- Divide cells into cut/inside/outside by using FaceCellWave from cut // faces. No check is done on whether outsidePts are in different // domains. void markCells diff --git a/src/meshTools/patchDist/patchDistWave/patchDistWave.H b/src/meshTools/patchDist/patchDistWave/patchDistWave.H index 19391ffc39..7d64d2a1b7 100644 --- a/src/meshTools/patchDist/patchDistWave/patchDistWave.H +++ b/src/meshTools/patchDist/patchDistWave/patchDistWave.H @@ -25,8 +25,8 @@ Class Foam::patchDistWave Description - Takes a set of patches to start MeshWave from and computed the distance at - patches and possibly additional transported data. + Takes a set of patches to start FaceCellWave from and computed the distance + at patches and possibly additional transported data. SourceFiles patchDistWave.C @@ -39,7 +39,7 @@ SourceFiles #include "Field.H" #include "FieldField.H" #include "UPtrList.H" -#include "MeshWave.H" +#include "FaceCellWave.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -66,18 +66,18 @@ void setChangedFaces const InitialPatchData& ... initialPatchData ); -//- Copy MeshWave values into the cell fields +//- Copy FaceCellWave values into the cell fields template label getCellValues ( const polyMesh& mesh, - MeshWave& waveInfo, + FaceCellWave& waveInfo, Field& cellValues, DataMethod method, const DataType& stabiliseValue = pTraits::zero ); -//- Copy MeshWave values into the patch field-fields +//- Copy FaceCellWave values into the patch field-fields template < class PatchPointType, @@ -88,7 +88,7 @@ template label getPatchValues ( const polyMesh& mesh, - MeshWave& wave, + FaceCellWave& wave, FieldField& patchValues, DataMethod method, const DataType& stabiliseValue = pTraits::zero diff --git a/src/meshTools/patchDist/patchDistWave/patchDistWaveTemplates.C b/src/meshTools/patchDist/patchDistWave/patchDistWaveTemplates.C index 0bf6644dc8..62bf836e68 100644 --- a/src/meshTools/patchDist/patchDistWave/patchDistWaveTemplates.C +++ b/src/meshTools/patchDist/patchDistWave/patchDistWaveTemplates.C @@ -34,7 +34,7 @@ void Foam::patchDistWave::setChangedFaces const polyMesh& mesh, const labelHashSet& patchIDs, labelList& changedFaces, - List& faceDist, + List& changedFacesInfo, const InitialPatchData& ... initialPatchData ) { @@ -45,7 +45,7 @@ void Foam::patchDistWave::setChangedFaces } changedFaces.resize(nChangedFaces); - faceDist.resize(nChangedFaces); + changedFacesInfo.resize(nChangedFaces); label changedFacei = 0; @@ -61,7 +61,7 @@ void Foam::patchDistWave::setChangedFaces changedFaces[changedFacei] = meshFacei; - faceDist[changedFacei] = + changedFacesInfo[changedFacei] = PatchPointType ( patch.faceCentres()[patchFacei], @@ -79,7 +79,7 @@ template Foam::label Foam::patchDistWave::getCellValues ( const polyMesh& mesh, - MeshWave& waveInfo, + FaceCellWave& waveInfo, Field& cellValues, DataMethod method, const DataType& stabiliseValue @@ -112,7 +112,7 @@ template Foam::label Foam::patchDistWave::getPatchValues ( const polyMesh& mesh, - MeshWave& waveInfo, + FaceCellWave& waveInfo, FieldField& patchValues, DataMethod method, const DataType& stabiliseValue @@ -151,17 +151,26 @@ Foam::label Foam::patchDistWave::wave const bool correct ) { - // Initialise to faceDist information to face centre on patches - List faceDist; + // Initialise to changedFacesInfo information to face centre on patches + List changedFacesInfo; labelList changedFaces; - setChangedFaces(mesh, patchIDs, changedFaces, faceDist); + setChangedFaces + ( + mesh, + patchIDs, + changedFaces, + changedFacesInfo + ); // Do calculate patch distance by 'growing' from faces. - MeshWave wave + List faceInfo(mesh.nFaces()), cellInfo(mesh.nCells()); + FaceCellWave wave ( mesh, changedFaces, - faceDist, + changedFacesInfo, + faceInfo, + cellInfo, mesh.globalData().nTotalCells() + 1 // max iterations ); @@ -174,7 +183,7 @@ Foam::label Foam::patchDistWave::wave // Correct patch cells for true distance if (correct) { - Map