Index: /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 9080)
+++ /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 9081)
@@ -60,5 +60,5 @@
 		}
 	}
-	else{
+	else if (M==iomodel->numberofvertices+1){
 		/*transient: create transient Spct objects. Same logic, except we need to retrieve 
 		 * various times and values to initialize an Spct object: */
@@ -95,4 +95,7 @@
 		}
 	}
+	else{
+		_error_("Size of field %s not supported",EnumToStringx(vector_enum));
+	}
 
 	/*Free ressources:*/
@@ -100,4 +103,3 @@
 	xfree((void**)&times);
 	xfree((void**)&values);
-
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp	(revision 9080)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp	(revision 9081)
@@ -1,7 +1,4 @@
-/*
- * CreateConstraintsBalancethickness.c:
- */
-
 #include "../../../Container/Container.h"
+#include "../../../modules/modules.h"
 #include "../../../io/io.h"
 #include "../../../toolkits/toolkits.h"
@@ -12,8 +9,4 @@
 
 void	CreateConstraintsBalancethickness(Constraints** pconstraints, IoModel* iomodel,FILE* iomodel_handle){
-
-	/*Intermediary*/
-	int i;
-	int count;
 
 	/*Output*/
@@ -28,26 +21,5 @@
 	/*Do not add constraints in DG*/
 	if(!iomodel->prognostic_DG){
-
-		/*Fetch data: */
-		IoModelFetchData(&iomodel->spcthickness,NULL,NULL,iomodel_handle,SpcthicknessEnum);
-
-		/*Initialize counter*/
-		count=0;
-
-		/*Create spcs from x,y,z, as well as the spc values on those spcs: */
-		for (i=0;i<iomodel->numberofvertices;i++){
-			if(iomodel->my_vertices[i]){
-
-				if ((int)iomodel->spcthickness[2*i]){
-
-					constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,
-									*(iomodel->spcthickness+2*i+1),BalancethicknessAnalysisEnum));//we enforce first translation degree of freedom, for temperature
-					count++;
-				}
-			}
-		}
-
-		/*Free data: */
-		xfree((void**)&iomodel->spcthickness);
+		IoModelToConstraintsx(constraints,iomodel,iomodel_handle,SpcthicknessEnum,BalancethicknessAnalysisEnum);
 	}
 
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 9080)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp	(revision 9081)
@@ -10,11 +10,6 @@
 void	CreateConstraintsPrognostic(Constraints** pconstraints, IoModel* iomodel,FILE* iomodel_handle){
 
-	/*Intermediary*/
-	int i;
-	int count;
-	
 	/*Output*/
 	Constraints *constraints = NULL;
-	Spc         *spc         = NULL;
 
 	/*Recover pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 9080)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp	(revision 9081)
@@ -27,11 +27,8 @@
 	if(!constraints) constraints = new Constraints(ConstraintsEnum);
 
-	/*return if 2d mesh*/
-	if (iomodel->dim==2) goto cleanup_and_return;
-
-	/*Create constraints: */
-	IoModelToConstraintsx(constraints,iomodel,iomodel_handle,SpctemperatureEnum,ThermalAnalysisEnum);
-
-	cleanup_and_return:
+	/*Only 3d mesh supported*/
+	if (iomodel->dim==3){
+		IoModelToConstraintsx(constraints,iomodel,iomodel_handle,SpctemperatureEnum,ThermalAnalysisEnum);
+	}
 
 	/*Assign output pointer: */
