From 4f09edbacf7aad6ff1ed852306dc6cef51b0d309 Mon Sep 17 00:00:00 2001
From: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
Date: Mon, 10 Sep 2012 12:37:08 +0000
Subject: [PATCH] gauss quadrature prism : allow higher order

---
 Numeric/GaussQuadraturePri.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Numeric/GaussQuadraturePri.cpp b/Numeric/GaussQuadraturePri.cpp
index 1e9907d9e1..7e6900479c 100644
--- a/Numeric/GaussQuadraturePri.cpp
+++ b/Numeric/GaussQuadraturePri.cpp
@@ -10,14 +10,16 @@
 IntPt *getGQPriPts(int order);
 int getNGQPriPts(int order);
 
-IntPt * GQP[28] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+IntPt * GQP[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
 
 IntPt *getGQPriPts(int order)
 { 
   int nLin = (order+3)/2;
   int nTri = getNGQTPts(order);
   int n = nLin*nTri;
-  int index = n;
+  int index = order;
+  if (order >= sizeof(GQP) / sizeof(IntPt*))
+    Msg::Fatal("Increase size of GQP in gauss quadrature prism");
   if(!GQP[index])
     {
       double *linPt,*linWt;
-- 
GitLab