Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5730)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 5731)
@@ -4265,29 +4265,10 @@
 void Penta::GetParameterValue(double* pvalue,Node* node,int enumtype){
 
-	/*Output*/
-	double value;
-
-	/*Intermediaries*/
-	const int numnodes=6;
-	int       grid=-1;
-	int       i;
-	double gauss[numnodes][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
-
-	/*go through 3 nodes (all nodes for tria) and identify 1st and 2nd nodes: */
+	GaussPenta* gauss=new GaussPenta();
+
 	ISSMASSERT(nodes);
-	for(i=0;i<numnodes;i++){
-		if (node==nodes[i]){
-			grid=i;
-			break;
-		}
-	}
-
-	/*Check that the node has been found*/
-	if (grid==-1) ISSMERROR("Node pointer not found in Penta's nodes");
-
-	/*Get Parameter value on node*/
-	inputs->GetParameterValue(pvalue,&gauss[grid][0],enumtype);
-	return;
-
+	gauss->GaussVertex(this->GetNodeIndex(node));
+
+	inputs->GetParameterValue(pvalue,gauss,enumtype);
 }
 /*}}}*/
@@ -4337,5 +4318,5 @@
 	const int    numdofpervertex=2;
 	const int    numdof=numdofpervertex*NUMVERTICES;
-	double       gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
+	GaussPenta*  gauss;
 	int*         doflist=NULL;
 	double       values[numdof];
@@ -4358,9 +4339,11 @@
 	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
 	/*P1 element only for now*/
+	gauss=new GaussPenta();
 	for(i=0;i<NUMVERTICES;i++){
 
 		/*Recover vx and vy*/
-		inputs->GetParameterValue(&vx,&gauss[i][0],VxEnum);
-		inputs->GetParameterValue(&vy,&gauss[i][0],VyEnum);
+		gauss->GaussVertex(i);
+		inputs->GetParameterValue(&vx,gauss,VxEnum);
+		inputs->GetParameterValue(&vy,gauss,VyEnum);
 		values[i*numdofpervertex+0]=vx;
 		values[i*numdofpervertex+1]=vy;
@@ -4371,4 +4354,5 @@
 
 	/*Free ressources:*/
+	delete gauss;
 	xfree((void**)&doflist);
 }
@@ -4381,5 +4365,5 @@
 	const int    numdofpervertex=2;
 	const int    numdof=numdofpervertex*NUMVERTICES;
-	double       gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
+	GaussPenta*  gauss=NULL;
 	int*         doflist=NULL;
 	double       values[numdof];
@@ -4392,9 +4376,11 @@
 	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
 	/*P1 element only for now*/
+	gauss=new GaussPenta();
 	for(i=0;i<NUMVERTICES;i++){
 
 		/*Recover vx and vy*/
-		inputs->GetParameterValue(&vx,&gauss[i][0],VxEnum);
-		inputs->GetParameterValue(&vy,&gauss[i][0],VyEnum);
+		gauss->GaussVertex(i);
+		inputs->GetParameterValue(&vx,gauss,VxEnum);
+		inputs->GetParameterValue(&vy,gauss,VyEnum);
 		values[i*numdofpervertex+0]=vx;
 		values[i*numdofpervertex+1]=vy;
@@ -4405,4 +4391,5 @@
 
 	/*Free ressources:*/
+	delete gauss;
 	xfree((void**)&doflist);
 }
@@ -4415,5 +4402,5 @@
 	const int    numdofpervertex=1;
 	const int    numdof=numdofpervertex*NUMVERTICES;
-	double       gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
+	GaussPenta*  gauss=NULL;
 	int*         doflist=NULL;
 	double       values[numdof];
@@ -4425,8 +4412,10 @@
 	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
 	/*P1 element only for now*/
+	gauss=new GaussPenta();
 	for(i=0;i<NUMVERTICES;i++){
 
 		/*Recover vz */
-		inputs->GetParameterValue(&vz,&gauss[i][0],VxEnum);
+		gauss->GaussVertex(i);
+		inputs->GetParameterValue(&vz,gauss,VxEnum);
 		values[i]=vz;
 	}
@@ -4436,4 +4425,5 @@
 
 	/*Free ressources:*/
+	delete gauss;
 	xfree((void**)&doflist);
 }
@@ -4446,5 +4436,5 @@
 	const int    numdofpervertex=4;
 	const int    numdof=numdofpervertex*NUMVERTICES;
-	double       gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
+	GaussPenta  *gauss;
 	int*         doflist=NULL;
 	double       values[numdof];
@@ -4460,11 +4450,13 @@
 	/*Ok, we have vx vy vz and P in values, fill in vx vy vz P arrays: */
 	/*P1 element only for now*/
+	gauss=new GaussPenta();
 	for(i=0;i<NUMVERTICES;i++){
 
 		/*Recover vx and vy*/
-		inputs->GetParameterValue(&vx,&gauss[i][0],VxEnum);
-		inputs->GetParameterValue(&vy,&gauss[i][0],VyEnum);
-		inputs->GetParameterValue(&vz,&gauss[i][0],VzEnum);
-		inputs->GetParameterValue(&p ,&gauss[i][0],PressureEnum);
+		gauss->GaussVertex(i);
+		inputs->GetParameterValue(&vx,gauss,VxEnum);
+		inputs->GetParameterValue(&vy,gauss,VyEnum);
+		inputs->GetParameterValue(&vz,gauss,VzEnum);
+		inputs->GetParameterValue(&p ,gauss,PressureEnum);
 		values[i*numdofpervertex+0]=vx;
 		values[i*numdofpervertex+1]=vy;
@@ -4477,4 +4469,5 @@
 
 	/*Free ressources:*/
+	delete gauss;
 	xfree((void**)&doflist);
 }
@@ -4487,5 +4480,5 @@
 	const int    numdofpervertex=1;
 	const int    numdof=numdofpervertex*NUMVERTICES;
-	double       gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
+	GaussPenta  *gauss=NULL;
 	int*         doflist=NULL;
 	double       values[numdof];
@@ -4498,8 +4491,10 @@
 	/*Ok, we have vx and vy in values, fill in vx and vy arrays: */
 	/*P1 element only for now*/
+	gauss=new GaussPenta();
 	for(i=0;i<NUMVERTICES;i++){
 
 		/*Recover vz */
-		inputs->GetParameterValue(&vz,&gauss[i][0],TemperatureEnum);
+		gauss->GaussVertex(i);
+		inputs->GetParameterValue(&vz,gauss,TemperatureEnum);
 		values[i]=vz;
 	}
@@ -4509,4 +4504,5 @@
 	
 	/*Free ressources:*/
+	delete gauss;
 	xfree((void**)&doflist);
 }
@@ -4883,5 +4879,4 @@
 	double       rho_ice,g;
 	double       xyz_list[NUMVERTICES][3];
-	double       gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
 
 	Input  *vz_input        = NULL;
@@ -4976,5 +4971,4 @@
 	double       rho_ice,g;
 	double       xyz_list[NUMVERTICES][3];
-	double       gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
 
 	Input  *vz_input       = NULL;
@@ -5069,5 +5063,4 @@
 	double       rho_ice,g;
 	double       xyz_list[NUMVERTICES][3];
-	double       gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
 	
 	Input  *vz_input        = NULL;
@@ -5149,5 +5142,4 @@
 	double       rho_ice,g;
 	double       xyz_list[NUMVERTICES][3];
-	double       gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
 	
 	Input*       vz_input=NULL;
@@ -5229,5 +5221,4 @@
 	double       rho_ice,g;
 	double       xyz_list[NUMVERTICES][3];
-	double       gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};
 
 	Input*       vx_input=NULL;
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5730)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 5731)
@@ -5553,32 +5553,10 @@
 void Tria::GetParameterValue(double* pvalue,Node* node,int enumtype){
 
-	/*Output*/
-	double value;
-
-	/*Intermediaries*/
-	const int numnodes=3;
-	int       i;
-	double    gauss_tria[numnodes]={0.0};
-
-	/*go through 3 nodes (all nodes for tria) and identify node: */
+	GaussTria* gauss=new GaussTria();
+
 	ISSMASSERT(nodes);
-	for(i=0;i<numnodes;i++){
-		if (node==nodes[i]){
-
-			/*OK we have found the node, update the gauss point and get value*/
-			gauss_tria[i]=1.0;
-
-			/*Recover input*/
-			this->inputs->GetParameterValue(&value, &gauss_tria[0],enumtype);
-
-			/*Assign output pointers:*/
-			*pvalue=value;
-			return;
-
-		}
-	}
-
-	/*If we reach tis point, the node provided has not been found;*/
-	ISSMERROR("The node provided are either the same or did not match current Tria nodes");
+	gauss->GaussVertex(this->GetNodeIndex(node));
+
+	inputs->GetParameterValue(pvalue,gauss,enumtype);
 }
 /*}}}*/
