Index: issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 16478)
+++ issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 16479)
@@ -3038,14 +3038,15 @@
 			break;
 		case P1Enum:{
-
-			IssmDouble   values[NUMVERTICES];
+			IssmDouble  values[NUMVERTICES];
 			IssmPDouble pvalues[NUMVERTICES]; 
-			int          sidlist[NUMVERTICES];
-
-			GetVertexSidList(&sidlist[0]);
-			GetInputListOnVertices(&values[0],output_enum);
-			for(int i=0;i<NUMVERTICES;i++) pvalues[i] = reCast<IssmPDouble>(values[i]);
-
-			vector->SetValues(NUMVERTICES,&sidlist[0],&pvalues[0],INS_VAL);
+			int         connectivity[NUMVERTICES];
+			int         sidlist[NUMVERTICES];
+
+			this->GetVertexSidList(&sidlist[0]);
+			this->GetConnectivityList(&connectivity[0]);
+			this->GetInputListOnVertices(&values[0],output_enum);
+			for(int i=0;i<NUMVERTICES;i++) pvalues[i] = reCast<IssmPDouble>(values[i])/reCast<IssmPDouble>(connectivity[i]);
+
+			vector->SetValues(NUMVERTICES,&sidlist[0],&pvalues[0],ADD_VAL);
 			break;
 					}
@@ -5332,5 +5333,5 @@
 
 }/*}}}*/
-/*FUNCTION Penta::ControlInputSetGradient{{{*/
+/*FUNCTION Penta::ControlToVectors{{{*/
 void Penta::ControlToVectors(Vector<IssmDouble>* vector_control, Vector<IssmDouble>* vector_gradient,int control_enum){
 
@@ -5349,10 +5350,12 @@
 	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(control_enum) << " is not a ControlInput");
 
-	int          sidlist[NUMVERTICES];
-	IssmPDouble   values[NUMVERTICES];
+	int         sidlist[NUMVERTICES];
+	int         connectivity[NUMVERTICES];
+	IssmPDouble values[NUMVERTICES];
 	IssmPDouble gradients[NUMVERTICES]; 
 	IssmDouble  value,gradient;
 
-	GetVertexSidList(&sidlist[0]);
+	this->GetConnectivityList(&connectivity[0]);
+	this->GetVertexSidList(&sidlist[0]);
 
 	GaussPenta* gauss=new GaussPenta();
@@ -5363,11 +5366,11 @@
 		((ControlInput*)input)->GetGradientValue(&gradient,gauss);
 
-		values[iv]    = reCast<IssmPDouble>(value);
-		gradients[iv] = reCast<IssmPDouble>(gradient);
+		values[iv]    = reCast<IssmPDouble>(value)/reCast<IssmPDouble>(connectivity[iv]);
+		gradients[iv] = reCast<IssmPDouble>(gradient)/reCast<IssmPDouble>(connectivity[iv]);
 	}
 	delete gauss;
 
-	vector_control->SetValues(NUMVERTICES,&sidlist[0],&values[0],INS_VAL);
-	vector_gradient->SetValues(NUMVERTICES,&sidlist[0],&gradients[0],INS_VAL);
+	vector_control->SetValues(NUMVERTICES,&sidlist[0],&values[0],ADD_VAL);
+	vector_gradient->SetValues(NUMVERTICES,&sidlist[0],&gradients[0],ADD_VAL);
 
 }/*}}}*/
Index: issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 16478)
+++ issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 16479)
@@ -2592,14 +2592,15 @@
 			break;
 		case P1Enum:{
-
-			IssmDouble   values[NUMVERTICES];
+			IssmDouble  values[NUMVERTICES];
 			IssmPDouble pvalues[NUMVERTICES]; 
-			int          sidlist[NUMVERTICES];
-
-			GetVertexSidList(&sidlist[0]);
-			GetInputListOnVertices(&values[0],output_enum);
-			for(int i=0;i<NUMVERTICES;i++) pvalues[i] = reCast<IssmPDouble>(values[i]);
-
-			vector->SetValues(NUMVERTICES,&sidlist[0],&pvalues[0],INS_VAL);
+			int         connectivity[NUMVERTICES];
+			int         sidlist[NUMVERTICES];
+
+			this->GetVertexSidList(&sidlist[0]);
+			this->GetConnectivityList(&connectivity[0]);
+			this->GetInputListOnVertices(&values[0],output_enum);
+			for(int i=0;i<NUMVERTICES;i++) pvalues[i] = reCast<IssmPDouble>(values[i])/reCast<IssmPDouble>(connectivity[i]);
+
+			vector->SetValues(NUMVERTICES,&sidlist[0],&pvalues[0],ADD_VAL);
 			break;
 					}
@@ -4873,5 +4874,5 @@
 
 }/*}}}*/
-/*FUNCTION Tria::ControlInputSetGradient{{{*/
+/*FUNCTION Tria::ControlToVectors{{{*/
 void Tria::ControlToVectors(Vector<IssmDouble>* vector_control, Vector<IssmDouble>* vector_gradient,int control_enum){
 
@@ -4886,10 +4887,12 @@
 	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(control_enum) << " is not a ControlInput");
 
-	int          sidlist[NUMVERTICES];
-	IssmPDouble   values[NUMVERTICES];
+	int         sidlist[NUMVERTICES];
+	int         connectivity[NUMVERTICES];
+	IssmPDouble values[NUMVERTICES];
 	IssmPDouble gradients[NUMVERTICES]; 
 	IssmDouble  value,gradient;
 
-	GetVertexSidList(&sidlist[0]);
+	this->GetConnectivityList(&connectivity[0]);
+	this->GetVertexSidList(&sidlist[0]);
 
 	GaussTria* gauss=new GaussTria();
@@ -4900,11 +4903,11 @@
 		((ControlInput*)input)->GetGradientValue(&gradient,gauss);
 
-		values[iv]    = reCast<IssmPDouble>(value);
-		gradients[iv] = reCast<IssmPDouble>(gradient);
+		values[iv]    = reCast<IssmPDouble>(value)/reCast<IssmPDouble>(connectivity[iv]);
+		gradients[iv] = reCast<IssmPDouble>(gradient)/reCast<IssmPDouble>(connectivity[iv]);
 	}
 	delete gauss;
 
-	vector_control->SetValues(NUMVERTICES,&sidlist[0],&values[0],INS_VAL);
-	vector_gradient->SetValues(NUMVERTICES,&sidlist[0],&gradients[0],INS_VAL);
+	vector_control->SetValues(NUMVERTICES,&sidlist[0],&values[0],ADD_VAL);
+	vector_gradient->SetValues(NUMVERTICES,&sidlist[0],&gradients[0],ADD_VAL);
 
 }/*}}}*/
