From be59cecf9b4442d6b1ce5158147b27557f32e10a Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 31 Aug 2023 09:39:25 +0200 Subject: [PATCH] ASMu3D::getElementCoordinates: support a separate geometry basis --- src/ASM/LR/ASMu3D.C | 8 ++++++-- src/ASM/LR/ASMu3D.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ASM/LR/ASMu3D.C b/src/ASM/LR/ASMu3D.C index e145d1a6..9c5cfd36 100644 --- a/src/ASM/LR/ASMu3D.C +++ b/src/ASM/LR/ASMu3D.C @@ -705,7 +705,7 @@ double ASMu3D::getParametricVolume (int iel) const } -bool ASMu3D::getElementCoordinates (Matrix& X, int iel, bool) const +bool ASMu3D::getElementCoordinates (Matrix& X, int iel, bool forceItg) const { #ifdef INDEX_CHECK if (iel < 1 || (size_t)iel > MNPC.size()) @@ -715,8 +715,12 @@ bool ASMu3D::getElementCoordinates (Matrix& X, int iel, bool) const return false; } #endif + const LR::LRSplineVolume* spline = this->getBasis(forceItg ? ASM::INTEGRATION_BASIS + : ASM::GEOMETRY_BASIS); + if (spline != lrspline.get()) + iel = spline->getElementContaining(lrspline->getElement(iel-1)->midpoint()) + 1; - const LR::Element* el = lrspline->getElement(iel-1); + const LR::Element* el = spline->getElement(iel-1); X.resize(3,el->nBasisFunctions()); int n = 1; diff --git a/src/ASM/LR/ASMu3D.h b/src/ASM/LR/ASMu3D.h index 13e5dbb4..ccd4832e 100644 --- a/src/ASM/LR/ASMu3D.h +++ b/src/ASM/LR/ASMu3D.h @@ -147,7 +147,8 @@ public: //! \param[in] iel 1-based element index //! \param[out] X 3\f$\times\f$n-matrix, where \a n is the number of nodes //! in one element - virtual bool getElementCoordinates(Matrix& X, int iel, bool = false) const; + //! \param[in] forceItg If true return integration basis element coordinates + virtual bool getElementCoordinates(Matrix& X, int iel, bool forceItg = false) const; //! \brief Obtain element neighbours. virtual void getElmConnectivities(IntMat& neighs) const;