From 61efffb7c59dec263b10e4d3c7642cc9151df598 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 3 Feb 2023 20:14:29 +0000 Subject: [PATCH] snappyHexMesh::checkFaces: changed to const labelList& checkFaces is never changed --- src/dynamicMesh/motionSmoother/motionSmootherAlgo.C | 11 ++++++----- src/dynamicMesh/motionSmoother/motionSmootherAlgo.H | 8 ++++---- .../externalDisplacementMeshMover.H | 4 ++-- .../medialAxisMeshMover.C | 7 ++----- .../medialAxisMeshMover.H | 6 +++--- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C index 52185760f7..e077e6e021 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C +++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -718,7 +718,7 @@ Foam::scalar Foam::motionSmootherAlgo::setErrorReduction bool Foam::motionSmootherAlgo::scaleMesh ( - labelList& checkFaces, + const labelList& checkFaces, const bool smoothMesh, const label nAllowableErrors ) @@ -736,7 +736,7 @@ bool Foam::motionSmootherAlgo::scaleMesh bool Foam::motionSmootherAlgo::scaleMesh ( - labelList& checkFaces, + const labelList& checkFaces, const List& baffles, const bool smoothMesh, const label nAllowableErrors @@ -829,7 +829,7 @@ Foam::tmp Foam::motionSmootherAlgo::curPoints() const bool Foam::motionSmootherAlgo::scaleMesh ( - labelList& checkFaces, + const labelList& checkFaces, const List& baffles, const dictionary& paramDict, const dictionary& meshQualityDict, @@ -955,11 +955,12 @@ bool Foam::motionSmootherAlgo::scaleMesh // - points to be smoothed // - faces to be checked in next iteration PackedBoolList isAffectedPoint(mesh_.nPoints()); + labelList affectedFaces(checkFaces); getAffectedFacesAndPoints ( nSmoothScale, // smoothing iterations wrongFaces, // error faces - checkFaces, + affectedFaces, isAffectedPoint ); diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H index a6627b7716..6d9a9e5c16 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H +++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -390,7 +390,7 @@ public: // across patches) bool scaleMesh ( - labelList& checkFaces, + const labelList& checkFaces, const bool smoothMesh = true, const label nAllow = 0 ); @@ -398,7 +398,7 @@ public: //- Move mesh (with baffles) with given scale. bool scaleMesh ( - labelList& checkFaces, + const labelList& checkFaces, const List& baffles, const bool smoothMesh = true, const label nAllow = 0 @@ -407,7 +407,7 @@ public: //- Move mesh with externally provided mesh constraints bool scaleMesh ( - labelList& checkFaces, + const labelList& checkFaces, const List& baffles, const dictionary& paramDict, const dictionary& meshQualityDict, diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.H b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.H index e3d0ab7636..1813110f62 100644 --- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.H +++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/externalDisplacementMeshMover.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -160,7 +160,7 @@ public: ( const dictionary&, const label nAllowableErrors, - labelList& checkFaces + const labelList& checkFaces ) = 0; //- Update local data for geometry changes diff --git a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C index e7830fca6f..24172fa5ad 100644 --- a/src/mesh/snappyHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C +++ b/src/mesh/snappyHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C @@ -1964,15 +1964,12 @@ bool Foam::medialAxisMeshMover::shrinkMesh ( const dictionary& meshQualityDict, const label nAllowableErrors, - labelList& checkFaces + const labelList& checkFaces ) { //- Number of attempts shrinking the mesh const label nSnap = meshQualityDict.lookup