Index: /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
===================================================================
--- /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 17336)
+++ /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 17337)
@@ -715,23 +715,4 @@
 				}
 			}
-
-			/*Constraint at the bedrock interface (v.n = vz = 0) (Coordinates will be updated according to the bed slope)*/
-			if (iomodel->meshtype==Mesh3DEnum) if(nodeonbed[i]>0. && groundedice_ls[i]>=0. && nodeonFS[i]>0.){
-				 switch(reCast<int,IssmDouble>(vertices_type[i])){
-					case SSAFSApproximationEnum:
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,5,0.,StressbalanceAnalysisEnum));
-						count++;
-						break;
-					case HOFSApproximationEnum:
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,5,0.,StressbalanceAnalysisEnum));
-						count++;
-						break;
-					case FSApproximationEnum:
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0.,StressbalanceAnalysisEnum));
-						count++;
-						break;
-					default: _error_("Vertex approximation " << EnumToStringx(reCast<int,IssmDouble>(vertices_type[i])) << " not supported");
-				}
-			}
 		}
 	}
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 17336)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 17337)
@@ -2161,9 +2161,10 @@
 void  Penta::ResetFSBasalBoundaryCondition(void){
 
-	int        approximation;
-	int        numindices;
-	int       *indices = NULL;
-	IssmDouble slopex,slopey,groundedice;
-	IssmDouble xz_plane[6];
+	int          approximation;
+	int          numindices;
+	int         *indices = NULL;
+	IssmDouble   slopex,slopey,groundedice;
+	IssmDouble   xz_plane[6];
+	IssmDouble*  vertexapproximation= NULL;
 
 	/*For FS only: we want the CS to be tangential to the bedrock*/
@@ -2193,5 +2194,11 @@
 			xz_plane[1]=0.;       xz_plane[4]=-slopey;  
 			xz_plane[2]=slopex;   xz_plane[5]=1.;          
-			this->nodes[indices[i]]->DofInSSet(2); //vz 
+			if(this->nodes[indices[i]]->GetApproximation()==FSApproximationEnum){
+				this->nodes[indices[i]]->DofInSSet(2); //vz 
+			}
+			else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
+				this->nodes[indices[i]]->DofInSSet(4); //vz 
+			}
+			else _error_("approximation not implemented");
 		}
 		else{
@@ -2200,9 +2207,14 @@
 			xz_plane[1]=0.;       xz_plane[4]=0;  
 			xz_plane[2]=0;        xz_plane[5]=1.;          
-			this->nodes[indices[i]]->DofInFSet(2); //vz
+			if(this->nodes[indices[i]]->GetApproximation()==FSApproximationEnum){
+				this->nodes[indices[i]]->DofInFSet(2); //vz
+			}
+			else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
+				this->nodes[indices[i]]->DofInFSet(4); //vz 
+			}
+			else _error_("approximation not implemented");
 		}
 
 		XZvectorsToCoordinateSystem(&this->nodes[indices[i]]->coord_system[0][0],&xz_plane[0]);
-		
 	}
 
