Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 24425)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 24426)
@@ -2214,4 +2214,7 @@
 	Penta* penta = this;
 	int    step  = 0;
+	Gauss* gauss[3];
+	for(int iv=0;iv<3;iv++) gauss[iv] = penta->NewGaussLine(iv,iv+3,3);
+
 	for(;;){
 
@@ -2229,13 +2232,11 @@
 			}
 			/*Integrate over edge*/
-			Gauss* gauss=penta->NewGaussLine(iv,iv+3,3);
-			for(int ig=gauss->begin();ig<gauss->end();ig++){
-				gauss->GaussPoint(ig);
-				penta->JacobianDeterminantLine(&Jdet,&xyz_list_line[0][0],gauss);
-				original_input->GetInputValue(&value,gauss);
-				total[iv] += value*Jdet*gauss->weight;
-				intz[iv]  += Jdet*gauss->weight;
+			for(int ig=gauss[iv]->begin();ig<gauss[iv]->end();ig++){
+				gauss[iv]->GaussPoint(ig);
+				penta->JacobianDeterminantLine(&Jdet,&xyz_list_line[0][0],gauss[iv]);
+				original_input->GetInputValue(&value,gauss[iv]);
+				total[iv] += value*Jdet*gauss[iv]->weight;
+				intz[iv]  += Jdet*gauss[iv]->weight;
 			}
-			delete gauss;
 		}
 
@@ -2247,4 +2248,5 @@
 		step++;
 	}
+	for(int iv=0;iv<3;iv++) delete gauss[iv];
 
 	/*Now we only need to divide the depth integrated input by the total thickness!*/
