From da7286bc1d197429ca01efcc63a156ffffdcd6c8 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 14 Jun 2022 11:15:31 +0100 Subject: [PATCH] createNonConformalCyclics: Corrected overwrite The handling of existing constant/fvMesh/polyFaces data has been corrected so that it no longer interferes with the construction of a new couple. --- .../createNonConformalCouples.C | 2 +- src/finiteVolume/fvMesh/fvMesh.C | 6 +++--- .../fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C | 5 +++-- .../fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.H | 13 +++++++++++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/applications/utilities/mesh/manipulation/createNonConformalCouples/createNonConformalCouples.C b/applications/utilities/mesh/manipulation/createNonConformalCouples/createNonConformalCouples.C index dab6c1a4dc..e27b7c1206 100644 --- a/applications/utilities/mesh/manipulation/createNonConformalCouples/createNonConformalCouples.C +++ b/applications/utilities/mesh/manipulation/createNonConformalCouples/createNonConformalCouples.C @@ -384,7 +384,7 @@ int main(int argc, char *argv[]) ); // Connect the mesh so that the new stitching topology gets written out - stitcher.connect(false, false); + stitcher.connect(false, false, false); mesh.setInstance(runTime.timeName()); diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index dc38680d87..8ee1e2106c 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -340,7 +340,7 @@ Foam::fvMesh::fvMesh(const IOobject& io, const bool changers) } // Stitch or Re-stitch if necessary - stitcher_->connect(false, changers); + stitcher_->connect(false, changers, true); // Construct changers if (changers) @@ -625,7 +625,7 @@ bool Foam::fvMesh::move() curTimeIndex_ = time().timeIndex(); - stitcher_->connect(true, true); + stitcher_->connect(true, true, false); return moved; } @@ -752,7 +752,7 @@ Foam::polyMesh::readUpdateState Foam::fvMesh::readUpdate() if (stitcher_.valid() && state != polyMesh::UNCHANGED) { - stitcher_->connect(false, false); + stitcher_->connect(false, false, true); } return state; diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C index b25621bdb5..f59de1b491 100644 --- a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C +++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.C @@ -1149,7 +1149,8 @@ bool Foam::fvMeshStitcher::disconnect bool Foam::fvMeshStitcher::connect ( const bool changing, - const bool geometric + const bool geometric, + const bool load ) { if (!stitches() || (changing && !mesh_.dynamic())) @@ -1172,7 +1173,7 @@ bool Foam::fvMeshStitcher::connect tmp tOrigFacesNbrBf; tmp tOrigSfNbrBf; tmp tOrigCfNbrBf; - if (!changing) + if (load) { const IOobject polyFacesBfIO(mesh_.polyFacesBfIO(IOobject::MUST_READ)); diff --git a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.H b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.H index 32ec0ab06c..5a69abb0dc 100644 --- a/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.H +++ b/src/finiteVolume/fvMesh/fvMeshStitchers/fvMeshStitcher/fvMeshStitcher.H @@ -369,10 +369,19 @@ public: virtual void movePoints(); //- Disconnect the mesh by removing faces from the nonConformalCyclics - virtual bool disconnect(const bool changing, const bool geometric); + virtual bool disconnect + ( + const bool changing, + const bool geometric + ); //- Connect the mesh by adding faces into the nonConformalCyclics - virtual bool connect(const bool changing, const bool geometric); + virtual bool connect + ( + const bool changing, + const bool geometric, + const bool load + ); //- Write the mover state virtual bool write(const bool write = true) const