From 81c2c42ca466ceba95b1475d665d2646139c34b6 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 14 Mar 2024 16:26:17 +0000 Subject: [PATCH] domainDecomposition: Correct stitcher construction on read-update --- src/parallel/parallel/domainDecomposition.C | 32 ++++--------------- .../parallel/domainDecompositionDecompose.C | 3 ++ .../parallel/domainDecompositionReconstruct.C | 5 ++- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/src/parallel/parallel/domainDecomposition.C b/src/parallel/parallel/domainDecomposition.C index f47a6d3264..0b7b31f084 100644 --- a/src/parallel/parallel/domainDecomposition.C +++ b/src/parallel/parallel/domainDecomposition.C @@ -109,6 +109,8 @@ void Foam::domainDecomposition::readComplete() false ) ); + + completeMesh_->postConstruct(false, fvMesh::stitchType::none); } @@ -132,6 +134,8 @@ void Foam::domainDecomposition::readProcs() false ) ); + + procMeshes_[proci].postConstruct(false, fvMesh::stitchType::none); } } @@ -516,12 +520,7 @@ bool Foam::domainDecomposition::readDecompose() void Foam::domainDecomposition::postReadDecompose() { - completeMesh_->postConstruct(false, fvMesh::stitchType::nonGeometric); - - forAll(procMeshes_, proci) - { - procMeshes_[proci].postConstruct(false, fvMesh::stitchType::none); - } + completeMesh_->stitcher().connect(false, false, true); } @@ -663,15 +662,9 @@ bool Foam::domainDecomposition::readReconstruct() void Foam::domainDecomposition::postReadReconstruct() { - completeMesh_->postConstruct(false, fvMesh::stitchType::none); - forAll(procMeshes_, proci) { - procMeshes_[proci].postConstruct - ( - false, - fvMesh::stitchType::nonGeometric - ); + procMeshes_[proci].stitcher().connect(false, false, true); } } @@ -776,14 +769,6 @@ void Foam::domainDecomposition::postReadUpdateDecompose const fvMesh::readUpdateState stat ) { - if (stat >= fvMesh::TOPO_CHANGE) - { - forAll(procMeshes_, proci) - { - procMeshes_[proci].postConstruct(false, fvMesh::stitchType::none); - } - } - if (completeMesh_->stitcher().stitches() && stat != fvMesh::UNCHANGED) { procFaceAddressingBf_.clear(); @@ -883,11 +868,6 @@ void Foam::domainDecomposition::postReadUpdateReconstruct const fvMesh::readUpdateState stat ) { - if (stat >= fvMesh::TOPO_CHANGE) - { - completeMesh_->postConstruct(false, fvMesh::stitchType::none); - } - if (completeMesh_->stitcher().stitches() && stat != fvMesh::UNCHANGED) { procFaceAddressingBf_.clear(); diff --git a/src/parallel/parallel/domainDecompositionDecompose.C b/src/parallel/parallel/domainDecompositionDecompose.C index 0eb2ff131e..2587a1a330 100644 --- a/src/parallel/parallel/domainDecompositionDecompose.C +++ b/src/parallel/parallel/domainDecompositionDecompose.C @@ -930,6 +930,9 @@ void Foam::domainDecomposition::decompose() // Add patches to the mesh procMesh.addFvPatches(procPatches); + // Allocate a stitcher, but do not stitch + procMesh.postConstruct(false, fvMesh::stitchType::none); + // Create point zones { const meshPointZones& pz = completeMesh().pointZones(); diff --git a/src/parallel/parallel/domainDecompositionReconstruct.C b/src/parallel/parallel/domainDecompositionReconstruct.C index e3aa655aff..f93b587bc7 100644 --- a/src/parallel/parallel/domainDecompositionReconstruct.C +++ b/src/parallel/parallel/domainDecompositionReconstruct.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -516,6 +516,9 @@ void Foam::domainDecomposition::reconstruct() completeMesh_->setInstance(procMeshes()[0].facesInstance()); completeMesh_->setPointsInstance(procMeshes()[0].pointsInstance()); + // Allocate a stitcher, but do not stitch + completeMesh_->postConstruct(false, fvMesh::stitchType::none); + Info<< decrIndent; }