Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp	(revision 3452)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp	(revision 3453)
@@ -10,5 +10,4 @@
 #include "../IoModel.h"
 
-
 void	CreateConstraintsDiagnosticStokes(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
 
@@ -18,12 +17,5 @@
 
 	/*spc intermediary data: */
-	int spc_sid;
-	int spc_node;
-	int spc_dof;
-	double spc_value;
-	int count;
-	
 	double* gridonstokes=NULL;
-
 
 	/*Create constraints: */
@@ -36,47 +28,23 @@
 	IoModelFetchData(&gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");
 
-	count=0;
+	count=1; //matlab indexing
 	/*Create spcs from x,y,z, as well as the spc values on those spcs: */
 	for (i=0;i<iomodel->numberofvertices;i++){
-	#ifdef _PARALLEL_
-	/*keep only this partition's nodes:*/
-	if((iomodel->my_vertices[i]==1)){
-	#endif
+		/*keep only this partition's nodes:*/
+		if((iomodel->my_vertices[i]==1)){
 
-		if ((int)!gridonstokes[i]){
-	
-			/*This grid will see its vx,vy and vz dofs spc'd to pattyn velocities: */
-			spc_sid=count;
-			spc_node=i+1;
-			spc_dof=1; //we enforce first x translation degree of freedom
-			spc_value=0;
+			if ((int)!gridonstokes[i]){
 
-			spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
-			constraints->AddObject(spc);
-			count++;
+				/*This grid will see its vx,vy and vz dofs spc'd to pattyn velocities: */
+				constraints->AddObject(new Spc(count,i+1,1,0));
+				count++;
 
-			spc_sid=count;
-			spc_node=i+1;
-			spc_dof=2; //we enforce first y translation degree of freedom
-			spc_value=0;
-			
-			spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
-			constraints->AddObject(spc);
-			count++;
-			
-			spc_sid=count;
-			spc_node=i+1;
-			spc_dof=3; //we enforce first y translation degree of freedom
-			spc_value=0;
-			
-			spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
-			constraints->AddObject(spc);
-			count++;
+				constraints->AddObject(new Spc(count,i+1,2,0));
+				count++;
 
-		}
-
-	#ifdef _PARALLEL_
-	} //if((my_vertices[i]==1))
-	#endif
+				constraints->AddObject(new Spc(count,i+1,3,0));
+				count++;
+			}
+		} //if((my_vertices[i]==1))
 	}
 
