Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15737)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15738)
@@ -500,5 +500,5 @@
 	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
 
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateKMatrixPrognostic();
 	delete tria->material; delete tria;
@@ -517,5 +517,5 @@
 	if (!IsOnBed()) return NULL;
 
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateMassMatrix();
 	delete tria->material; delete tria;
@@ -675,5 +675,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementVector* pe=tria->CreatePVectorPrognostic();
 	delete tria->material; delete tria;
@@ -693,5 +693,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementVector* pe=tria->CreatePVectorSlope();
 	delete tria->material; delete tria;
@@ -3159,5 +3159,5 @@
 		/*This element should be collapsed into a tria element at its base. Create this tria element, 
 		 * and compute SurfaceArea*/
-		tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face).
+		tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 		S=tria->SurfaceArea();
 		delete tria->material; delete tria;
@@ -3166,5 +3166,5 @@
 	else{
 
-		tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face).
+		tria=(Tria*)SpawnTria(1); //lower face is 0, upper face is 1.
 		S=tria->SurfaceArea();
 		delete tria->material; delete tria;
@@ -3655,5 +3655,5 @@
 
 	/*Spawn Tria element from the base of the Penta: */
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	mass_flux=tria->MassFlux(segment);
 	delete tria->material; delete tria;
@@ -4038,5 +4038,5 @@
 	if (!IsOnBed()) return NULL;
 
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateKMatrixMelting();
 
@@ -5079,5 +5079,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateKMatrixAdjointSSA();
 	delete tria->material; delete tria;
@@ -5262,5 +5262,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementVector* pe=tria->CreatePVectorAdjointHoriz();
 	delete tria->material; delete tria;
@@ -5749,5 +5749,5 @@
 		case DragCoefficientAbsGradientEnum:
 			if(IsOnBed()){
-				tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+				tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 				tria->GradjDragGradient(gradient,resp,control_index);
 				delete tria->material; delete tria;
@@ -5756,5 +5756,5 @@
 		case RheologyBbarAbsGradientEnum:
 			if(IsOnBed()){
-				tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+				tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 				tria->GradjBGradient(gradient,resp,control_index);
 				delete tria->material; delete tria;
@@ -5774,5 +5774,5 @@
 
 	/*Spawn tria*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	tria->GradjDragSSA(gradient,control_index);
 	delete tria->material; delete tria;
@@ -5952,5 +5952,5 @@
 
 	/*Collapse element to the base*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face).
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	tria->GradjBSSA(gradient,control_index);
 	delete tria->material; delete tria;
@@ -6162,5 +6162,5 @@
 		/*This element should be collapsed into a tria element at its base. Create this tria element, 
 		 * and compute SurfaceAverageVelMisfit*/
-		tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face).
+		tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 		J=tria->SurfaceAverageVelMisfit(weight_index);
 		delete tria->material; delete tria;
@@ -6169,5 +6169,5 @@
 	else{
 
-		tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face).
+		tria=(Tria*)SpawnTria(1); //lower face is 0, upper face is 1.
 		J=tria->SurfaceAverageVelMisfit(weight_index);
 		delete tria->material; delete tria;
@@ -6199,5 +6199,5 @@
 		/*This element should be collapsed into a tria element at its base. Create this tria element, 
 		 * and compute SurfaceAbsVelMisfit*/
-		tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face).
+		tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 		J=tria->SurfaceAbsVelMisfit(weight_index);
 		delete tria->material; delete tria;
@@ -6206,5 +6206,5 @@
 	else{
 
-		tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face).
+		tria=(Tria*)SpawnTria(1); //lower face is 0, upper face is 1.
 		J=tria->SurfaceAbsVelMisfit(weight_index);
 		delete tria->material; delete tria;
@@ -6236,5 +6236,5 @@
 		/*This element should be collapsed into a tria element at its base. Create this tria element, 
 		 * and compute SurfaceLogVelMisfit*/
-		tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face).
+		tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 		J=tria->SurfaceLogVelMisfit(weight_index);
 		delete tria->material; delete tria;
@@ -6243,5 +6243,5 @@
 	else{
 
-		tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face).
+		tria=(Tria*)SpawnTria(1); //lower face is 0, upper face is 1.
 		J=tria->SurfaceLogVelMisfit(weight_index);
 		delete tria->material; delete tria;
@@ -6275,5 +6275,5 @@
 		/*This element should be collapsed into a tria element at its base. Create this tria element, 
 		 * and compute SurfaceLogVxVyMisfit*/
-		tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face).
+		tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 		J=tria->SurfaceLogVxVyMisfit(weight_index);
 		delete tria->material; delete tria;
@@ -6282,5 +6282,5 @@
 	else{
 
-		tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face).
+		tria=(Tria*)SpawnTria(1); //lower face is 0, upper face is 1.
 		J=tria->SurfaceLogVxVyMisfit(weight_index);
 		delete tria->material; delete tria;
@@ -6312,5 +6312,5 @@
 		/*This element should be collapsed into a tria element at its base. Create this tria element, 
 		 * and compute SurfaceRelVelMisfit*/
-		tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria (lower face).
+		tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 		J=tria->SurfaceRelVelMisfit(weight_index);
 		delete tria->material; delete tria;
@@ -6319,5 +6319,5 @@
 	else{
 
-		tria=(Tria*)SpawnTria(1); //nodes 3, 4 and 5 make the new tria (upper face).
+		tria=(Tria*)SpawnTria(1); //lower face is 0, upper face is 1.
 		J=tria->SurfaceRelVelMisfit(weight_index);
 		delete tria->material; delete tria;
@@ -6361,5 +6361,5 @@
 	if(IsOnWater()|| IsFloating() || !IsOnBed()) return 0;
 
-	tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria
+	tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1
 	J=tria->DragCoefficientAbsGradient(weight_index);
 	delete tria->material; delete tria;
@@ -6376,5 +6376,5 @@
 	if(IsOnWater() || !IsOnBed()) return 0;
 
-	tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria
+	tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1
 	J=tria->RheologyBbarAbsGradient(weight_index);
 	delete tria->material; delete tria;
@@ -6680,5 +6680,5 @@
 	/*Find penta on bed as HO must be coupled to the dofs on the bed: */
 	Penta* pentabase=GetBasalElement();
-	Tria*  tria=pentabase->SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria*  tria=pentabase->SpawnTria(0); //lower face is 0, upper face is 1.
 
 	/*Prepare node list*/
@@ -6877,5 +6877,5 @@
 	/*Find penta on bed as FS must be coupled to the dofs on the bed: */
 	Penta* pentabase=GetBasalElement();
-	Tria* tria=pentabase->SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=pentabase->SpawnTria(0); //lower face is 0, upper face is 1.
 
 	/*Prepare node list*/
@@ -7234,5 +7234,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticSSA();
 	delete tria->material; delete tria;
@@ -7285,5 +7285,5 @@
 	/*Find penta on bed as this is a SSA elements: */
 	pentabase=GetBasalElement();
-	tria=pentabase->SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	tria=pentabase->SpawnTria(0); //lower face is 0, upper face is 1.
 
 	/*Initialize Element matrix*/
@@ -7357,5 +7357,5 @@
 	 * the tria functionality to build a friction stiffness matrix on these 3
 	 * nodes: */
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticSSAFriction();
 	delete tria->material; delete tria;
@@ -7433,5 +7433,5 @@
 	/*Find penta on bed as this is a SSA elements: */
 	pentabase=GetBasalElement();
-	tria=pentabase->SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	tria=pentabase->SpawnTria(0); //lower face is 0, upper face is 1.
 
 	/*Initialize Element matrix*/
@@ -7488,5 +7488,5 @@
 	 * the tria functionality to build a friction stiffness matrix on these 3
 	 * nodes: */
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateKMatrixDiagnosticSSAFriction();
 	delete tria->material; delete tria;
@@ -8515,5 +8515,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementVector* pe=tria->CreatePVectorDiagnosticSSA();
 	delete tria->material; delete tria;
@@ -8529,5 +8529,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementVector* pe=tria->CreatePVectorDiagnosticSSA();
 	delete tria->material; delete tria;
@@ -9214,5 +9214,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateJacobianDiagnosticSSA();
 	delete tria->material; delete tria;
@@ -10446,5 +10446,5 @@
 
 	/*Spawn Tria element from the base of the Penta: */
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateKMatrixBalancethickness();
 	delete tria->material; delete tria;
@@ -10468,5 +10468,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementVector* pe=tria->CreatePVectorBalancethickness();
 	delete tria->material; delete tria;
@@ -10488,5 +10488,5 @@
 	if (!IsOnBed()) return NULL;
 
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateKMatrixHydrologyDCInefficient();
 	delete tria->material; delete tria;
@@ -10501,5 +10501,5 @@
 	if (!IsOnBed()) return NULL;
 
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementMatrix* Ke=tria->CreateKMatrixHydrologyDCEfficient();
 	delete tria->material; delete tria;
@@ -10515,5 +10515,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementVector* pe=tria->CreatePVectorHydrologyDCInefficient();
 	delete tria->material; delete tria;
@@ -10529,5 +10529,5 @@
 
 	/*Call Tria function*/
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	ElementVector* pe=tria->CreatePVectorHydrologyDCEfficient();
 	delete tria->material; delete tria;
@@ -10542,5 +10542,5 @@
 	if (!IsOnBed()) return;
 
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	tria->GetHydrologyDCInefficientHmax(ph_max,innode);
 	delete tria->material; delete tria;
@@ -10552,5 +10552,5 @@
 	if (!IsOnBed()) return;
 
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	tria->GetHydrologyTransfer(transfer);
 	delete tria->material; delete tria;
@@ -10593,5 +10593,5 @@
 	if (!IsOnBed())return;
 
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	tria->HydrologyEPLGetActive(active_vec);
 	delete tria->material; delete tria;
@@ -10604,5 +10604,5 @@
 	if (!IsOnBed())return;
 
-	Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.
+	Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.
 	tria->HydrologyEPLGetMask(vec_mask);
 	delete tria->material; delete tria;
@@ -10646,5 +10646,5 @@
 		kappa=kmax*pow(10.,penalty_factor);
 
-		Tria* tria=(Tria*)SpawnTria(0); //nodes 0, 1 and 2 make the new tria.	
+		Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1.	
 		for(int i=0;i<NUMVERTICES2D;i++){
 			tria->GetHydrologyDCInefficientHmax(&h_max,nodes[i]);
