From 40520ac66f1eaace0a5c7b42498385ce4ad90af1 Mon Sep 17 00:00:00 2001
From: Thomas Toulorge <thomas.toulorge@mines-paristech.fr>
Date: Fri, 11 Jan 2013 11:34:27 +0000
Subject: [PATCH] Fixed bug in pyramidalBasis

---
 Numeric/pyramidalBasis.cpp | 12 ++++++------
 Numeric/pyramidalBasis.h   |  4 +++-
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/Numeric/pyramidalBasis.cpp b/Numeric/pyramidalBasis.cpp
index f7baa6508c..a977a06d6e 100644
--- a/Numeric/pyramidalBasis.cpp
+++ b/Numeric/pyramidalBasis.cpp
@@ -13,11 +13,7 @@ pyramidalBasis::pyramidalBasis(int tag) : nodalBasis(tag)
 
   bergot = new BergotBasis(order);
 
-  int n = order+1;
-  int num_points = n*(n+1)*(2*n+1)/6;
-  if (serendip && (order > 2)) {
-    num_points -= (order-2)*((order-2)+1)*(2*(order-2)+1)/6;
-  }
+  int num_points = points.size1();
 
   VDMinv.resize(num_points, num_points);
   double *fval = new double[num_points];
@@ -43,6 +39,10 @@ pyramidalBasis::~pyramidalBasis()
 
 
 
+int pyramidalBasis::getNumShapeFunctions() const { return points.size1(); }
+
+
+
 void pyramidalBasis::f(double u, double v, double w, double *val) const
 {
 
@@ -62,7 +62,7 @@ void pyramidalBasis::f(double u, double v, double w, double *val) const
 
 
 
-void pyramidalBasis::f(const fullMatrix<double> &coord, fullMatrix<double> &sf)
+void pyramidalBasis::f(const fullMatrix<double> &coord, fullMatrix<double> &sf) const
 {
 
   const int N = bergot->size(), NPts = coord.size1();
diff --git a/Numeric/pyramidalBasis.h b/Numeric/pyramidalBasis.h
index d04f309b50..b570a9b1e1 100644
--- a/Numeric/pyramidalBasis.h
+++ b/Numeric/pyramidalBasis.h
@@ -27,10 +27,12 @@ class pyramidalBasis: public nodalBasis
   ~pyramidalBasis();
 
   virtual void f(double u, double v, double w, double *val) const;
-  virtual void f(const fullMatrix<double> &coord, fullMatrix<double> &sf);
+  virtual void f(const fullMatrix<double> &coord, fullMatrix<double> &sf) const;
   virtual void df(double u, double v, double w, double grads[][3]) const;
   virtual void df(const fullMatrix<double> &coord, fullMatrix<double> &dfm) const;
 
+  virtual int getNumShapeFunctions() const;
+
 };
 
 
-- 
GitLab