Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 16656)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 16657)
@@ -2164,4 +2164,17 @@
 }
 /*}}}*/
+/*FUNCTION Tria::HasNodeOnBed {{{*/
+bool Tria::HasNodeOnBed(){
+
+	IssmDouble values[NUMVERTICES];
+	IssmDouble sum;
+
+	/*Retrieve all inputs and parameters*/
+	GetInputListOnVertices(&values[0],MeshVertexonbedEnum);
+	sum = values[0]+values[1]+values[2];
+
+	return sum>0.;
+}
+/*}}}*/
 /*FUNCTION Tria::HasEdgeOnSurface {{{*/
 bool Tria::HasEdgeOnSurface(){
@@ -2184,4 +2197,17 @@
 		return false;
 	}
+}
+/*}}}*/
+/*FUNCTION Tria::HasNodeOnSurface {{{*/
+bool Tria::HasNodeOnSurface(){
+
+	IssmDouble values[NUMVERTICES];
+	IssmDouble sum;
+
+	/*Retrieve all inputs and parameters*/
+	GetInputListOnVertices(&values[0],MeshVertexonbedEnum);
+	sum = values[0]+values[1]+values[2];
+
+	return sum>0.;
 }
 /*}}}*/
@@ -2805,19 +2831,21 @@
 void  Tria::UpdateConstraintsExtrudeFromBase(void){
 
-	if(!HasEdgeOnBed()) return;
-
-	int extrusioninput;
-	int indices[2];
-	IssmDouble value;
+	if(!HasNodeOnBed()) return;
+
+	int        extrusioninput;
+	IssmDouble value,isonbed;
 
 	this->parameters->FindParam(&extrusioninput,InputToExtrudeEnum);
-	Input* input = inputs->GetInput(extrusioninput); _assert_(extrusioninput);
-	this->EdgeOnBedIndices(&indices[0],&indices[1]);
+	Input* input = inputs->GetInput(extrusioninput);      _assert_(extrusioninput);
+	Input* onbed = inputs->GetInput(MeshVertexonbedEnum); _assert_(onbed);
 
 	GaussTria* gauss=new GaussTria();
-	for(int i=0;i<2;i++){
-		gauss->GaussNode(P1Enum,indices[i]);
-		input->GetInputValue(&value,gauss);
-		this->nodes[indices[i]]->ApplyConstraint(1,value);
+	for(int iv=0;iv<this->NumberofNodes();iv++){
+		gauss->GaussNode(this->element_type,iv);
+		onbed->GetInputValue(&isonbed,gauss);
+		if(isonbed==1.){
+			input->GetInputValue(&value,gauss);
+			this->nodes[iv]->ApplyConstraint(1,value);
+		}
 	}
 	delete gauss;
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 16656)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 16657)
@@ -86,5 +86,7 @@
 		bool        IsOnBed();
 		bool        HasEdgeOnBed();
+		bool        HasNodeOnBed();
 		bool        HasEdgeOnSurface();
+		bool        HasNodeOnSurface();
 		void        EdgeOnSurfaceIndices(int* pindex1,int* pindex);
 		void        EdgeOnBedIndices(int* pindex1,int* pindex);
Index: /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 16656)
+++ /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 16657)
@@ -269,6 +269,11 @@
 				for(j=0;j<this->row_fsize;j++){
 					*(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);
+					//if(this->row_fglobaldoflist[i]==0 && this->row_fglobaldoflist[j]==304) printf("rank = %i\n",IssmComm::GetRank());
+					if(this->row_fglobaldoflist[i]==0 && *(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j])!=0.){
+						//printf("[%i] dof = %i\n",IssmComm::GetRank(),this->row_fglobaldoflist[j]);
+					}
 				}
 			}
+
 			/*add local values into global  matrix, using the fglobaldoflist: */
 			Kff->SetValues(this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,localvalues,ADD_VAL);
