From e1f6f6d1afe7669bf39ffcb13dbe17f104339d8d Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 13 Mar 2017 10:19:12 +0100 Subject: [PATCH] no need to copy C matrix make evaluateBasis take const references to make this possible --- src/ASM/LR/ASMu3D.C | 5 +++-- src/ASM/LR/ASMu3D.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ASM/LR/ASMu3D.C b/src/ASM/LR/ASMu3D.C index 69e44948..6624e765 100644 --- a/src/ASM/LR/ASMu3D.C +++ b/src/ASM/LR/ASMu3D.C @@ -835,7 +835,8 @@ void ASMu3D::evaluateBasis (FiniteElement &el, Matrix &dNdu) const } } -void ASMu3D::evaluateBasis (FiniteElement &el, Matrix &dNdu, Matrix &C, Matrix &B) const +void ASMu3D::evaluateBasis (FiniteElement &el, Matrix &dNdu, + const Matrix &C, const Matrix &B) const { PROFILE2("BeSpline evaluation"); Matrix N = C*B; @@ -985,7 +986,7 @@ bool ASMu3D::integrate (Integrand& integrand, FiniteElement fe(nBasis); fe.iel = iEl+1; - Matrix C = bezierExtract[iEl]; + const Matrix& C = bezierExtract[iEl]; Matrix dNdu, Xnod, Jac; Matrix3D d2Ndu2, Hess; double dXidu[3]; diff --git a/src/ASM/LR/ASMu3D.h b/src/ASM/LR/ASMu3D.h index 07bb7f14..530e04cb 100644 --- a/src/ASM/LR/ASMu3D.h +++ b/src/ASM/LR/ASMu3D.h @@ -424,7 +424,8 @@ protected: virtual void evaluateBasis(FiniteElement &el, int derivs) const; //! \brief Evaluate all basis functions and first derivatives on one element - virtual void evaluateBasis(FiniteElement &el, Matrix &dNdu, Matrix &C, Matrix &B) const ; + virtual void evaluateBasis(FiniteElement &el, Matrix &dNdu, + const Matrix &C, const Matrix &B) const; //! \brief Evaluate all basis functions and first derivatives on one element virtual void evaluateBasis(FiniteElement &el, Matrix &dNdu) const;