From 2a007b007efb8fcfe376c49243246494a720b0a9 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 7 Sep 2022 14:16:43 +0100 Subject: [PATCH 1/5] BUG: PPCR: check outstanding request. Fixes #2577 If the exit is through maxIter it should still wait for outstanding requests --- src/OpenFOAM/matrices/lduMatrix/solvers/PPCG/PPCG.C | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/PPCG/PPCG.C b/src/OpenFOAM/matrices/lduMatrix/solvers/PPCG/PPCG.C index 6ad660f76f..dc637b97ce 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/PPCG/PPCG.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/PPCG/PPCG.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2019-2020 Mattijs Janssens - Copyright (C) 2020-2021 OpenCFD Ltd. + Copyright (C) 2020-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -170,7 +170,7 @@ Foam::solverPerformance Foam::PPCG::scalarSolveCG ) { // Make sure gamma,delta are available - if (Pstream::parRun()) + if (Pstream::parRun() && outstandingRequest != -1) { Pstream::waitRequest(outstandingRequest); outstandingRequest = -1; @@ -248,6 +248,12 @@ Foam::solverPerformance Foam::PPCG::scalarSolveCG matrix_.Amul(n, m, interfaceBouCoeffs_, interfaces_, cmpt); } + // Cleanup any outstanding requests + if (Pstream::parRun() && outstandingRequest != -1) + { + Pstream::waitRequest(outstandingRequest); + } + return solverPerf; } From a39b50d783ce1d267f4db7bdd5b68ea27233e753 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 7 Sep 2022 15:17:20 +0200 Subject: [PATCH 2/5] COMP: incorrect type in valueAverageBase (fixes #2568) - caused inadvertent truncation of label types --- .../valueAverageBase/valueAverageBaseTemplates.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/db/functionObjects/valueAverageBase/valueAverageBaseTemplates.C b/src/OpenFOAM/db/functionObjects/valueAverageBase/valueAverageBaseTemplates.C index 13f3ec45f8..b8cbe9dc56 100644 --- a/src/OpenFOAM/db/functionObjects/valueAverageBase/valueAverageBaseTemplates.C +++ b/src/OpenFOAM/db/functionObjects/valueAverageBase/valueAverageBaseTemplates.C @@ -117,8 +117,8 @@ bool Foam::functionObjects::valueAverageBase::calc auto timeIter = windowTimes.cbegin(); auto valueIter = windowValues.cbegin(); - meanValue = pTraits::zero; - Type valueOld(pTraits::zero); + meanValue = Zero; + Type2 valueOld(Zero); for ( From 4965dc4cfb59db3b4b62712468cd2c2fbfa0f889 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 7 Sep 2022 15:38:27 +0200 Subject: [PATCH 3/5] COMP: declare forceCoeffs operator<< in Foam namespace (fixes #2576) --- .../forces/forceCoeffs/forceCoeffs.H | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/functionObjects/forces/forceCoeffs/forceCoeffs.H b/src/functionObjects/forces/forceCoeffs/forceCoeffs.H index 997f36ac2b..1dbfe9c430 100644 --- a/src/functionObjects/forces/forceCoeffs/forceCoeffs.H +++ b/src/functionObjects/forces/forceCoeffs/forceCoeffs.H @@ -318,7 +318,7 @@ public: }; - // Coefficients description + //- Coefficients description struct coeffDesc { enum splitType @@ -366,6 +366,12 @@ public: return name_ + "(r)"; } + //- Print description + void print(Ostream& os) const + { + os << desc_.c_str() << ": " << name_; + } + //- Return force/moment components based on the specified split type vector value(const forceComponents& f, const forceComponents& m) const { @@ -546,18 +552,25 @@ public: virtual bool write(); }; +} // End namespace functionObjects + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Ostream& operator<<(Ostream& os, const forceCoeffs::coeffDesc& coeff) +// Output operator +inline Ostream& operator<< +( + Ostream& os, + const functionObjects::forceCoeffs::coeffDesc& coeff +) { - os << coeff.desc_.c_str() << ": " << coeff.name_; - + coeff.print(os); return os; } -} // End namespace functionObjects +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From d3123a1107e11dbaf78f8d0b4e22899942b2e688 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 7 Sep 2022 16:00:54 +0200 Subject: [PATCH 4/5] BUG: redistributePar fails with some area fields (fixes #2574) - this is especially evident in -reconstruct mode when the fields have several processor boundaries. Testing for an existing patch edge mapping must use the `test` method (with range-checking) instead of the more common `set` method since the source field will likely have many more boundaries than physical edge mappings. --- src/finiteArea/distributed/faMeshDistributorTemplates.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finiteArea/distributed/faMeshDistributorTemplates.C b/src/finiteArea/distributed/faMeshDistributorTemplates.C index 6f556f3dab..9fb026451c 100644 --- a/src/finiteArea/distributed/faMeshDistributorTemplates.C +++ b/src/finiteArea/distributed/faMeshDistributorTemplates.C @@ -93,7 +93,7 @@ Foam::faMeshDistributor::distributeField forAll(bfld, patchi) { - if (patchEdgeMaps_.set(patchi)) + if (patchEdgeMaps_.test(patchi)) { // Clone local patch field @@ -203,7 +203,7 @@ Foam::faMeshDistributor::distributeField forAll(bfld, patchi) { - if (patchEdgeMaps_.set(patchi)) + if (patchEdgeMaps_.test(patchi)) { // Clone local patch field From f1da147925246c0ed9f1549f7a765f4664d638dd Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 7 Sep 2022 16:02:10 +0200 Subject: [PATCH 5/5] CONFIG: bump patch level --- META-INFO/api-info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META-INFO/api-info b/META-INFO/api-info index 888adfedea..21371b5bfe 100644 --- a/META-INFO/api-info +++ b/META-INFO/api-info @@ -1,2 +1,2 @@ api=2206 -patch=0 +patch=220907