From 93cfb72cf13b042e4c3361571b4edd42e7251416 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 21 Jun 2024 13:10:24 +0200 Subject: [PATCH] changed: force field projections for mixed multi-patch the nodal averaging code in SIMbase::project uses the global node number and this breaks since since these are for all bases, not just basis 1. --- src/ASM/LR/ASMu2D.C | 3 --- src/ASM/LR/ASMu3D.C | 3 --- src/SIM/SIMbase.C | 5 +++++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ASM/LR/ASMu2D.C b/src/ASM/LR/ASMu2D.C index 9291ab336..649946642 100644 --- a/src/ASM/LR/ASMu2D.C +++ b/src/ASM/LR/ASMu2D.C @@ -2464,9 +2464,6 @@ Field* ASMu2D::getProjectedField (const Vector& coefs) const Fields* ASMu2D::getProjectedFields (const Vector& coefs, size_t) const { - if (!this->separateProjectionBasis()) - return nullptr; - size_t ncmp = coefs.size() / this->getNoProjectionNodes(); if (ncmp*this->getNoProjectionNodes() == coefs.size()) return new LRSplineFields2D(this->getBasis(ASM::PROJECTION_BASIS), diff --git a/src/ASM/LR/ASMu3D.C b/src/ASM/LR/ASMu3D.C index 34d8e48b1..25b8e2aec 100644 --- a/src/ASM/LR/ASMu3D.C +++ b/src/ASM/LR/ASMu3D.C @@ -2006,9 +2006,6 @@ Field* ASMu3D::getProjectedField (const Vector& coefs) const Fields* ASMu3D::getProjectedFields (const Vector& coefs, size_t) const { - if (!this->separateProjectionBasis()) - return nullptr; - size_t ncmp = coefs.size() / this->getNoProjectionNodes(); if (ncmp*this->getNoProjectionNodes() == coefs.size()) return new LRSplineFields3D(this->getBasis(ASM::PROJECTION_BASIS),coefs,ncmp); diff --git a/src/SIM/SIMbase.C b/src/SIM/SIMbase.C index 21f362ed1..a8dae38d1 100644 --- a/src/SIM/SIMbase.C +++ b/src/SIM/SIMbase.C @@ -2362,6 +2362,11 @@ bool SIMbase::evalSecondarySolution (Matrix& field, int pindx) const bool SIMbase::fieldProjections () const { + // Forced for mixed multi-patch models as the nodal averaging + // in SIMbase::project() fails. + if (myModel.size() > 1 && myModel[0]->getNoBasis() > 1) + return true; + for (const ASMbase* pch : myModel) if (pch->separateProjectionBasis()) return true;