From 4abf4c64a7c9fe9d49036210c3443534526103ee Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 28 Aug 2023 11:58:40 +0200 Subject: [PATCH] changed: override separateProjectionBasis in ASMxxD(mx) in preparation for having a separate geometry basis. in that case we cannot use the geomB pointer to check for equivalence. also fixes two field mixed formulations with the higher order basis being the second basis. in that case we are not projecting on basis 1, but rather on basis 2. --- src/ASM/ASMs2D.C | 6 ++++++ src/ASM/ASMs2D.h | 2 ++ src/ASM/ASMs2Dmx.C | 8 ++++++++ src/ASM/ASMs2Dmx.h | 3 +++ src/ASM/ASMs3D.C | 6 ++++++ src/ASM/ASMs3D.h | 3 +++ src/ASM/ASMs3Dmx.C | 8 ++++++++ src/ASM/ASMs3Dmx.h | 3 +++ src/ASM/LR/ASMu2Dmx.C | 8 ++++++++ src/ASM/LR/ASMu2Dmx.h | 3 +++ src/ASM/LR/ASMu3Dmx.C | 8 ++++++++ src/ASM/LR/ASMu3Dmx.h | 3 +++ 12 files changed, 61 insertions(+) diff --git a/src/ASM/ASMs2D.C b/src/ASM/ASMs2D.C index 072ec9c7..3035e12b 100644 --- a/src/ASM/ASMs2D.C +++ b/src/ASM/ASMs2D.C @@ -431,6 +431,12 @@ bool ASMs2D::raiseOrder (int ru, int rv) } +bool ASMs2D::separateProjectionBasis () const +{ + return projB && projB != surf; +} + + /*! This method is supposed to be invoked twice during the model generation. In the first call, with \a init = \e true, the spline surface object \a *surf diff --git a/src/ASM/ASMs2D.h b/src/ASM/ASMs2D.h index 8501dce6..359b528a 100644 --- a/src/ASM/ASMs2D.h +++ b/src/ASM/ASMs2D.h @@ -312,6 +312,8 @@ public: //! \brief Creates a separate projection basis for this patch. virtual bool createProjectionBasis(bool init); + //! \brief Checks if a separate projection basis is used for this patch. + virtual bool separateProjectionBasis() const; // Various methods for preprocessing of boundary conditions and patch topology // =========================================================================== diff --git a/src/ASM/ASMs2Dmx.C b/src/ASM/ASMs2Dmx.C index b7ae0d8b..566eb059 100644 --- a/src/ASM/ASMs2Dmx.C +++ b/src/ASM/ASMs2Dmx.C @@ -1124,3 +1124,11 @@ int ASMs2Dmx::getLastItgElmNode () const { return std::accumulate(elem_size.begin(), elem_size.begin() + geoBasis, -1); } + + +bool ASMs2Dmx::separateProjectionBasis () const +{ + return std::none_of(m_basis.begin(), m_basis.end(), + [this](const std::shared_ptr& entry) + { return entry.get() == projB; }); +} diff --git a/src/ASM/ASMs2Dmx.h b/src/ASM/ASMs2Dmx.h index 676dfac4..70eeb037 100644 --- a/src/ASM/ASMs2Dmx.h +++ b/src/ASM/ASMs2Dmx.h @@ -184,6 +184,9 @@ public: //! \brief Swap between main and alternative projection basis. virtual void swapProjectionBasis(); + //! \brief Checks if a separate projection basis is used for this patch. + virtual bool separateProjectionBasis() const; + //! \brief Extracts nodal results for this patch from the global vector. //! \param[in] globVec Global solution vector in DOF-order //! \param[out] nodeVec Nodal result vector for this patch diff --git a/src/ASM/ASMs3D.C b/src/ASM/ASMs3D.C index 146df70f..dd6ff773 100644 --- a/src/ASM/ASMs3D.C +++ b/src/ASM/ASMs3D.C @@ -365,6 +365,12 @@ bool ASMs3D::raiseOrder (int ru, int rv, int rw, bool setOrder) } +bool ASMs3D::separateProjectionBasis () const +{ + return projB && projB != svol; +} + + /*! This method is supposed to be invoked twice during the model generation. In the first call, with \a init = \e true, the spline volume object \a *svol diff --git a/src/ASM/ASMs3D.h b/src/ASM/ASMs3D.h index c18a062f..d75d4ccb 100644 --- a/src/ASM/ASMs3D.h +++ b/src/ASM/ASMs3D.h @@ -337,6 +337,9 @@ public: //! \brief Creates a separate projection basis for this patch. virtual bool createProjectionBasis(bool init); + //! \brief Checks if a separate projection basis is used for this patch. + virtual bool separateProjectionBasis() const; + // Various methods for preprocessing of boundary conditions and patch topology // =========================================================================== diff --git a/src/ASM/ASMs3Dmx.C b/src/ASM/ASMs3Dmx.C index 809fa4fc..6f92918e 100644 --- a/src/ASM/ASMs3Dmx.C +++ b/src/ASM/ASMs3Dmx.C @@ -1276,3 +1276,11 @@ int ASMs3Dmx::getLastItgElmNode () const { return std::accumulate(elem_size.begin(), elem_size.begin() + geoBasis, -1); } + + +bool ASMs3Dmx::separateProjectionBasis () const +{ + return std::none_of(m_basis.begin(), m_basis.end(), + [this](const std::shared_ptr& entry) + { return entry.get() == projB; }); +} diff --git a/src/ASM/ASMs3Dmx.h b/src/ASM/ASMs3Dmx.h index ed869432..fffc627e 100644 --- a/src/ASM/ASMs3Dmx.h +++ b/src/ASM/ASMs3Dmx.h @@ -189,6 +189,9 @@ public: //! \brief Swap between main and alternative projection basis. virtual void swapProjectionBasis(); + //! \brief Checks if a separate projection basis is used for this patch. + virtual bool separateProjectionBasis() const; + //! \brief Extracts nodal results for this patch from the global vector. //! \param[in] globVec Global solution vector in DOF-order //! \param[out] nodeVec Nodal result vector for this patch diff --git a/src/ASM/LR/ASMu2Dmx.C b/src/ASM/LR/ASMu2Dmx.C index aa9f1af5..5cfee5b4 100644 --- a/src/ASM/LR/ASMu2Dmx.C +++ b/src/ASM/LR/ASMu2Dmx.C @@ -1271,3 +1271,11 @@ BasisFunctionVals ASMu2Dmx::BasisFunctionCache::calculatePt (size_t el, return result; } + + +bool ASMu2Dmx::separateProjectionBasis () const +{ + return std::none_of(m_basis.begin(), m_basis.end(), + [this](const SplinePtr& entry) + { return entry == projB; }); +} diff --git a/src/ASM/LR/ASMu2Dmx.h b/src/ASM/LR/ASMu2Dmx.h index 7e543173..0662688d 100644 --- a/src/ASM/LR/ASMu2Dmx.h +++ b/src/ASM/LR/ASMu2Dmx.h @@ -246,6 +246,9 @@ public: //! \brief Swaps between the main and alternative projection basis. virtual void swapProjectionBasis(); + //! \brief Checks if a separate projection basis is used for this patch. + virtual bool separateProjectionBasis() const; + private: //! \brief Finds the elements and associted sizes at given parametric point. //! \param[in] param Parametric point to find elements at diff --git a/src/ASM/LR/ASMu3Dmx.C b/src/ASM/LR/ASMu3Dmx.C index f7dc6038..a5d17981 100644 --- a/src/ASM/LR/ASMu3Dmx.C +++ b/src/ASM/LR/ASMu3Dmx.C @@ -1069,3 +1069,11 @@ BasisFunctionVals ASMu3Dmx::BasisFunctionCache::calculatePt (size_t el, return this->calculatePrm(fe,du,el,gp,reduced); } + + +bool ASMu3Dmx::separateProjectionBasis () const +{ + return std::none_of(m_basis.begin(), m_basis.end(), + [this](const SplinePtr& entry) + { return entry == projB; }); +} diff --git a/src/ASM/LR/ASMu3Dmx.h b/src/ASM/LR/ASMu3Dmx.h index ccbe18d3..bc848a13 100644 --- a/src/ASM/LR/ASMu3Dmx.h +++ b/src/ASM/LR/ASMu3Dmx.h @@ -211,6 +211,9 @@ public: //! \brief Swaps between the main and alternative projection basis. virtual void swapProjectionBasis(); + //! \brief Checks if a separate projection basis is used for this patch. + virtual bool separateProjectionBasis() const; + private: //! \brief Finds the elements and associted sizes at given parametric point. //! \param[in] param Parametric point to find elements at