Index: /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 9732)
+++ /issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	(revision 9733)
@@ -163,8 +163,9 @@
 	MeshVertexonsurfaceEnum,
 	MeshElements2dEnum,
+	MeshElementsEnum,
+	MeshEdgesEnum,
 	/*}}}*/
 	/*Datasets {{{1*/
 	ConstraintsEnum,
-	ElementsEnum,
 	LoadsEnum,
 	MaterialsEnum,
@@ -474,5 +475,4 @@
 	YEnum,
 	ZEnum,
-	EdgesEnum,
 	XEnum,
 	OutputfilenameEnum,
Index: /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	(revision 9733)
@@ -167,6 +167,7 @@
 		case MeshVertexonsurfaceEnum : return "MeshVertexonsurface";
 		case MeshElements2dEnum : return "MeshElements2d";
+		case MeshElementsEnum : return "MeshElements";
+		case MeshEdgesEnum : return "MeshEdges";
 		case ConstraintsEnum : return "Constraints";
-		case ElementsEnum : return "Elements";
 		case LoadsEnum : return "Loads";
 		case MaterialsEnum : return "Materials";
@@ -417,5 +418,4 @@
 		case YEnum : return "Y";
 		case ZEnum : return "Z";
-		case EdgesEnum : return "Edges";
 		case XEnum : return "X";
 		case OutputfilenameEnum : return "Outputfilename";
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp	(revision 9733)
@@ -36,5 +36,5 @@
 
 		/*Get edges and elements*/
-		iomodel->FetchData(3,EdgesEnum,ElementsEnum,ThicknessEnum);
+		iomodel->FetchData(3,MeshEdgesEnum,MeshElementsEnum,ThicknessEnum);
 
 		/*First load data:*/
@@ -42,5 +42,5 @@
 
 			/*Get left and right elements*/
-			element=(int)iomodel->Data(EdgesEnum)[4*i+2]-1; //edges are [node1 node2 elem1 elem2]
+			element=(int)iomodel->Data(MeshEdgesEnum)[4*i+2]-1; //edges are [node1 node2 elem1 elem2]
 
 			/*Now, if this element is not in the partition, pass: */
@@ -52,5 +52,5 @@
 
 		/*Free data: */
-		iomodel->DeleteData(3,EdgesEnum,ElementsEnum,ThicknessEnum);
+		iomodel->DeleteData(3,MeshEdgesEnum,MeshElementsEnum,ThicknessEnum);
 	}
 
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp	(revision 9733)
@@ -49,5 +49,5 @@
 
 	/*First fetch data: */
-	iomodel->FetchData(7,ElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+	iomodel->FetchData(7,MeshElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
 
 	if(continuous_galerkin){
@@ -72,5 +72,5 @@
 
 					//Get index of the vertex on which the current node is located
-					vertex_id=(int)*(iomodel->Data(ElementsEnum)+3*i+j); //(Matlab indexing)
+					vertex_id=(int)*(iomodel->Data(MeshElementsEnum)+3*i+j); //(Matlab indexing)
 					io_index=vertex_id-1;                      //(C indexing)
 					_assert_(vertex_id>0 && vertex_id<=numberofvertices);
@@ -88,5 +88,5 @@
 
 	/*Clean fetched data: */
-	iomodel->DeleteData(7,ElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+	iomodel->DeleteData(7,MeshElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
 
 	/*Assign output pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp	(revision 9733)
@@ -22,5 +22,5 @@
 	iomodel->Constant(&dim,MeshDimensionEnum);
 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 
 	/*Update elements: */
@@ -52,4 +52,4 @@
 	}
 	/*Free data: */
-	iomodel->DeleteData(1,ElementsEnum);
+	iomodel->DeleteData(1,MeshElementsEnum);
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp	(revision 9733)
@@ -22,5 +22,5 @@
 	iomodel->Constant(&dim,MeshDimensionEnum);
 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 
 	/*Update elements: */
@@ -44,4 +44,4 @@
 	
 	/*Free data: */
-	iomodel->DeleteData(1,ElementsEnum);
+	iomodel->DeleteData(1,MeshElementsEnum);
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 9733)
@@ -35,5 +35,5 @@
 
 	/*Fetch data needed: */
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 	iomodel->FetchDataToInput(elements,InversionVxObsEnum);
 	iomodel->FetchDataToInput(elements,InversionVyObsEnum); 
@@ -66,4 +66,4 @@
 	
 	/*Free data: */
-	iomodel->DeleteData(1+4+5,ElementsEnum,InversionControlParametersEnum,InversionCostFunctionsCoefficientsEnum,InversionMinParametersEnum,InversionMaxParametersEnum,BalancethicknessThickeningRateEnum,VxEnum,VyEnum,FrictionCoefficientEnum,MaterialsRheologyBEnum);
+	iomodel->DeleteData(1+4+5,MeshElementsEnum,InversionControlParametersEnum,InversionCostFunctionsCoefficientsEnum,InversionMinParametersEnum,InversionMaxParametersEnum,BalancethicknessThickeningRateEnum,VxEnum,VyEnum,FrictionCoefficientEnum,MaterialsRheologyBEnum);
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 9733)
@@ -37,5 +37,5 @@
 
 	/*First create the elements, vertices, nodes and material properties, if they don't already exist */
-	elements  = new Elements(ElementsEnum);
+	elements  = new Elements(MeshElementsEnum);
 	vertices  = new Vertices(VerticesEnum);
 	materials = new Materials(MaterialsEnum);
@@ -45,5 +45,5 @@
 	
 	/*Fetch data needed: */
-	iomodel->FetchData(4,ElementsEnum,MeshElementconnectivityEnum,MaterialsRheologyBEnum,MaterialsRheologyNEnum);
+	iomodel->FetchData(4,MeshElementsEnum,MeshElementconnectivityEnum,MaterialsRheologyBEnum,MaterialsRheologyNEnum);
 	if(dim==3)          iomodel->FetchData(2,MeshUpperelementsEnum,MeshLowerelementsEnum);
 	if(control_analysis)iomodel->FetchData(3,InversionControlParametersEnum,InversionMinParametersEnum,InversionMaxParametersEnum);
@@ -63,5 +63,5 @@
 	
 	/*Free data: */
-	iomodel->DeleteData(9,ElementsEnum,MeshElementconnectivityEnum,MeshUpperelementsEnum,MeshLowerelementsEnum,
+	iomodel->DeleteData(9,MeshElementsEnum,MeshElementconnectivityEnum,MeshUpperelementsEnum,MeshLowerelementsEnum,
 				MaterialsRheologyBEnum,MaterialsRheologyNEnum,InversionControlParametersEnum,InversionMinParametersEnum,InversionMaxParametersEnum);
 
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp	(revision 9733)
@@ -32,5 +32,5 @@
 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
 	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
-	elements=iomodel->Data(ElementsEnum);
+	elements=iomodel->Data(MeshElementsEnum);
 
 	/*Some checks if debugging*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp	(revision 9733)
@@ -35,5 +35,5 @@
 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
 	iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
-	elements=iomodel->Data(ElementsEnum);
+	elements=iomodel->Data(MeshElementsEnum);
 
 	/*Some checks if debugging*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp	(revision 9733)
@@ -128,5 +128,5 @@
 	iomodel->FetchData(&nodeonstokes,NULL,NULL,FlowequationBorderstokesEnum);
 	iomodel->FetchData(&vertices_type,NULL,NULL,FlowequationVertexEquationEnum);
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 	CreateSingleNodeToElementConnectivity(iomodel);
 	
@@ -146,5 +146,5 @@
 	xfree((void**)&nodeonicesheet);
 	xfree((void**)&vertices_type);
-	iomodel->DeleteData(1,ElementsEnum);
+	iomodel->DeleteData(1,MeshElementsEnum);
 
 	/*Create Penpair for penalties: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	(revision 9733)
@@ -35,5 +35,5 @@
 
 	/*Fetch data needed: */
-	iomodel->FetchData(2,ElementsEnum,FlowequationElementEquationEnum);
+	iomodel->FetchData(2,MeshElementsEnum,FlowequationElementEquationEnum);
 
 	/*Update elements: */
@@ -95,4 +95,4 @@
 	
 	/*Free data: */
-	iomodel->DeleteData(2,ElementsEnum,FlowequationElementEquationEnum);
+	iomodel->DeleteData(2,MeshElementsEnum,FlowequationElementEquationEnum);
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp	(revision 9733)
@@ -44,5 +44,5 @@
 
 	/*First fetch data: */
-	iomodel->FetchData(7,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,ElementsEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+	iomodel->FetchData(7,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MeshElementsEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
 	CreateNumberNodeToElementConnectivity(iomodel);
 
@@ -57,5 +57,5 @@
 
 	/*Clean fetched data: */
-	iomodel->DeleteData(7,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,ElementsEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+	iomodel->DeleteData(7,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MeshElementsEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
 
 	/*Assign output pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp	(revision 9733)
@@ -27,5 +27,5 @@
 	if (!ishutter)return;
 
-	iomodel->FetchData(2,ElementsEnum,FlowequationElementEquationEnum);
+	iomodel->FetchData(2,MeshElementsEnum,FlowequationElementEquationEnum);
 
 	/*Update elements: */
@@ -43,4 +43,4 @@
 	
 	/*Free data: */
-	iomodel->DeleteData(2,ElementsEnum,FlowequationElementEquationEnum);
+	iomodel->DeleteData(2,MeshElementsEnum,FlowequationElementEquationEnum);
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	(revision 9733)
@@ -27,5 +27,5 @@
 
 	/*Fetch data needed: */
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 
 	/*Update elements: */
@@ -55,5 +55,5 @@
 
 	/*Free data: */
-	iomodel->DeleteData(1,ElementsEnum);
+	iomodel->DeleteData(1,MeshElementsEnum);
 	
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 9733)
@@ -67,5 +67,5 @@
 	if(dim==2){
 		/*load elements: */
-		iomodel->FetchData(&elements,NULL,NULL,ElementsEnum);
+		iomodel->FetchData(&elements,NULL,NULL,MeshElementsEnum);
 	}
 	else{
@@ -101,5 +101,5 @@
 
 	/*Start figuring out, out of the partition, which elements belong to this cpu: */
-	iomodel->FetchData(&elements,NULL,NULL,ElementsEnum);
+	iomodel->FetchData(&elements,NULL,NULL,MeshElementsEnum);
 	for (i=0;i<numberofelements;i++){
 
Index: /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp	(revision 9733)
@@ -27,5 +27,5 @@
 
 	/*Fetch data needed: */
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 
 	/*Update elements: */
@@ -61,4 +61,4 @@
 	
 	/*Free data: */
-	iomodel->DeleteData(1,ElementsEnum);
+	iomodel->DeleteData(1,MeshElementsEnum);
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp	(revision 9733)
@@ -20,5 +20,5 @@
 	/*Fetch data needed: */
 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 
 	/*Update elements: */
@@ -57,4 +57,4 @@
 
 	/*Free data: */
-	iomodel->DeleteData(1,ElementsEnum);
+	iomodel->DeleteData(1,MeshElementsEnum);
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp	(revision 9733)
@@ -35,5 +35,5 @@
 
 	//create penalties for nodes: no node can have a temperature over the melting point
-	iomodel->FetchData(2,MeshVertexonbedEnum,ElementsEnum);
+	iomodel->FetchData(2,MeshVertexonbedEnum,MeshElementsEnum);
 	CreateSingleNodeToElementConnectivity(iomodel);
 
@@ -45,5 +45,5 @@
 		}
 	}
-	iomodel->DeleteData(2,MeshVertexonbedEnum,ElementsEnum);
+	iomodel->DeleteData(2,MeshVertexonbedEnum,MeshElementsEnum);
 
 	/*Assign output pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	(revision 9733)
@@ -27,5 +27,5 @@
 
 	/*Fetch data needed: */
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 
 	/*Update elements: */
@@ -60,4 +60,4 @@
 	
 	/*Free data: */
-	iomodel->DeleteData(1,ElementsEnum);
+	iomodel->DeleteData(1,MeshElementsEnum);
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 9733)
@@ -109,6 +109,6 @@
 
 	/*Get edges and elements*/
-	iomodel->FetchData(&edges,&numberofedges,&cols,EdgesEnum);
-	iomodel->FetchData(&elements,NULL,NULL,ElementsEnum);
+	iomodel->FetchData(&edges,&numberofedges,&cols,MeshEdgesEnum);
+	iomodel->FetchData(&elements,NULL,NULL,MeshElementsEnum);
 	if (cols!=4) _error_("field edges should have 4 columns");
 
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp	(revision 9733)
@@ -41,5 +41,5 @@
 
 		/*Get edges and elements*/
-		iomodel->FetchData(3,EdgesEnum,ElementsEnum,ThicknessEnum);
+		iomodel->FetchData(3,MeshEdgesEnum,MeshElementsEnum,ThicknessEnum);
 
 		/*First load data:*/
@@ -47,5 +47,5 @@
 
 			/*Get left and right elements*/
-			element=(int)(iomodel->Data(EdgesEnum)[4*i+2])-1; //edges are [node1 node2 elem1 elem2]
+			element=(int)(iomodel->Data(MeshEdgesEnum)[4*i+2])-1; //edges are [node1 node2 elem1 elem2]
 
 			/*Now, if this element is not in the partition, pass: */
@@ -57,5 +57,5 @@
 
 		/*Free data: */
-		iomodel->DeleteData(3,EdgesEnum,ElementsEnum,ThicknessEnum);
+		iomodel->DeleteData(3,MeshEdgesEnum,MeshElementsEnum,ThicknessEnum);
 	}
 
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp	(revision 9733)
@@ -49,5 +49,5 @@
 
 	/*First fetch data: */
-	iomodel->FetchData(7,ElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+	iomodel->FetchData(7,MeshElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
 	if(continuous_galerkin){
 
@@ -72,5 +72,5 @@
 
 					//Get index of the vertex on which the current node is located
-					vertex_id=(int)*(iomodel->Data(ElementsEnum)+3*i+j); //(Matlab indexing)
+					vertex_id=(int)*(iomodel->Data(MeshElementsEnum)+3*i+j); //(Matlab indexing)
 					io_index=vertex_id-1;                      //(C indexing)
 					_assert_(vertex_id>0 && vertex_id<=numberofvertices);
@@ -88,5 +88,5 @@
 
 	/*Clean fetched data: */
-	iomodel->DeleteData(7,ElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
+	iomodel->DeleteData(7,MeshElementsEnum,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
 
 	/*Assign output pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	(revision 9733)
@@ -24,5 +24,5 @@
 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
 	iomodel->Constant(&stabilization,PrognosticStabilizationEnum);
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 
 	/*Update elements: */
@@ -61,4 +61,4 @@
 	
 	/*Free data: */
-	iomodel->DeleteData(1,ElementsEnum);
+	iomodel->DeleteData(1,MeshElementsEnum);
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp	(revision 9733)
@@ -22,5 +22,5 @@
 	iomodel->Constant(&dim,MeshDimensionEnum);
 	iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 
 	/*Update elements: */
@@ -44,4 +44,4 @@
 	
 	/*Free data: */
-	iomodel->DeleteData(1,ElementsEnum);
+	iomodel->DeleteData(1,MeshElementsEnum);
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp	(revision 9733)
@@ -36,5 +36,5 @@
 
 	//create penalties for nodes: no node can have a temperature over the melting point
-	iomodel->FetchData(2,ThermalSpctemperatureEnum,ElementsEnum);
+	iomodel->FetchData(2,ThermalSpctemperatureEnum,MeshElementsEnum);
 	CreateSingleNodeToElementConnectivity(iomodel);
 
@@ -48,5 +48,5 @@
 		}
 	}
-	iomodel->DeleteData(2,ThermalSpctemperatureEnum,ElementsEnum);
+	iomodel->DeleteData(2,ThermalSpctemperatureEnum,MeshElementsEnum);
 
 	/*Assign output pointer: */
Index: /issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp	(revision 9733)
@@ -29,5 +29,5 @@
 
 	/*Fetch data needed: */
-	iomodel->FetchData(1,ElementsEnum);
+	iomodel->FetchData(1,MeshElementsEnum);
 
 	/*Update elements: */
@@ -64,4 +64,4 @@
 
 	/*Free data: */
-	iomodel->DeleteData(1,ElementsEnum);
+	iomodel->DeleteData(1,MeshElementsEnum);
 }
Index: /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 9732)
+++ /issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	(revision 9733)
@@ -165,6 +165,7 @@
 	else if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
 	else if (strcmp(name,"MeshElements2d")==0) return MeshElements2dEnum;
+	else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;
+	else if (strcmp(name,"MeshEdges")==0) return MeshEdgesEnum;
 	else if (strcmp(name,"Constraints")==0) return ConstraintsEnum;
-	else if (strcmp(name,"Elements")==0) return ElementsEnum;
 	else if (strcmp(name,"Loads")==0) return LoadsEnum;
 	else if (strcmp(name,"Materials")==0) return MaterialsEnum;
@@ -415,5 +416,4 @@
 	else if (strcmp(name,"Y")==0) return YEnum;
 	else if (strcmp(name,"Z")==0) return ZEnum;
-	else if (strcmp(name,"Edges")==0) return EdgesEnum;
 	else if (strcmp(name,"X")==0) return XEnum;
 	else if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum;
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 9732)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 9733)
@@ -4853,5 +4853,5 @@
 		/*Recover vertices ids needed to initialize inputs*/
 		for(i=0;i<6;i++){ 
-			penta_vertex_ids[i]=(int)iomodel->Data(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
+			penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
 		}
 
@@ -4947,5 +4947,5 @@
 
 		/*Step1: Get original input (to be depth avegaged): */
-		if (object_enum==ElementsEnum)
+		if (object_enum==MeshElementsEnum)
 		 original_input=(Input*)penta->inputs->GetInput(enum_type);
 		else if (object_enum==MaterialsEnum)
@@ -5007,5 +5007,5 @@
 
 	/*Finally, add to inputs*/
-	if (object_enum==ElementsEnum)
+	if (object_enum==MeshElementsEnum)
 	 this->inputs->AddInput((Input*)depth_averaged_input);
 	else if (object_enum==MaterialsEnum)
@@ -5037,5 +5037,5 @@
 
 		/*Step1: Extrude the original input: */
-		if (object_type==ElementsEnum)
+		if (object_type==MeshElementsEnum)
 		 original_input=(Input*)this->inputs->GetInput(enum_type);
 		else if (object_type==MaterialsEnum)
@@ -5060,5 +5060,5 @@
 			Input* copy=NULL;
 			copy=(Input*)original_input->copy();
-			if (object_type==ElementsEnum)
+			if (object_type==MeshElementsEnum)
 			 penta->inputs->AddInput((Input*)copy);
 			else if (object_type==MaterialsEnum)
@@ -5160,10 +5160,10 @@
 	/*Checks if debuging*/
 	/*{{{2*/
-	_assert_(iomodel->Data(ElementsEnum));
+	_assert_(iomodel->Data(MeshElementsEnum));
 	/*}}}*/
 
 	/*Recover vertices ids needed to initialize inputs*/
 	for(i=0;i<6;i++){ 
-		penta_vertex_ids[i]=(int)iomodel->Data(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
+		penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
 	}
 
@@ -7515,5 +7515,5 @@
 	/*Checks if debuging*/
 	/*{{{2*/
-	_assert_(iomodel->Data(ElementsEnum));
+	_assert_(iomodel->Data(MeshElementsEnum));
 	/*}}}*/
 
@@ -7530,5 +7530,5 @@
 
 	/*Recover vertices ids needed to initialize inputs*/
-	for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->Data(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
+	for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
 
 	/*Recover nodes ids needed to initialize the node hook.*/
@@ -7536,5 +7536,5 @@
 		//go recover node ids, needed to initialize the node hook.
 		//WARNING: We assume P1 elements here!!!!!
-		penta_node_ids[i]=iomodel->nodecounter+(int)iomodel->Data(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
+		penta_node_ids[i]=iomodel->nodecounter+(int)iomodel->Data(MeshElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
 	}
 
Index: /issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.h	(revision 9732)
+++ /issm/trunk/src/c/objects/Elements/Penta.h	(revision 9733)
@@ -101,5 +101,5 @@
 		void   InputCreate(double scalar,int name,int code);
 		void   InputCreate(double* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code);
-		void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum=ElementsEnum);
+		void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum=MeshElementsEnum);
 		void   InputDuplicate(int original_enum,int new_enum);
 		void   InputScale(int enum_type,double scale_factor);
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 9732)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 9733)
@@ -3170,5 +3170,5 @@
 
 	/*copy input of enum_type*/
-	if (object_enum==ElementsEnum)
+	if (object_enum==MeshElementsEnum)
 	 oldinput=(Input*)this->inputs->GetInput(enum_type);
 	else if (object_enum==MaterialsEnum)
@@ -3183,5 +3183,5 @@
 
 	/*Add new input to current element*/
-	if (object_enum==ElementsEnum)
+	if (object_enum==MeshElementsEnum)
 	 this->inputs->AddInput((Input*)newinput);
 	else if (object_enum==MaterialsEnum)
@@ -3278,5 +3278,5 @@
 	/*Recover vertices ids needed to initialize inputs*/
 	for(i=0;i<3;i++){ 
-		tria_vertex_ids[i]=(int)iomodel->Data(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
+		tria_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
 	}
 
@@ -3907,5 +3907,5 @@
 		/*Recover vertices ids needed to initialize inputs*/
 		for(i=0;i<3;i++){ 
-			tria_vertex_ids[i]=(int)iomodel->Data(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
+			tria_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
 		}
 
@@ -5214,5 +5214,5 @@
 	/*Checks if debuging*/
 	/*{{{2*/
-	_assert_(iomodel->Data(ElementsEnum));
+	_assert_(iomodel->Data(MeshElementsEnum));
 	/*}}}*/
 
@@ -5236,5 +5236,5 @@
 	/*Recover vertices ids needed to initialize inputs*/
 	for(i=0;i<3;i++){ 
-		tria_vertex_ids[i]=(int)iomodel->Data(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
+		tria_vertex_ids[i]=(int)iomodel->Data(MeshElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
 	}
 
@@ -5249,5 +5249,5 @@
 		/*Continuous Galerkin*/
 		for(i=0;i<3;i++){ 
-			tria_node_ids[i]=iomodel->nodecounter+(int)*(iomodel->Data(ElementsEnum)+3*index+i); //ids for vertices are in the elements array from Matlab
+			tria_node_ids[i]=iomodel->nodecounter+(int)*(iomodel->Data(MeshElementsEnum)+3*index+i); //ids for vertices are in the elements array from Matlab
 		}
 	}
Index: /issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.h	(revision 9732)
+++ /issm/trunk/src/c/objects/Elements/Tria.h	(revision 9733)
@@ -102,5 +102,5 @@
 		void   InputCreate(double scalar,int name,int code);
 		void   InputCreate(double* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code);
-		void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum=ElementsEnum);
+		void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum=MeshElementsEnum);
 		void   InputDuplicate(int original_enum,int new_enum);
 		void   InputScale(int enum_type,double scale_factor);
Index: /issm/trunk/src/c/objects/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 9732)
+++ /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 9733)
@@ -60,7 +60,7 @@
 
 	/*First, see wether this is an internal or boundary edge (if e2=NaN)*/
-	if (isnan((double)iomodel->Data(EdgesEnum)[4*i+3])){ //edges are [node1 node2 elem1 elem2]
+	if (isnan((double)iomodel->Data(MeshEdgesEnum)[4*i+3])){ //edges are [node1 node2 elem1 elem2]
 		/* Boundary edge, only one element */
-		e1=(int)iomodel->Data(EdgesEnum)[4*i+2];
+		e1=(int)iomodel->Data(MeshEdgesEnum)[4*i+2];
 		e2=(int)UNDEF;
 		num_elems=1;
@@ -71,6 +71,6 @@
 	else{
 		/* internal edge: connected to 2 elements */
-		e1=(int)iomodel->Data(EdgesEnum)[4*i+2];
-		e2=(int)iomodel->Data(EdgesEnum)[4*i+3];
+		e1=(int)iomodel->Data(MeshEdgesEnum)[4*i+2];
+		e2=(int)iomodel->Data(MeshEdgesEnum)[4*i+3];
 		num_elems=2;
 		num_nodes=4;
@@ -81,6 +81,6 @@
 
 	/*1: Get vertices ids*/
-	i1=(int)iomodel->Data(EdgesEnum)[4*i+0];
-	i2=(int)iomodel->Data(EdgesEnum)[4*i+1];
+	i1=(int)iomodel->Data(MeshEdgesEnum)[4*i+0];
+	i2=(int)iomodel->Data(MeshEdgesEnum)[4*i+1];
 
 	if (numericalflux_type==InternalEnum){
@@ -91,8 +91,8 @@
 		pos1=pos2=pos3=pos4=UNDEF;
 		for(j=0;j<3;j++){
-			if (iomodel->Data(ElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
-			if (iomodel->Data(ElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
-			if (iomodel->Data(ElementsEnum)[3*(e2-1)+j]==i1) pos3=j+1;
-			if (iomodel->Data(ElementsEnum)[3*(e2-1)+j]==i2) pos4=j+1;
+			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
+			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
+			if (iomodel->Data(MeshElementsEnum)[3*(e2-1)+j]==i1) pos3=j+1;
+			if (iomodel->Data(MeshElementsEnum)[3*(e2-1)+j]==i2) pos4=j+1;
 		}
 		_assert_(pos1!=UNDEF && pos2!=UNDEF && pos3!=UNDEF && pos4!=UNDEF);
@@ -110,6 +110,6 @@
 		pos1=pos2=UNDEF;
 		for(j=0;j<3;j++){
-			if (iomodel->Data(ElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
-			if (iomodel->Data(ElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
+			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
+			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
 		}
 		_assert_(pos1!=UNDEF && pos2!=UNDEF);
Index: /issm/trunk/src/c/objects/Materials/Matice.cpp
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 9732)
+++ /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 9733)
@@ -675,5 +675,5 @@
 		/*Get B*/
 		if (iomodel->Data(MaterialsRheologyBEnum)) {
-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(ElementsEnum)[num_vertices*index+i]-1)];
+			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
 			this->inputs->AddInput(new TriaVertexInput(MaterialsRheologyBbarEnum,nodeinputs));
 		}
@@ -692,7 +692,7 @@
 						if (iomodel->Data(MaterialsRheologyBEnum)){
 							_assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
-							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(ElementsEnum)[num_vertices*index+j]-1)];
-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
+							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
 							this->inputs->AddInput(new ControlInput(MaterialsRheologyBbarEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 						}
@@ -714,5 +714,5 @@
 		/*Get B*/
 		if (iomodel->Data(MaterialsRheologyBEnum)) {
-			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(ElementsEnum)[num_vertices*index+i]-1)];
+			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
 			this->inputs->AddInput(new PentaVertexInput(MaterialsRheologyBEnum,nodeinputs));
 		}
@@ -731,7 +731,7 @@
 						if (iomodel->Data(MaterialsRheologyBEnum)){
 							_assert_(iomodel->Data(MaterialsRheologyBEnum));_assert_(iomodel->Data(InversionMinParametersEnum)); _assert_(iomodel->Data(InversionMaxParametersEnum)); 
-							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(ElementsEnum)[num_vertices*index+j]-1)];
-							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
-							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
+							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
+							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
 							this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 						}
Index: /issm/trunk/src/m/classes/mesh.m
===================================================================
--- /issm/trunk/src/m/classes/mesh.m	(revision 9732)
+++ /issm/trunk/src/m/classes/mesh.m	(revision 9733)
@@ -35,4 +35,6 @@
 		x2d                = modelfield('default',NaN,'marshall',false);
 		y2d                = modelfield('default',NaN,'marshall',false);
+		elements            = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',2);
+		edges               = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3);
 	end
 	methods
Index: /issm/trunk/src/m/classes/model/model.m
===================================================================
--- /issm/trunk/src/m/classes/model/model.m	(revision 9732)
+++ /issm/trunk/src/m/classes/model/model.m	(revision 9733)
@@ -43,9 +43,7 @@
 
 		 %FIXME: all other fields should belong to other classes
-		 elements            = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',2);
 		 x                   = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
 		 y                   = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
 		 z                   = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
-		 edges               = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',3);
 
 		 %}}}
@@ -207,5 +205,5 @@
 			 if isfield(structmd,'ishutter'), md.flowequation.ishutter=structmd.ishutter; end
 			 if isfield(structmd,'isstokes'), md.flowequation.isstokes=structmd.isstokes; end
-			 if isfield(structmd,'elements_type'), md.flowequation.element_equation=structmd.elements_type; end
+			 if isfield(structmd,'elements_type'), md.flowequation.element_equation=structmd.mesh.elements_type; end
 			 if isfield(structmd,'vertices_type'), md.flowequation.vertex_equation=structmd.vertices_type; end
 			 if isfield(structmd,'eps_rel'), md.steadystate.reltol=structmd.eps_rel; end
@@ -262,7 +260,9 @@
 			 if isfield(structmd,'nodeonsurface'), md.mesh.vertexonsurface=structmd.nodeonsurface; end
 			 if isfield(structmd,'nodeonbed'), md.mesh.vertexonbed=structmd.nodeonbed; end
-			 if isfield(structmd,'elements2d'), md.mesh.elements2d=structmd.elements2d; end
+			 if isfield(structmd,'elements2d'), md.mesh.elements2d=structmd.mesh.elements2d; end
 			 if isfield(structmd,'y2d'), md.mesh.y2d=structmd.y2d; end
 			 if isfield(structmd,'x2d'), md.mesh.x2d=structmd.x2d; end
+			 if isfield(structmd,'elements'), md.mesh.elements=structmd.mesh.elements; end
+			 if isfield(structmd,'edges'), md.mesh.edges=structmd.mesh.edges; end
 
 			 %Field changes
@@ -295,13 +295,13 @@
 				 pos=find(structmd.pressureload(:,end)==119); md.pressureload(pos,end)=2;
 			 end
-			 if (structmd.elements_type(end,end)>100),
-				 pos=find(structmd.elements_type==59); md.elements_type(pos,end)=0;
-				 pos=find(structmd.elements_type==55); md.elements_type(pos,end)=1;
-				 pos=find(structmd.elements_type==56); md.elements_type(pos,end)=2;
-				 pos=find(structmd.elements_type==60); md.elements_type(pos,end)=3;
-				 pos=find(structmd.elements_type==62); md.elements_type(pos,end)=4;
-				 pos=find(structmd.elements_type==57); md.elements_type(pos,end)=5;
-				 pos=find(structmd.elements_type==58); md.elements_type(pos,end)=6;
-				 pos=find(structmd.elements_type==61); md.elements_type(pos,end)=7;
+			 if (structmd.mesh.elements_type(end,end)>100),
+				 pos=find(structmd.mesh.elements_type==59); md.mesh.elements_type(pos,end)=0;
+				 pos=find(structmd.mesh.elements_type==55); md.mesh.elements_type(pos,end)=1;
+				 pos=find(structmd.mesh.elements_type==56); md.mesh.elements_type(pos,end)=2;
+				 pos=find(structmd.mesh.elements_type==60); md.mesh.elements_type(pos,end)=3;
+				 pos=find(structmd.mesh.elements_type==62); md.mesh.elements_type(pos,end)=4;
+				 pos=find(structmd.mesh.elements_type==57); md.mesh.elements_type(pos,end)=5;
+				 pos=find(structmd.mesh.elements_type==58); md.mesh.elements_type(pos,end)=6;
+				 pos=find(structmd.mesh.elements_type==61); md.mesh.elements_type(pos,end)=7;
 			 end
 			 if isfield(structmd,'rheology_law') & isnumeric(structmd.rheology_law),
Index: sm/trunk/src/m/enum/EdgesEnum.m
===================================================================
--- /issm/trunk/src/m/enum/EdgesEnum.m	(revision 9732)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=EdgesEnum()
-%EDGESENUM - Enum of Edges
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=EdgesEnum()
-
-macro=StringToEnum('Edges');
Index: sm/trunk/src/m/enum/Elements2dEnum.m
===================================================================
--- /issm/trunk/src/m/enum/Elements2dEnum.m	(revision 9732)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=Elements2dEnum()
-%ELEMENTS2DENUM - Enum of Elements2d
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=Elements2dEnum()
-
-macro=StringToEnum('Elements2d');
Index: sm/trunk/src/m/enum/ElementsEnum.m
===================================================================
--- /issm/trunk/src/m/enum/ElementsEnum.m	(revision 9732)
+++ 	(revision )
@@ -1,11 +1,0 @@
-function macro=ElementsEnum()
-%ELEMENTSENUM - Enum of Elements
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=ElementsEnum()
-
-macro=StringToEnum('Elements');
Index: /issm/trunk/src/m/enum/MeshEdgesEnum.m
===================================================================
--- /issm/trunk/src/m/enum/MeshEdgesEnum.m	(revision 9733)
+++ /issm/trunk/src/m/enum/MeshEdgesEnum.m	(revision 9733)
@@ -0,0 +1,11 @@
+function macro=MeshEdgesEnum()
+%MESHEDGESENUM - Enum of MeshEdges
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=MeshEdgesEnum()
+
+macro=StringToEnum('MeshEdges');
Index: /issm/trunk/src/m/enum/MeshElements2dEnum.m
===================================================================
--- /issm/trunk/src/m/enum/MeshElements2dEnum.m	(revision 9733)
+++ /issm/trunk/src/m/enum/MeshElements2dEnum.m	(revision 9733)
@@ -0,0 +1,11 @@
+function macro=MeshElements2dEnum()
+%MESHELEMENTS2DENUM - Enum of MeshElements2d
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=MeshElements2dEnum()
+
+macro=StringToEnum('MeshElements2d');
Index: /issm/trunk/src/m/enum/MeshElementsEnum.m
===================================================================
--- /issm/trunk/src/m/enum/MeshElementsEnum.m	(revision 9733)
+++ /issm/trunk/src/m/enum/MeshElementsEnum.m	(revision 9733)
@@ -0,0 +1,11 @@
+function macro=MeshElementsEnum()
+%MESHELEMENTSENUM - Enum of MeshElements
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=MeshElementsEnum()
+
+macro=StringToEnum('MeshElements');
Index: /issm/trunk/src/m/kml/kml_mesh_elem.m
===================================================================
--- /issm/trunk/src/m/kml/kml_mesh_elem.m	(revision 9732)
+++ /issm/trunk/src/m/kml/kml_mesh_elem.m	(revision 9733)
@@ -80,9 +80,9 @@
         display('Averaging nodal data to element data.');
         edata=zeros(1,md.mesh.numberofelements);
-        for i=1:size(md.elements,1)
-            for j=1:size(md.elements,2)
-                edata(i)=edata(i)+ndata(md.elements(i,j));
+        for i=1:size(md.mesh.elements,1)
+            for j=1:size(md.mesh.elements,2)
+                edata(i)=edata(i)+ndata(md.mesh.elements(i,j));
             end
-            edata(i)=edata(i)/size(md.elements,2);
+            edata(i)=edata(i)/size(md.mesh.elements,2);
         end
     else
@@ -126,12 +126,12 @@
     md.mesh.numberofelements,md.mesh.numberofvertices);
 % see matlab_oop, "initializing a handle object array"
-%kfold.feature   ={repmat(kml_placemark(),1,size(md.elements,1))};
-kfeat(size(md.elements,1))=kml_placemark();
+%kfold.feature   ={repmat(kml_placemark(),1,size(md.mesh.elements,1))};
+kfeat(size(md.mesh.elements,1))=kml_placemark();
 kfold.feature={kfeat};
 
 %  write each element as a polygon placemark
 
-disp(['Writing ' num2str(size(md.elements,1)) ' tria elements as KML polygons.']);
-for i=1:size(md.elements,1)
+disp(['Writing ' num2str(size(md.mesh.elements,1)) ' tria elements as KML polygons.']);
+for i=1:size(md.mesh.elements,1)
     kplace=kml_placemark();
     kplace.name      =sprintf('Element %d',i);
@@ -157,8 +157,8 @@
 
     kring=kml_linearring();
-    kring.coords    =zeros(size(md.elements,2)+1,3);
+    kring.coords    =zeros(size(md.mesh.elements,2)+1,3);
 
-    for j=1:size(md.elements,2)
-        kring.coords(j,:)=[md.mesh.long(md.elements(i,j)) md.mesh.lat(md.elements(i,j)) alt];
+    for j=1:size(md.mesh.elements,2)
+        kring.coords(j,:)=[md.mesh.long(md.mesh.elements(i,j)) md.mesh.lat(md.mesh.elements(i,j)) alt];
     end
     kring.coords(end,:)=kring.coords(1,:);
Index: /issm/trunk/src/m/kml/kml_mesh_write.m
===================================================================
--- /issm/trunk/src/m/kml/kml_mesh_write.m	(revision 9732)
+++ /issm/trunk/src/m/kml/kml_mesh_write.m	(revision 9733)
@@ -86,9 +86,9 @@
         display('Averaging nodal data to element data.');
         edata=zeros(1,md.mesh.numberofelements);
-        for i=1:size(md.elements,1)
-            for j=1:size(md.elements,2)
-                edata(i)=edata(i)+ndata(md.elements(i,j));
+        for i=1:size(md.mesh.elements,1)
+            for j=1:size(md.mesh.elements,2)
+                edata(i)=edata(i)+ndata(md.mesh.elements(i,j));
             end
-            edata(i)=edata(i)/size(md.elements,2);
+            edata(i)=edata(i)/size(md.mesh.elements,2);
         end
     else
Index: /issm/trunk/src/m/kml/kml_part_edges.m
===================================================================
--- /issm/trunk/src/m/kml/kml_part_edges.m	(revision 9732)
+++ /issm/trunk/src/m/kml/kml_part_edges.m	(revision 9733)
@@ -81,9 +81,9 @@
         display('Averaging nodal data to element data.');
         edata=zeros(1,md.mesh.numberofelements);
-        for i=1:size(md.elements,1)
-            for j=1:size(md.elements,2)
-                edata(i)=edata(i)+ndata(md.elements(i,j));
+        for i=1:size(md.mesh.elements,1)
+            for j=1:size(md.mesh.elements,2)
+                edata(i)=edata(i)+ndata(md.mesh.elements(i,j));
             end
-            edata(i)=edata(i)/size(md.elements,2);
+            edata(i)=edata(i)/size(md.mesh.elements,2);
         end
     else
@@ -129,5 +129,5 @@
 
     disp(['Writing ' num2str(md.qmu.numberofpartitions) ' partitions as KML linestrings.']);
-    epart=md.qmu.partition(md.elements)+1;
+    epart=md.qmu.partition(md.mesh.elements)+1;
     if exist('ndata','var') || exist('edata','var')
         pdata=zeros(1,md.qmu.numberofpartitions);
@@ -148,5 +148,5 @@
         end
         irow=unique(irow);
-        elemp=md.elements(irow,:);
+        elemp=md.mesh.elements(irow,:);
         epartp=epart(irow,:);
         nodeconp=nodeconnectivity(elemp,md.mesh.numberofvertices);
Index: /issm/trunk/src/m/kml/kml_part_elems.m
===================================================================
--- /issm/trunk/src/m/kml/kml_part_elems.m	(revision 9732)
+++ /issm/trunk/src/m/kml/kml_part_elems.m	(revision 9733)
@@ -81,9 +81,9 @@
         display('Averaging nodal data to element data.');
         edata=zeros(1,md.mesh.numberofelements);
-        for i=1:size(md.elements,1)
-            for j=1:size(md.elements,2)
-                edata(i)=edata(i)+ndata(md.elements(i,j));
-            end
-            edata(i)=edata(i)/size(md.elements,2);
+        for i=1:size(md.mesh.elements,1)
+            for j=1:size(md.mesh.elements,2)
+                edata(i)=edata(i)+ndata(md.mesh.elements(i,j));
+            end
+            edata(i)=edata(i)/size(md.mesh.elements,2);
         end
     else
@@ -129,5 +129,5 @@
 
     disp(['Writing ' num2str(md.qmu.numberofpartitions) ' partitions as KML polygons.']);
-    epart=md.qmu.partition(md.elements)+1;
+    epart=md.qmu.partition(md.mesh.elements)+1;
     if exist('ndata','var') || exist('edata','var')
         pdata=zeros(1,md.qmu.numberofpartitions);
@@ -146,5 +146,5 @@
         end
         irow=unique(irow);
-        elem=md.elements(irow,:);
+        elem=md.mesh.elements(irow,:);
 
 %  determine the data to be used for the colors (if any)
Index: /issm/trunk/src/m/kml/kml_part_flagedges.m
===================================================================
--- /issm/trunk/src/m/kml/kml_part_flagedges.m	(revision 9732)
+++ /issm/trunk/src/m/kml/kml_part_flagedges.m	(revision 9733)
@@ -74,5 +74,5 @@
 if (~exist('prtplt','var') || strncmpi(prtplt,'on' ,2) || strncmpi(prtplt,'y',1)) && ...
     md.qmu.numberofpartitions
-    [latseg,lonseg]=flagedges(md.elements,md.mesh.lat,md.mesh.long,md.qmu.partition);
+    [latseg,lonseg]=flagedges(md.mesh.elements,md.mesh.lat,md.mesh.long,md.qmu.partition);
     kfold=kml_folder();
     kfold.name      ='Partition Segments';
Index: /issm/trunk/src/m/kml/kml_partitions.m
===================================================================
--- /issm/trunk/src/m/kml/kml_partitions.m	(revision 9732)
+++ /issm/trunk/src/m/kml/kml_partitions.m	(revision 9733)
@@ -82,9 +82,9 @@
         display('Averaging nodal data to element data.');
         edata=zeros(1,md.mesh.numberofelements);
-        for i=1:size(md.elements,1)
-            for j=1:size(md.elements,2)
-                edata(i)=edata(i)+ndata(md.elements(i,j));
+        for i=1:size(md.mesh.elements,1)
+            for j=1:size(md.mesh.elements,2)
+                edata(i)=edata(i)+ndata(md.mesh.elements(i,j));
             end
-            edata(i)=edata(i)/size(md.elements,2);
+            edata(i)=edata(i)/size(md.mesh.elements,2);
         end
     else
@@ -130,5 +130,5 @@
 
     disp(['Writing ' num2str(md.qmu.numberofpartitions) ' partitions as KML polygons.']);
-    epart=md.qmu.partition(md.elements)+1;
+    epart=md.qmu.partition(md.mesh.elements)+1;
     if exist('ndata','var') || exist('edata','var')
         pdata=zeros(1,md.qmu.numberofpartitions);
@@ -149,5 +149,5 @@
         end
         irow=unique(irow);
-        elemp=md.elements(irow,:);
+        elemp=md.mesh.elements(irow,:);
         epartp=epart(irow,:);
         nodeconp=nodeconnectivity(elemp,md.mesh.numberofvertices);
Index: /issm/trunk/src/m/kml/kml_unsh_edges.m
===================================================================
--- /issm/trunk/src/m/kml/kml_unsh_edges.m	(revision 9732)
+++ /issm/trunk/src/m/kml/kml_unsh_edges.m	(revision 9733)
@@ -74,10 +74,10 @@
 if (~exist('prtplt','var') || strncmpi(prtplt,'on' ,2) || strncmpi(prtplt,'y',1)) && ...
     md.qmu.numberofpartitions
-    [edgeadj]=edgeadjacency(md.elements,md.nodeconnectivity);
+    [edgeadj]=edgeadjacency(md.mesh.elements,md.nodeconnectivity);
     [icol,irow]=find(edgeadj'==0);
     edgeuns=zeros(length(irow),2);
     for i=1:length(irow)
-        edgeuns(i,1)=md.elements(irow(i),icol(i));
-        edgeuns(i,2)=md.elements(irow(i),mod(icol(i),size(md.elements,2))+1);
+        edgeuns(i,1)=md.mesh.elements(irow(i),icol(i));
+        edgeuns(i,2)=md.mesh.elements(irow(i),mod(icol(i),size(md.mesh.elements,2))+1);
     end
     kfold=kml_folder();
Index: /issm/trunk/src/m/model/BasinConstrain.m
===================================================================
--- /issm/trunk/src/m/model/BasinConstrain.m	(revision 9732)
+++ /issm/trunk/src/m/model/BasinConstrain.m	(revision 9733)
@@ -33,5 +33,5 @@
 		end
 		%ok, flag elements and nodes
-		[vertexondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
+		[vertexondomain elementondomain]=ContourToMesh(md.mesh.elements(:,1:3),md.x,md.y,domain,'element and node',2);
 	end
 	if invert,
@@ -54,5 +54,5 @@
 %now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
 pos=find(~md.mask.elementonwater);
-numpos=unique(md.elements(pos,:));
+numpos=unique(md.mesh.elements(pos,:));
 nodes=setdiff(1:1:md.mesh.numberofvertices,numpos);
 md.diagnostic.spcvx(nodes)=md.inversion.vx_obs(nodes);
Index: /issm/trunk/src/m/model/BasinConstrainShelf.m
===================================================================
--- /issm/trunk/src/m/model/BasinConstrainShelf.m	(revision 9732)
+++ /issm/trunk/src/m/model/BasinConstrainShelf.m	(revision 9733)
@@ -33,5 +33,5 @@
 		end
 		%ok, flag elements and nodes
-		[vertexondomain elementondomain]=ContourToMesh(md.elements(:,1:3),md.x,md.y,domain,'element and node',2);
+		[vertexondomain elementondomain]=ContourToMesh(md.mesh.elements(:,1:3),md.x,md.y,domain,'element and node',2);
 	end
 	if invert,
@@ -54,5 +54,5 @@
 %now, make sure all elements on water have nodes that are spc'd, otherwise, we'll get a singular problem.
 pos=find(~md.mask.elementonwater);
-numpos=unique(md.elements(pos,:));
+numpos=unique(md.mesh.elements(pos,:));
 nodes=setdiff(1:1:md.mesh.numberofvertices,numpos);
 md.diagnostic.spcvx(nodes)=md.inversion.vx_obs(nodes);
Index: /issm/trunk/src/m/model/MeltingGroundingLines.m
===================================================================
--- /issm/trunk/src/m/model/MeltingGroundingLines.m	(revision 9732)
+++ /issm/trunk/src/m/model/MeltingGroundingLines.m	(revision 9733)
@@ -8,5 +8,5 @@
 %get nodes on ice sheet and on ice shelf
 pos_shelf=find(~md.mask.vertexongroundedice);
-pos_GL=intersect(unique(md.elements(find(md.mask.elementongroundedice),:)),unique(md.elements(find(md.mask.elementonfloatingice),:)));
+pos_GL=intersect(unique(md.mesh.elements(find(md.mask.elementongroundedice),:)),unique(md.mesh.elements(find(md.mask.elementonfloatingice),:)));
 
 for i=1:length(pos_shelf)
Index: /issm/trunk/src/m/model/PropagateFlagsUntilDistance.m
===================================================================
--- /issm/trunk/src/m/model/PropagateFlagsUntilDistance.m	(revision 9732)
+++ /issm/trunk/src/m/model/PropagateFlagsUntilDistance.m	(revision 9733)
@@ -15,5 +15,5 @@
 	md.x=md.mesh.x2d;
 	md.y=md.mesh.y2d;
-	md.elements=md.mesh.elements2d;
+	md.mesh.elements=md.mesh.elements2d;
 end
 
@@ -27,6 +27,6 @@
 
 %average x and y over elements: 
-x_elem=md.x(md.elements)*[1;1;1]/3;
-y_elem=md.y(md.elements)*[1;1;1]/3;
+x_elem=md.x(md.mesh.elements)*[1;1;1]/3;
+y_elem=md.y(md.mesh.elements)*[1;1;1]/3;
 
 while 1,
Index: /issm/trunk/src/m/model/SectionValues.m
===================================================================
--- /issm/trunk/src/m/model/SectionValues.m	(revision 9732)
+++ /issm/trunk/src/m/model/SectionValues.m	(revision 9733)
@@ -82,5 +82,5 @@
 
 	%Interpolation of data on specified points
-	data_interp=InterpFromMeshToMesh2d(md.elements,md.x,md.y,data,X,Y);
+	data_interp=InterpFromMeshToMesh2d(md.mesh.elements,md.x,md.y,data,X,Y);
 	%data_interp=griddata(md.x,md.y,data,X,Y);
 
@@ -120,5 +120,5 @@
 
 	%Interpolation of data on specified points
-	data_interp=InterpFromMeshToMesh3d(md.elements,md.x,md.y,md.z,data,X3,Y3,Z3,NaN);
+	data_interp=InterpFromMeshToMesh3d(md.mesh.elements,md.x,md.y,md.z,data,X3,Y3,Z3,NaN);
 
 	%build outputs
Index: /issm/trunk/src/m/model/ThicknessCorrection.m
===================================================================
--- /issm/trunk/src/m/model/ThicknessCorrection.m	(revision 9732)
+++ /issm/trunk/src/m/model/ThicknessCorrection.m	(revision 9733)
@@ -24,5 +24,5 @@
 %get nodes on ice sheet and on ice shelf
 pos_shelf=find(~md.mask.vertexongroundedice);
-pos_GL=intersect(unique(md.elements(find(md.mask.elementongroundedice),:)),unique(md.elements(find(md.mask.elementonfloatingice),:)));
+pos_GL=intersect(unique(md.mesh.elements(find(md.mask.elementongroundedice),:)),unique(md.mesh.elements(find(md.mask.elementonfloatingice),:)));
 debug=(length(pos_shelf)>50000);
 
Index: /issm/trunk/src/m/model/averageconnectivity.m
===================================================================
--- /issm/trunk/src/m/model/averageconnectivity.m	(revision 9732)
+++ /issm/trunk/src/m/model/averageconnectivity.m	(revision 9733)
@@ -7,5 +7,5 @@
 nnz=0;
 for i=1:md.mesh.numberofvertices,
-	nnz=nnz+length(find(md.elements==i));
+	nnz=nnz+length(find(md.mesh.elements==i));
 end
 conn=nnz/md.mesh.numberofvertices;
Index: /issm/trunk/src/m/model/averaging.m
===================================================================
--- /issm/trunk/src/m/model/averaging.m	(revision 9732)
+++ /issm/trunk/src/m/model/averaging.m	(revision 9733)
@@ -25,5 +25,5 @@
 
 %load some variables (it is much faster if the variab;es are loaded from md once for all)
-index=md.elements;
+index=md.mesh.elements;
 numberofnodes=md.mesh.numberofvertices;
 numberofelements=md.mesh.numberofelements;
Index: /issm/trunk/src/m/model/bamg.m
===================================================================
--- /issm/trunk/src/m/model/bamg.m	(revision 9732)
+++ /issm/trunk/src/m/model/bamg.m	(revision 9733)
@@ -271,5 +271,5 @@
 	else
 		bamg_mesh.Vertices=[md.x md.y ones(md.mesh.numberofvertices,1)];
-		bamg_mesh.Triangles=[md.elements ones(md.mesh.numberofelements,1)];
+		bamg_mesh.Triangles=[md.mesh.elements ones(md.mesh.numberofelements,1)];
 	end
 
@@ -319,6 +319,6 @@
 md.x=bamgmesh_out.Vertices(:,1);
 md.y=bamgmesh_out.Vertices(:,2);
-md.elements=bamgmesh_out.Triangles(:,1:3);
-md.edges=bamgmesh_out.IssmEdges;
+md.mesh.elements=bamgmesh_out.Triangles(:,1:3);
+md.mesh.edges=bamgmesh_out.IssmEdges;
 md.mesh.segments=bamgmesh_out.IssmSegments(:,1:3);
 md.mesh.segmentmarkers=bamgmesh_out.IssmSegments(:,4);
@@ -326,7 +326,7 @@
 %Fill in rest of fields:
 md.mesh.dimension=2;
-md.mesh.numberofelements=size(md.elements,1);
+md.mesh.numberofelements=size(md.mesh.elements,1);
 md.mesh.numberofvertices=length(md.x);
-md.mesh.numberofedges=size(md.edges,1);
+md.mesh.numberofedges=size(md.mesh.edges,1);
 md.z=zeros(md.mesh.numberofvertices,1);
 md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
@@ -340,5 +340,5 @@
 
 %Check for orphan
-if any(~ismember(1:md.mesh.numberofvertices,sort(unique(md.elements(:)))))
+if any(~ismember(1:md.mesh.numberofvertices,sort(unique(md.mesh.elements(:)))))
 	error('Output mesh has orphans. Decrease MaxCornerAngle to prevent outside points (ex: 0.01)');
 end
Index: /issm/trunk/src/m/model/basevert.m
===================================================================
--- /issm/trunk/src/m/model/basevert.m	(revision 9732)
+++ /issm/trunk/src/m/model/basevert.m	(revision 9733)
@@ -14,5 +14,5 @@
 
 for n=1:md.mesh.numberofelements
-	X=inv([md.x(md.elements(n,:)) md.y(md.elements(n,:)) ones(3,1)]);
+	X=inv([md.x(md.mesh.elements(n,:)) md.y(md.mesh.elements(n,:)) ones(3,1)]);
 	alpha(n,:)=X(1,:);
 	beta(n,:)=X(2,:);
@@ -24,12 +24,12 @@
 
 summation=[1;1;1];
-hux=(hu(md.elements).*alpha)*summation;
-hvy=(hv(md.elements).*beta)*summation;
+hux=(hu(md.mesh.elements).*alpha)*summation;
+hvy=(hv(md.mesh.elements).*beta)*summation;
 
-uelem=md.initialization.vx(md.elements)*summation/3;
-velem=md.initialization.vy(md.elements)*summation/3;
+uelem=md.initialization.vx(md.mesh.elements)*summation/3;
+velem=md.initialization.vy(md.mesh.elements)*summation/3;
 
-dbdx=(md.geometry.bed(md.elements).*alpha)*summation;
-dbdy=(md.geometry.bed(md.elements).*beta)*summation;
+dbdx=(md.geometry.bed(md.mesh.elements).*alpha)*summation;
+dbdy=(md.geometry.bed(md.mesh.elements).*beta)*summation;
 
 wb=-md.materials.rho_ice/md.materials.rho_water*(hux+hvy)+uelem.*dbdx+velem.*dbdy;
Index: /issm/trunk/src/m/model/bedslope.m
===================================================================
--- /issm/trunk/src/m/model/bedslope.m	(revision 9732)
+++ /issm/trunk/src/m/model/bedslope.m	(revision 9733)
@@ -9,5 +9,5 @@
 	numberofelements=md.mesh.numberofelements;
 	numberofnodes=md.mesh.numberofvertices;
-	index=md.elements;
+	index=md.mesh.elements;
 	x=md.x; y=md.y;
 else
Index: /issm/trunk/src/m/model/collapse.m
===================================================================
--- /issm/trunk/src/m/model/collapse.m	(revision 9732)
+++ /issm/trunk/src/m/model/collapse.m	(revision 9733)
@@ -95,5 +95,5 @@
 md.mesh.numberofvertices=md.mesh.numberofvertices2d;
 md.mesh.numberofelements=md.mesh.numberofelements2d;
-md.elements=md.mesh.elements2d;
+md.mesh.elements=md.mesh.elements2d;
 
 %Keep a trace of lower and upper nodes
Index: /issm/trunk/src/m/model/contourenvelope.m
===================================================================
--- /issm/trunk/src/m/model/contourenvelope.m	(revision 9732)
+++ /issm/trunk/src/m/model/contourenvelope.m	(revision 9733)
@@ -36,8 +36,8 @@
 %Computing connectivity
 if size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices,
-	md.mesh.vertexconnectivity=NodeConnectivity(md.elements,md.mesh.numberofvertices);
+	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
 end
 if size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements,
-	md.mesh.elementconnectivity=ElementConnectivity(md.elements,md.mesh.vertexconnectivity);
+	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 end
 
@@ -47,6 +47,6 @@
 	if isfile,
 		%get flag list of elements and nodes inside the contour
-		nodein=ContourToMesh(md.elements,md.x,md.y,file,'node',1);
-		elemin=(sum(nodein(md.elements),2)==size(md.elements,2));
+		nodein=ContourToMesh(md.mesh.elements,md.x,md.y,file,'node',1);
+		elemin=(sum(nodein(md.mesh.elements),2)==size(md.mesh.elements,2));
 		%modify element connectivity
 		elemout=find(~elemin);
@@ -60,5 +60,5 @@
 		pos=find(flags); 
 		elemin(pos)=1;
-		nodein(md.elements(pos,:))=1;
+		nodein(md.mesh.elements(pos,:))=1;
 
 		%modify element connectivity
@@ -87,11 +87,11 @@
 	els2=mesh.elementconnectivity(el1,find(mesh.elementconnectivity(el1,:)));
 	if length(els2)>1,
-		flag=intersect(md.elements(els2(1),:),md.elements(els2(2),:));
-		nods1=md.elements(el1,:);
+		flag=intersect(md.mesh.elements(els2(1),:),md.mesh.elements(els2(2),:));
+		nods1=md.mesh.elements(el1,:);
 		nods1(find(nods1==flag))=[];
 		segments(count,:)=[nods1 el1];
 
-		ord1=find(nods1(1)==md.elements(el1,:));
-		ord2=find(nods1(2)==md.elements(el1,:));
+		ord1=find(nods1(1)==md.mesh.elements(el1,:));
+		ord2=find(nods1(2)==md.mesh.elements(el1,:));
 
 		%swap segment nodes if necessary
@@ -104,12 +104,12 @@
 		count=count+1;
 	else
-		nods1=md.elements(el1,:);
-		flag=setdiff(nods1,md.elements(els2,:));
+		nods1=md.mesh.elements(el1,:);
+		flag=setdiff(nods1,md.mesh.elements(els2,:));
 		for j=1:3,
 			nods=nods1; nods(j)=[];
 			if any(ismember(flag,nods)),
 				segments(count,:)=[nods el1];
-				ord1=find(nods(1)==md.elements(el1,:));
-				ord2=find(nods(2)==md.elements(el1,:));
+				ord1=find(nods(1)==md.mesh.elements(el1,:));
+				ord2=find(nods(2)==md.mesh.elements(el1,:));
 				if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
 					temp=segments(count,1);
Index: /issm/trunk/src/m/model/contourmassbalance.m
===================================================================
--- /issm/trunk/src/m/model/contourmassbalance.m	(revision 9732)
+++ /issm/trunk/src/m/model/contourmassbalance.m	(revision 9733)
@@ -22,6 +22,6 @@
 
 %get flag list of elements and nodes inside the contour
-nodein=ContourToMesh(md.elements,md.x,md.y,file,'node',1);
-elemin=(sum(nodein(md.elements),2)==size(md.elements,2));
+nodein=ContourToMesh(md.mesh.elements,md.x,md.y,file,'node',1);
+elemin=(sum(nodein(md.mesh.elements),2)==size(md.mesh.elements,2));
 
 %conputing Mass flux
@@ -36,5 +36,5 @@
 flux = - md.materials.rho_ice*sum(L.*H.*(vx.*nx+vy.*ny)); %outflux is negative!
 disp(['mass outflux on ' file ' = ' num2str(-flux/10^9) ' Gt/yr']);
-areas=GetAreas(md.elements,md.x,md.y);
+areas=GetAreas(md.mesh.elements,md.x,md.y);
 dhdt=flux/(sum(areas(find(elemin)))*md.materials.rho_ice);
 disp(['dhdt on ' file ' (Flux  method) = ' num2str(dhdt) ' m/yr']);
Index: /issm/trunk/src/m/model/divergence.m
===================================================================
--- /issm/trunk/src/m/model/divergence.m	(revision 9732)
+++ /issm/trunk/src/m/model/divergence.m	(revision 9733)
@@ -8,5 +8,5 @@
 	numberofelements=md.mesh.numberofelements;
 	numberofnodes=md.mesh.numberofvertices;
-	index=md.elements;
+	index=md.mesh.elements;
 	x=md.x; y=md.y; z=md.z;
 else
Index: /issm/trunk/src/m/model/drivingstress.m
===================================================================
--- /issm/trunk/src/m/model/drivingstress.m	(revision 9732)
+++ /issm/trunk/src/m/model/drivingstress.m	(revision 9733)
@@ -12,5 +12,5 @@
 
 %Average thickness over elements
-thickness_bar=(md.geometry.thickness(md.elements(:,1))+md.geometry.thickness(md.elements(:,2))+md.geometry.thickness(md.elements(:,3)))/3;
+thickness_bar=(md.geometry.thickness(md.mesh.elements(:,1))+md.geometry.thickness(md.mesh.elements(:,2))+md.geometry.thickness(md.mesh.elements(:,3)))/3;
 
 px=md.materials.rho_ice*md.constants.g*thickness_bar.*sx;
Index: /issm/trunk/src/m/model/extrude.m
===================================================================
--- /issm/trunk/src/m/model/extrude.m	(revision 9732)
+++ /issm/trunk/src/m/model/extrude.m	(revision 9733)
@@ -82,5 +82,5 @@
 elements3d=[];
 for i=1:numlayers-1,
-	elements3d=[elements3d;[md.elements+(i-1)*md.mesh.numberofvertices md.elements+i*md.mesh.numberofvertices]]; %Create the elements of the 3d mesh for the non extruded part
+	elements3d=[elements3d;[md.mesh.elements+(i-1)*md.mesh.numberofvertices md.mesh.elements+i*md.mesh.numberofvertices]]; %Create the elements of the 3d mesh for the non extruded part
 end
 number_el3d=size(elements3d,1); %number of 3d nodes for the non extruded part of the mesh
@@ -105,5 +105,5 @@
 md.mesh.x2d=md.x;
 md.mesh.y2d=md.y;
-md.mesh.elements2d=md.elements;
+md.mesh.elements2d=md.mesh.elements;
 md.mesh.numberofelements2d=md.mesh.numberofelements;
 md.mesh.numberofvertices2d=md.mesh.numberofvertices;
@@ -113,5 +113,5 @@
 
 %Build global 3d mesh 
-md.elements=elements3d;
+md.mesh.elements=elements3d;
 md.x=x3d;
 md.y=y3d;
Index: /issm/trunk/src/m/model/kmlimagesc.m
===================================================================
--- /issm/trunk/src/m/model/kmlimagesc.m	(revision 9732)
+++ /issm/trunk/src/m/model/kmlimagesc.m	(revision 9733)
@@ -49,5 +49,5 @@
 
 %regrid to lat,long grid
-[x_m,y_m,field]=InterpFromMeshToGrid(md.elements,md.mesh.long,md.mesh.lat,field,minlong,maxlat,posting,posting,nlines,ncols,NaN);
+[x_m,y_m,field]=InterpFromMeshToGrid(md.mesh.elements,md.mesh.long,md.mesh.lat,field,minlong,maxlat,posting,posting,nlines,ncols,NaN);
 field=flipud(field);
 
Index: /issm/trunk/src/m/model/mechanicalproperties.m
===================================================================
--- /issm/trunk/src/m/model/mechanicalproperties.m	(revision 9732)
+++ /issm/trunk/src/m/model/mechanicalproperties.m	(revision 9733)
@@ -26,5 +26,5 @@
 %initialization
 numberofelements=md.mesh.numberofelements;
-index=md.elements;
+index=md.mesh.elements;
 summation=[1;1;1];
 directionsstress=zeros(numberofelements,4);
Index: /issm/trunk/src/m/model/mesh/findsegments.m
===================================================================
--- /issm/trunk/src/m/model/mesh/findsegments.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/findsegments.m	(revision 9733)
@@ -19,5 +19,5 @@
 		error(' ''mesh.elementconnectivity'' option does not have thge right size.');
 	else
-		mesh.elementconnectivity=ElementConnectivity(md.elements,md.mesh.vertexconnectivity);
+		mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 	end
 end
@@ -43,8 +43,8 @@
 
 		%get nodes of el1
-		nods1=md.elements(el1,:);
+		nods1=md.mesh.elements(el1,:);
 
 		%find the common vertices to the two elements connected to el1 (1 or 2)
-		flag=intersect(md.elements(els2(1),:),md.elements(els2(2),:));
+		flag=intersect(md.mesh.elements(els2(1),:),md.mesh.elements(els2(2),:));
 
 		%get the vertices on the boundary and build segment
@@ -53,6 +53,6 @@
 
 		%swap segment nodes if necessary
-		ord1=find(nods1(1)==md.elements(el1,:));
-		ord2=find(nods1(2)==md.elements(el1,:));
+		ord1=find(nods1(1)==md.mesh.elements(el1,:));
+		ord2=find(nods1(2)==md.mesh.elements(el1,:));
 		if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
 			temp=segments(count,1);
@@ -66,8 +66,8 @@
 	else
 		%get nodes of el1
-		nods1=md.elements(el1,:);
+		nods1=md.mesh.elements(el1,:);
 
 		%find the vertex  the el1 to not share with els2
-		flag=setdiff(nods1,md.elements(els2,:));
+		flag=setdiff(nods1,md.mesh.elements(els2,:));
 
 		for j=1:3,
@@ -78,6 +78,6 @@
 
 				%swap segment nodes if necessary
-				ord1=find(nods(1)==md.elements(el1,:));
-				ord2=find(nods(2)==md.elements(el1,:));
+				ord1=find(nods(1)==md.mesh.elements(el1,:));
+				ord2=find(nods(2)==md.mesh.elements(el1,:));
 				if ( (ord1==1 & ord2==2) | (ord1==2 & ord2==3) | (ord1==3 & ord2==1) ),
 					temp=segments(count,1);
Index: /issm/trunk/src/m/model/mesh/meshadaptation.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshadaptation.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/meshadaptation.m	(revision 9733)
@@ -24,5 +24,5 @@
 
 %initialization
-index=md.elements;
+index=md.mesh.elements;
 numberofnodes=md.mesh.numberofvertices;
 numberofelements=md.mesh.numberofelements;
Index: /issm/trunk/src/m/model/mesh/meshbamg.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshbamg.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/meshbamg.m	(revision 9733)
@@ -97,5 +97,5 @@
 	%set nodeonwater field
 	if ~strcmp(groundeddomain,'N/A'),
-		nodeground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
+		nodeground=ContourToMesh(md.mesh.elements,md.x,md.y,groundeddomain,'node',2);
 		md.nodeonwater=ones(md.mesh.numberofvertices,1);
 		md.nodeonwater(find(nodeground))=0;
Index: /issm/trunk/src/m/model/mesh/meshconvert.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshconvert.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/meshconvert.m	(revision 9733)
@@ -14,5 +14,5 @@
 	x=md.x;
 	y=md.y;
-	index=md.elements;
+	index=md.mesh.elements;
 else
 	x=varargin{1};
@@ -30,6 +30,6 @@
 md.x=bamgmesh_out.Vertices(:,1);
 md.y=bamgmesh_out.Vertices(:,2);
-md.elements=bamgmesh_out.Triangles(:,1:3);
-md.edges=bamgmesh_out.IssmEdges;
+md.mesh.elements=bamgmesh_out.Triangles(:,1:3);
+md.mesh.edges=bamgmesh_out.IssmEdges;
 md.mesh.segments=bamgmesh_out.IssmSegments(:,1:3);
 md.mesh.segmentmarkers=bamgmesh_out.IssmSegments(:,4);
@@ -37,7 +37,7 @@
 %Fill in rest of fields:
 md.mesh.dimension=2;
-md.mesh.numberofelements=size(md.elements,1);
+md.mesh.numberofelements=size(md.mesh.elements,1);
 md.mesh.numberofvertices=length(md.x);
-md.mesh.numberofedges=size(md.edges,1);
+md.mesh.numberofedges=size(md.mesh.edges,1);
 md.z=zeros(md.mesh.numberofvertices,1);
 md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
Index: /issm/trunk/src/m/model/mesh/meshexprefine.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshexprefine.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/meshexprefine.m	(revision 9733)
@@ -35,6 +35,6 @@
 
 %Read domainame file into a matlab array (x,y):
-refinearea=ContourToMesh(md.elements,md.x,md.y,domainname,'element',1);
-aires=GetAreas(md.elements,md.x,md.y);
+refinearea=ContourToMesh(md.mesh.elements,md.x,md.y,domainname,'element',1);
+aires=GetAreas(md.mesh.elements,md.x,md.y);
 
 %flags areas within the domain
Index: /issm/trunk/src/m/model/mesh/meshnodensity.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshnodensity.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/meshnodensity.m	(revision 9733)
@@ -25,5 +25,5 @@
 %Mesh using TriMeshNoDensity
 if strcmp(riftname,''),
-	[md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMeshNoDensity(domainname);
+	[md.mesh.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMeshNoDensity(domainname);
 else
 	[elements,x,y,segments,segmentmarkers]=TriMeshNoDensity(domainname,riftname);
@@ -49,5 +49,5 @@
 	md.x=x;
 	md.y=y;
-	md.elements=elements;
+	md.mesh.elements=elements;
 	md.mesh.segments=segments;
 	md.mesh.segmentmarkers=segmentmarkers;
@@ -55,5 +55,5 @@
 
 %Fill in rest of fields:
-md.mesh.numberofelements=length(md.elements);
+md.mesh.numberofelements=length(md.mesh.elements);
 md.mesh.numberofvertices=length(md.x);
 md.z=zeros(md.mesh.numberofvertices,1);
@@ -65,6 +65,6 @@
 
 %Now, build the connectivity tables for this mesh.
-md.mesh.vertexconnectivity=NodeConnectivity(md.elements,md.mesh.numberofvertices);
-md.mesh.elementconnectivity=ElementConnectivity(md.elements,md.mesh.vertexconnectivity);
+md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 
 %type of model
Index: /issm/trunk/src/m/model/mesh/meshrefine.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshrefine.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/meshrefine.m	(revision 9733)
@@ -16,8 +16,8 @@
 
 %Refine using TriMeshRefine
-[md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMeshRefine(md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers,areas,'yes');
+[md.mesh.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMeshRefine(md.mesh.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers,areas,'yes');
 
 %Fill in rest of fields:
-md.mesh.numberofelements=length(md.elements);
+md.mesh.numberofelements=length(md.mesh.elements);
 md.mesh.numberofvertices=length(md.x);
 md.z=zeros(md.mesh.numberofvertices,1);
@@ -29,6 +29,6 @@
 
 %Now, build the connectivity tables for this mesh.
-md.mesh.vertexconnectivity=NodeConnectivity(md.elements,md.mesh.numberofvertices);
-md.mesh.elementconnectivity=ElementConnectivity(md.elements,md.mesh.vertexconnectivity);
+md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 
 %type of model
Index: /issm/trunk/src/m/model/mesh/meshyams.m
===================================================================
--- /issm/trunk/src/m/model/mesh/meshyams.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/meshyams.m	(revision 9733)
@@ -81,5 +81,5 @@
 	%set nodeonwater field
 	if ~strcmp(groundeddomain,'N/A'),
-		nodeground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
+		nodeground=ContourToMesh(md.mesh.elements,md.x,md.y,groundeddomain,'node',2);
 		md.nodeonwater=ones(md.mesh.numberofvertices,1);
 		md.nodeonwater(find(nodeground))=0;
@@ -95,6 +95,6 @@
 	%rifts, because the segments are used in YamsCall to freeze the rifts elements during refinement.
 	if md.rifts.numrifts, 
-		md.mesh.vertexconnectivity=NodeConnectivity(md.elements,md.mesh.numberofvertices);
-		md.mesh.elementconnectivity=ElementConnectivity(md.elements,md.mesh.vertexconnectivity);
+		md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+		md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 		md.mesh.segments=findsegments(md);
 		md=meshyamsrecreateriftsegments(md);
@@ -106,6 +106,6 @@
 
 %Now, build the connectivity tables for this mesh.
-md.mesh.vertexconnectivity=NodeConnectivity(md.elements,md.mesh.numberofvertices);
-md.mesh.elementconnectivity=ElementConnectivity(md.elements,md.mesh.vertexconnectivity);
+md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 
 %recreate segments
@@ -120,5 +120,5 @@
 md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
 if ~strcmp(groundeddomain,'N/A'),
-	nodeground=ContourToMesh(md.elements,md.x,md.y,groundeddomain,'node',2);
+	nodeground=ContourToMesh(md.mesh.elements,md.x,md.y,groundeddomain,'node',2);
 	md.nodeonwater=ones(md.mesh.numberofvertices,1);
 	md.nodeonwater(find(nodeground))=0;
Index: /issm/trunk/src/m/model/mesh/reorder.m
===================================================================
--- /issm/trunk/src/m/model/mesh/reorder.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/reorder.m	(revision 9733)
@@ -20,5 +20,5 @@
 
 %update all fields
-md.elements=tnewnodes(md.elements(newelements,:));
+md.mesh.elements=tnewnodes(md.mesh.elements(newelements,:));
 md.mesh.segments=[tnewnodes(md.mesh.segments(:,1)) tnewnodes(md.mesh.segments(:,2)) tnewelements(md.mesh.segments(:,3))];
 md.x=md.x(newnodes);
Index: /issm/trunk/src/m/model/mesh/rifts/meshaddrifts.m
===================================================================
--- /issm/trunk/src/m/model/mesh/rifts/meshaddrifts.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/rifts/meshaddrifts.m	(revision 9733)
@@ -56,6 +56,6 @@
 	
 	%plug md2 mesh into md mesh: 
-	[md.elements,md.x,md.y,md.z,md.mesh.numberofelements,md.mesh.numberofvertices,elconv,nodeconv,elconv2,nodeconv2]=meshplug(md.elements,md.x,md.y,md.z,...
-								md2.elements,md2.x,md2.y,md2.z,md2.extractednodes,md2.extractedelements,domain_index);
+	[md.mesh.elements,md.x,md.y,md.z,md.mesh.numberofelements,md.mesh.numberofvertices,elconv,nodeconv,elconv2,nodeconv2]=meshplug(md.mesh.elements,md.x,md.y,md.z,...
+								md2.mesh.elements,md2.x,md2.y,md2.z,md2.extractednodes,md2.extractedelements,domain_index);
 
 	%update md2 rifts using elconv and nodeconv, and plug them into md: 
@@ -87,6 +87,6 @@
 
 %Now, build the connectivity tables for this mesh.
-md.mesh.vertexconnectivity=NodeConnectivity(md.elements,md.mesh.numberofvertices);
-md.mesh.elementconnectivity=ElementConnectivity(md.elements,md.mesh.vertexconnectivity);
+md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 
 %type of model
Index: /issm/trunk/src/m/model/mesh/rifts/meshprocessoutsiderifts.m
===================================================================
--- /issm/trunk/src/m/model/mesh/rifts/meshprocessoutsiderifts.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/rifts/meshprocessoutsiderifts.m	(revision 9733)
@@ -12,5 +12,5 @@
 	
 	%first, flag nodes that belong to the domain outline
-	flags=ContourToMesh(md.elements,md.x,md.y,domainoutline,'node',0);
+	flags=ContourToMesh(md.mesh.elements,md.x,md.y,domainoutline,'node',0);
 
 	rift=md.rifts.riftstruct(i);
@@ -43,5 +43,5 @@
 		while  flags(B), %as long as B does not belong to the domain outline, keep looking.
 			%detect elements on edge A,B:
-			edgeelements=ElementsFromEdge(md.elements,A,B);
+			edgeelements=ElementsFromEdge(md.mesh.elements,A,B);
 			%rule out those we already detected
 			already_detected=ismember(edgeelements,elements);
@@ -50,5 +50,5 @@
 			elements=[elements;nextelement];
 			%new B:
-			B=md.elements(nextelement,find(~ismember(md.elements(nextelement,:),[A B])));
+			B=md.mesh.elements(nextelement,find(~ismember(md.mesh.elements(nextelement,:),[A B])));
 		end
 		
@@ -61,8 +61,8 @@
 		
 		%replace tip in elements
-		newelements=md.elements(elements,:);
+		newelements=md.mesh.elements(elements,:);
 		pos=find(newelements==tip);
 		newelements(pos)=num;
-		md.elements(elements,:)=newelements;
+		md.mesh.elements(elements,:)=newelements;
 		md.rifts.riftstruct(i).tips=[md.rifts.riftstruct(i).tips num];
 
@@ -73,5 +73,5 @@
 			pos=find(md.mesh.segments(segment_index,1:2)~=tip);
 			other_node=md.mesh.segments(segment_index,pos);
-			if ~isconnected(md.elements,other_node,tip),
+			if ~isconnected(md.mesh.elements,other_node,tip),
 				pos=find(md.mesh.segments(segment_index,1:2)==tip);
 				md.mesh.segments(segment_index,pos)=num;
@@ -83,5 +83,5 @@
 
 %Fill in rest of fields:
-md.mesh.numberofelements=length(md.elements);
+md.mesh.numberofelements=length(md.mesh.elements);
 md.mesh.numberofvertices=length(md.x);
 md.z=zeros(md.mesh.numberofvertices,1);
Index: /issm/trunk/src/m/model/mesh/rifts/meshprocessrifts.m
===================================================================
--- /issm/trunk/src/m/model/mesh/rifts/meshprocessrifts.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/rifts/meshprocessrifts.m	(revision 9733)
@@ -25,5 +25,5 @@
 
 %Call MEX file
-[md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers,md.rifts.riftstruct]=TriMeshProcessRifts(md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers);
+[md.mesh.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers,md.rifts.riftstruct]=TriMeshProcessRifts(md.mesh.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers);
 md.rifts
 md.rifts.riftstruct
@@ -33,5 +33,5 @@
 
 %Fill in rest of fields:
-md.mesh.numberofelements=length(md.elements);
+md.mesh.numberofelements=length(md.mesh.elements);
 md.mesh.numberofvertices=length(md.x);
 md.z=zeros(md.mesh.numberofvertices,1);
@@ -51,5 +51,5 @@
 
 %In case we have rifts that open up the domain outline, we need to open them: 
-flags=ContourToMesh(md.elements,md.x,md.y,domainoutline,'node',0);
+flags=ContourToMesh(md.mesh.elements,md.x,md.y,domainoutline,'node',0);
 found=0;
 for i=1:md.rifts.numrifts,
@@ -68,5 +68,5 @@
 
 %get elements that are not correctly oriented in the correct direction:
-aires=GetAreas(md.elements,md.x,md.y);
+aires=GetAreas(md.mesh.elements,md.x,md.y);
 pos=find(aires<0);
-md.elements(pos,:)=[md.elements(pos,2) md.elements(pos,1) md.elements(pos,3)];
+md.mesh.elements(pos,:)=[md.mesh.elements(pos,2) md.mesh.elements(pos,1) md.mesh.elements(pos,3)];
Index: /issm/trunk/src/m/model/mesh/setmesh.m
===================================================================
--- /issm/trunk/src/m/model/mesh/setmesh.m	(revision 9732)
+++ /issm/trunk/src/m/model/mesh/setmesh.m	(revision 9733)
@@ -39,5 +39,5 @@
 %Mesh using TriMesh
 if strcmp(riftname,''),
-	[md.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMesh(domainname,area,'yes');
+	[md.mesh.elements,md.x,md.y,md.mesh.segments,md.mesh.segmentmarkers]=TriMesh(domainname,area,'yes');
 else
 	[elements,x,y,segments,segmentmarkers]=TriMesh(domainname,riftname,area,'yes');
@@ -63,5 +63,5 @@
 	md.x=x;
 	md.y=y;
-	md.elements=elements;
+	md.mesh.elements=elements;
 	md.mesh.segments=segments;
 	md.mesh.segmentmarkers=segmentmarkers;
@@ -69,5 +69,5 @@
 
 %Fill in rest of fields:
-md.mesh.numberofelements=length(md.elements);
+md.mesh.numberofelements=length(md.mesh.elements);
 md.mesh.numberofvertices=length(md.x);
 md.z=zeros(md.mesh.numberofvertices,1);
@@ -79,6 +79,6 @@
 
 %Now, build the connectivity tables for this mesh.
-md.mesh.vertexconnectivity=NodeConnectivity(md.elements,md.mesh.numberofvertices);
-md.mesh.elementconnectivity=ElementConnectivity(md.elements,md.mesh.vertexconnectivity);
+md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 
 %type of model
Index: /issm/trunk/src/m/model/misfit.m
===================================================================
--- /issm/trunk/src/m/model/misfit.m	(revision 9732)
+++ /issm/trunk/src/m/model/misfit.m	(revision 9733)
@@ -10,5 +10,5 @@
 
 if md.mesh.dimension==2,
-	elements=md.elements;
+	elements=md.mesh.elements;
 	x=md.x;
 	y=md.y;
Index: /issm/trunk/src/m/model/modelextract.m
===================================================================
--- /issm/trunk/src/m/model/modelextract.m	(revision 9732)
+++ /issm/trunk/src/m/model/modelextract.m	(revision 9733)
@@ -38,13 +38,13 @@
 %kick out all elements with 3 dirichlets
 spc_elem=find(~flag_elem);
-spc_node=sort(unique(md1.elements(spc_elem,:)));
+spc_node=sort(unique(md1.mesh.elements(spc_elem,:)));
 flag=ones(md1.numberofnodes,1);
 flag(spc_node)=0;
-pos=find(sum(flag(md1.elements),2)==0);
+pos=find(sum(flag(md1.mesh.elements),2)==0);
 flag_elem(pos)=0;
 
 %extracted elements and nodes lists
 pos_elem=find(flag_elem);
-pos_node=sort(unique(md1.elements(pos_elem,:)));
+pos_node=sort(unique(md1.mesh.elements(pos_elem,:)));
 
 %keep track of some fields
@@ -63,5 +63,5 @@
 
 %renumber the elements (some node won't exist anymore)
-elements_1=md1.elements;
+elements_1=md1.mesh.elements;
 elements_2=elements_1(pos_elem,:);
 elements_2(:,1)=Pnode(elements_2(:,1));
@@ -121,5 +121,5 @@
 	md2.numberofelements=numberofelements2;
 	md2.numberofnodes=numberofnodes2;
-	md2.elements=elements_2;
+	md2.mesh.elements=elements_2;
 
 	%mesh.uppervertex mesh.lowervertex
@@ -161,28 +161,28 @@
 
 	%Edges
-	if size(md2.edges,2)>1, %do not use ~isnan because there are some NaNs...
+	if size(md2.mesh.edges,2)>1, %do not use ~isnan because there are some NaNs...
 		%renumber first two columns
-		pos=find(~isnan(md2.edges(:,4)));
-		md2.edges(:  ,1)=Pnode(md2.edges(:,1)); 
-		md2.edges(:  ,2)=Pnode(md2.edges(:,2)); 
-		md2.edges(:  ,3)=Pelem(md2.edges(:,3));
-		md2.edges(pos,4)=Pelem(md2.edges(pos,4));
+		pos=find(~isnan(md2.mesh.edges(:,4)));
+		md2.mesh.edges(:  ,1)=Pnode(md2.mesh.edges(:,1)); 
+		md2.mesh.edges(:  ,2)=Pnode(md2.mesh.edges(:,2)); 
+		md2.mesh.edges(:  ,3)=Pelem(md2.mesh.edges(:,3));
+		md2.mesh.edges(pos,4)=Pelem(md2.mesh.edges(pos,4));
 		%remove edges when the 2 vertices are not in the domain.
-		md2.edges=md2.edges(find(md2.edges(:,1) & md2.edges(:,2)),:);
+		md2.mesh.edges=md2.mesh.edges(find(md2.mesh.edges(:,1) & md2.mesh.edges(:,2)),:);
 		%Replace all zeros by NaN in the last two columns;
-		pos=find(md2.edges(:,3)==0);
-		md2.edges(pos,3)=NaN;
-		pos=find(md2.edges(:,4)==0);
-		md2.edges(pos,4)=NaN;
+		pos=find(md2.mesh.edges(:,3)==0);
+		md2.mesh.edges(pos,3)=NaN;
+		pos=find(md2.mesh.edges(:,4)==0);
+		md2.mesh.edges(pos,4)=NaN;
 		%Invert NaN of the third column with last column (Also invert first two columns!!)
-		pos=find(isnan(md2.edges(:,3)));
-		md2.edges(pos,3)=md2.edges(pos,4);
-		md2.edges(pos,4)=NaN;
-		values=md2.edges(pos,2);
-		md2.edges(pos,2)=md2.edges(pos,1);
-		md2.edges(pos,1)=values;
+		pos=find(isnan(md2.mesh.edges(:,3)));
+		md2.mesh.edges(pos,3)=md2.mesh.edges(pos,4);
+		md2.mesh.edges(pos,4)=NaN;
+		values=md2.mesh.edges(pos,2);
+		md2.mesh.edges(pos,2)=md2.mesh.edges(pos,1);
+		md2.mesh.edges(pos,1)=values;
 		%Finally remove edges that do not belong to any element
-		pos=find(isnan(md2.edges(:,3)) & isnan(md2.edges(:,4)));
-		md2.edges(pos,:)=[];
+		pos=find(isnan(md2.mesh.edges(:,3)) & isnan(md2.mesh.edges(:,4)));
+		md2.mesh.edges(pos,:)=[];
 	end
 
@@ -203,6 +203,6 @@
 	%recreate segments
 	if md1.dim==2
-		md2.mesh.vertexconnectivity=NodeConnectivity(md2.elements,md2.numberofnodes);
-		md2.mesh.elementconnectivity=ElementConnectivity(md2.elements,md2.mesh.vertexconnectivity);
+		md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.numberofnodes);
+		md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity);
 		md2.segments=contourenvelope(md2);
 		md2.mesh.vertexonboundary=zeros(numberofnodes2,1); md2.nodeonboundary(md2.segments(:,1:2))=1;
@@ -212,5 +212,5 @@
 	%Catch the elements that have not been extracted
 	orphans_elem=find(~flag_elem);
-	orphans_node=unique(md1.elements(orphans_elem,:))';
+	orphans_node=unique(md1.mesh.elements(orphans_elem,:))';
 	%Figure out which node are on the boundary between md2 and md1
 	nodestoflag1=intersect(orphans_node,pos_node);
Index: /issm/trunk/src/m/model/partition/AreaAverageOntoPartition.m
===================================================================
--- /issm/trunk/src/m/model/partition/AreaAverageOntoPartition.m	(revision 9732)
+++ /issm/trunk/src/m/model/partition/AreaAverageOntoPartition.m	(revision 9733)
@@ -16,5 +16,5 @@
 	md3d=md;
 	
-	md.elements=md.mesh.elements2d;
+	md.mesh.elements=md.mesh.elements2d;
 	md.x=md.mesh.x2d;
 	md.y=md.mesh.y2d;
Index: /issm/trunk/src/m/model/partition/adjacency.m
===================================================================
--- /issm/trunk/src/m/model/partition/adjacency.m	(revision 9732)
+++ /issm/trunk/src/m/model/partition/adjacency.m	(revision 9733)
@@ -8,6 +8,6 @@
 %    md.qmu.vertex_weight        (double [nv], vertex weights)
 
-indi=[md.elements(:,1);md.elements(:,2);md.elements(:,3)];
-indj=[md.elements(:,2);md.elements(:,3);md.elements(:,1)];
+indi=[md.mesh.elements(:,1);md.mesh.elements(:,2);md.mesh.elements(:,3)];
+indj=[md.mesh.elements(:,2);md.mesh.elements(:,3);md.mesh.elements(:,1)];
 values=1;
 
@@ -16,8 +16,8 @@
 
 %now, build vwgt:
-areas=GetAreas(md.elements,md.x,md.y);
+areas=GetAreas(md.mesh.elements,md.x,md.y);
 
 %get node connectivity
-md.mesh.vertexconnectivity=NodeConnectivity(md.elements,md.mesh.numberofvertices);
+md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
 
 connectivity=md.mesh.vertexconnectivity(:,1:end-1);
Index: /issm/trunk/src/m/model/partition/partitioner.m
===================================================================
--- /issm/trunk/src/m/model/partition/partitioner.m	(revision 9732)
+++ /issm/trunk/src/m/model/partition/partitioner.m	(revision 9733)
@@ -34,5 +34,5 @@
 	%extrude the partition vector vertically. 
 	md3d=md; %save  for later
-	md.elements=md.mesh.elements2d;
+	md.mesh.elements=md.mesh.elements2d;
 	md.x=md.mesh.x2d;
 	md.y=md.mesh.y2d;
Index: /issm/trunk/src/m/model/plot/applyoptions.m
===================================================================
--- /issm/trunk/src/m/model/plot/applyoptions.m	(revision 9732)
+++ /issm/trunk/src/m/model/plot/applyoptions.m	(revision 9733)
@@ -437,5 +437,5 @@
 %flag edges of a partition
 if exist(options,'partitionedges')
-[xsegments ysegments]=flagedges(md.elements,md.x,md.y,md.qmu.partition);
+[xsegments ysegments]=flagedges(md.mesh.elements,md.x,md.y,md.qmu.partition);
 xsegments=xsegments*getfieldvalue(options,'unit',1);
 ysegments=ysegments*getfieldvalue(options,'unit',1);
Index: /issm/trunk/src/m/model/plot/plot_edges.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_edges.m	(revision 9732)
+++ /issm/trunk/src/m/model/plot/plot_edges.m	(revision 9733)
@@ -12,5 +12,5 @@
 %process mesh and data
 [x y z elements is2d isplanet]=processmesh(md,[],options);
-edges=md.edges;
+edges=md.mesh.edges;
 if isnan(edges)
 	error('edges in NaN')
Index: /issm/trunk/src/m/model/plot/plot_rifts.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_rifts.m	(revision 9732)
+++ /issm/trunk/src/m/model/plot/plot_rifts.m	(revision 9733)
@@ -30,5 +30,5 @@
 			tip=md.rifts.riftstruct(i).tips(3);
 			%who is tip connected to? 
-			if isconnected(md.elements,penaltypairs(1,1),tip),
+			if isconnected(md.mesh.elements,penaltypairs(1,1),tip),
 				normal(1)=penaltypairs(1,5);
 				normal(2)=penaltypairs(1,6);
@@ -37,5 +37,5 @@
 			end
 
-			if isconnected(md.elements,penaltypairs(1,2),tip),
+			if isconnected(md.mesh.elements,penaltypairs(1,2),tip),
 				normal(1)=penaltypairs(1,5);
 				normal(2)=penaltypairs(1,6);
@@ -43,5 +43,5 @@
 				y(tip)=y(tip)+normal(2)*offset;
 			end
-			if isconnected(md.elements,penaltypairs(end,1),tip),
+			if isconnected(md.mesh.elements,penaltypairs(end,1),tip),
 				normal(1)=penaltypairs(end,5);
 				normal(2)=penaltypairs(end,6);
@@ -49,5 +49,5 @@
 				y(tip)=y(tip)-normal(2)*offset;
 			end
-			if isconnected(md.elements,penaltypairs(end,2),tip),
+			if isconnected(md.mesh.elements,penaltypairs(end,2),tip),
 				normal(1)=penaltypairs(end,5);
 				normal(2)=penaltypairs(end,6);
Index: /issm/trunk/src/m/model/plot/plot_section.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_section.m	(revision 9732)
+++ /issm/trunk/src/m/model/plot/plot_section.m	(revision 9733)
@@ -32,5 +32,5 @@
 md3d=md;
 if exist(options,'layer')
-	md.x=md.mesh.x2d; md.y=md.mesh.y2d; md.elements=md.mesh.elements2d; md.mesh.dimension=2;
+	md.x=md.mesh.x2d; md.y=md.mesh.y2d; md.mesh.elements=md.mesh.elements2d; md.mesh.dimension=2;
 end
 
Index: /issm/trunk/src/m/model/plot/plot_tensor_principalaxis.m
===================================================================
--- /issm/trunk/src/m/model/plot/plot_tensor_principalaxis.m	(revision 9732)
+++ /issm/trunk/src/m/model/plot/plot_tensor_principalaxis.m	(revision 9733)
@@ -29,5 +29,5 @@
 %take the center of each element if ~isonnode
 if datatype==1,
-	x=mean(md.x(md.elements'))'; y=mean(md.y(md.elements'))'; z=mean(md.z(md.elements'))';
+	x=mean(md.x(md.mesh.elements'))'; y=mean(md.y(md.mesh.elements'))'; z=mean(md.z(md.mesh.elements'))';
 end
 
Index: /issm/trunk/src/m/model/plot/processdata.m
===================================================================
--- /issm/trunk/src/m/model/plot/processdata.m	(revision 9732)
+++ /issm/trunk/src/m/model/plot/processdata.m	(revision 9733)
@@ -123,5 +123,5 @@
 		pos=find(~flags);
 		if length(flags)==md.mesh.numberofvertices,
-			[pos2 dummy]=find(ismember(md.elements,pos));
+			[pos2 dummy]=find(ismember(md.mesh.elements,pos));
 			data(pos2,:)=NaN;
 		elseif length(flags)==md.mesh.numberofelements
@@ -155,5 +155,5 @@
 			data(pos,:)=NaN;
 		elseif length(flags)==md.mesh.numberofelements
-			data(md.elements(pos,:),:)=NaN;
+			data(md.mesh.elements(pos,:),:)=NaN;
 		else
 			disp('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements');
Index: /issm/trunk/src/m/model/plot/processmesh.m
===================================================================
--- /issm/trunk/src/m/model/plot/processmesh.m	(revision 9732)
+++ /issm/trunk/src/m/model/plot/processmesh.m	(revision 9733)
@@ -38,5 +38,5 @@
 
 	elements2d=md.mesh.elements2d;
-	elements=md.elements;
+	elements=md.mesh.elements;
 
 	%is it a 2d plot?
Index: /issm/trunk/src/m/model/setflowequation.m
===================================================================
--- /issm/trunk/src/m/model/setflowequation.m	(revision 9732)
+++ /issm/trunk/src/m/model/setflowequation.m	(revision 9733)
@@ -72,10 +72,10 @@
 %1: Hutter elements
 nodeonhutter=zeros(md.mesh.numberofvertices,1);
-nodeonhutter(md.elements(find(hutterflag),:))=1;
+nodeonhutter(md.mesh.elements(find(hutterflag),:))=1;
 md.flowequation.element_equation(find(hutterflag))=1;
 
 %2: MacAyeal elements
 nodeonmacayeal=zeros(md.mesh.numberofvertices,1);
-nodeonmacayeal(md.elements(find(macayealflag),:))=1;
+nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
 md.flowequation.bordermacayeal=nodeonmacayeal;
 md.flowequation.element_equation(find(macayealflag))=2;
@@ -83,5 +83,5 @@
 %3: Pattyn elements
 nodeonpattyn=zeros(md.mesh.numberofvertices,1);
-nodeonpattyn(md.elements(find(pattynflag),:))=1;
+nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
 md.flowequation.borderpattyn=nodeonpattyn;
 md.flowequation.element_equation(find(pattynflag))=3;
@@ -91,11 +91,11 @@
 if any(stokesflag),
 	nodeonstokes=zeros(md.mesh.numberofvertices,1);
-	nodeonstokes(md.elements(find(stokesflag),:))=1;
+	nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
 	fullspcnodes=double((~isnan(md.diagnostic.spcvx)+~isnan(md.diagnostic.spcvy)+~isnan(md.diagnostic.spcvz))==3 | (nodeonpattyn & nodeonstokes));         %find all the nodes on the boundary of the domain without icefront
-	fullspcelems=double(sum(fullspcnodes(md.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
+	fullspcelems=double(sum(fullspcnodes(md.mesh.elements),2)==6);         %find all the nodes on the boundary of the domain without icefront
 	stokesflag(find(fullspcelems))=0;
 end
 nodeonstokes=zeros(md.mesh.numberofvertices,1);
-nodeonstokes(md.elements(find(stokesflag),:))=1;
+nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
 md.flowequation.borderstokes=nodeonstokes;
 md.flowequation.element_equation(find(stokesflag))=4;
@@ -105,10 +105,10 @@
 	if any(pattynflag), %fill with pattyn
 		pattynflag(~stokesflag)=1;
-		nodeonpattyn(md.elements(find(pattynflag),:))=1;
+		nodeonpattyn(md.mesh.elements(find(pattynflag),:))=1;
 		md.flowequation.borderpattyn=nodeonpattyn;
 		md.flowequation.element_equation(find(~stokesflag))=3;
 	elseif any(macayealflag), %fill with macayeal
 		macayealflag(~stokesflag)=1;
-		nodeonmacayeal(md.elements(find(macayealflag),:))=1;
+		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
 		md.flowequation.bordermacayeal=nodeonmacayeal;
 		md.flowequation.element_equation(find(~stokesflag))=2;
@@ -143,5 +143,5 @@
 		nodeonmacayealpattyn(find(nodeonmacayeal & nodeonpattyn))=1;
 		%Macayeal elements in contact with this layer become MacAyealPattyn elements
-		matrixelements=ismember(md.elements,find(nodeonmacayealpattyn));
+		matrixelements=ismember(md.mesh.elements,find(nodeonmacayealpattyn));
 		commonelements=sum(matrixelements,2)~=0;
 		commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
@@ -150,5 +150,5 @@
 		macayealpattynflag(find(commonelements))=1;
 		nodeonmacayeal=zeros(md.mesh.numberofvertices,1);
-		nodeonmacayeal(md.elements(find(macayealflag),:))=1;
+		nodeonmacayeal(md.mesh.elements(find(macayealflag),:))=1;
 		md.flowequation.bordermacayeal=nodeonmacayeal;
 
@@ -157,10 +157,10 @@
 
 		%Now recreate nodeonmacayeal and nodeonmacayealpattyn
-		nodeonmacayealpattyn(md.elements(find(macayealpattynflag),:))=1;
+		nodeonmacayealpattyn(md.mesh.elements(find(macayealpattynflag),:))=1;
 	elseif any(pattynflag) & any(stokesflag), %coupling pattyn stokes
 		%Find node at the border
 		nodeonpattynstokes(find(nodeonpattyn & nodeonstokes))=1;
 		%Stokes elements in contact with this layer become PattynStokes elements
-		matrixelements=ismember(md.elements,find(nodeonpattynstokes));
+		matrixelements=ismember(md.mesh.elements,find(nodeonpattynstokes));
 		commonelements=sum(matrixelements,2)~=0;
 		commonelements(find(pattynflag))=0; %only one layer: the elements previously in macayeal
@@ -169,5 +169,5 @@
 		pattynstokesflag(find(commonelements))=1;
 		nodeonstokes=zeros(md.mesh.numberofvertices,1);
-		nodeonstokes(md.elements(find(stokesflag),:))=1;
+		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
 		md.flowequation.borderstokes=nodeonstokes;
 
@@ -177,10 +177,10 @@
 		%Now recreate nodeonpattynstokes
 		nodeonpattynstokes=zeros(md.mesh.numberofvertices,1);
-		nodeonpattynstokes(md.elements(find(pattynstokesflag),:))=1;
+		nodeonpattynstokes(md.mesh.elements(find(pattynstokesflag),:))=1;
 	elseif any(stokesflag) & any(macayealflag),
 		%Find node at the border
 		nodeonmacayealstokes(find(nodeonmacayeal & nodeonstokes))=1;
 		%Stokes elements in contact with this layer become MacAyealStokes elements
-		matrixelements=ismember(md.elements,find(nodeonmacayealstokes));
+		matrixelements=ismember(md.mesh.elements,find(nodeonmacayealstokes));
 		commonelements=sum(matrixelements,2)~=0;
 		commonelements(find(macayealflag))=0; %only one layer: the elements previously in macayeal
@@ -189,5 +189,5 @@
 		macayealstokesflag(find(commonelements))=1;
 		nodeonstokes=zeros(md.mesh.numberofvertices,1);
-		nodeonstokes(md.elements(find(stokesflag),:))=1;
+		nodeonstokes(md.mesh.elements(find(stokesflag),:))=1;
 		md.flowequation.borderstokes=nodeonstokes;
 
@@ -197,5 +197,5 @@
 		%Now recreate nodeonmacayealstokes
 		nodeonmacayealstokes=zeros(md.mesh.numberofvertices,1);
-		nodeonmacayealstokes(md.elements(find(macayealstokesflag),:))=1;
+		nodeonmacayealstokes(md.mesh.elements(find(macayealstokesflag),:))=1;
 	elseif any(stokesflag) & any(hutterflag),
 		error('type of coupling not supported yet');
Index: /issm/trunk/src/m/model/setmask.m
===================================================================
--- /issm/trunk/src/m/model/setmask.m	(revision 9732)
+++ /issm/trunk/src/m/model/setmask.m	(revision 9733)
@@ -23,5 +23,5 @@
 x=md.x;
 y=md.y;
-elements=md.elements;
+elements=md.mesh.elements;
 
 %Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{1
@@ -37,5 +37,5 @@
 vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
 vertexongroundedice=zeros(md.mesh.numberofvertices,1);
-vertexongroundedice(md.elements(find(elementongroundedice),:))=1;
+vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
 vertexonfloatingice(find(~vertexongroundedice))=1;
 %}}}
Index: /issm/trunk/src/m/model/setmask2.m
===================================================================
--- /issm/trunk/src/m/model/setmask2.m	(revision 9732)
+++ /issm/trunk/src/m/model/setmask2.m	(revision 9733)
@@ -11,5 +11,5 @@
 x=md.x;
 y=md.y;
-elements=md.elements;
+elements=md.mesh.elements;
 
 %recover elements and nodes on land.
@@ -22,5 +22,5 @@
 	elementonland=landname;
 	vertexonland=zeros(md.mesh.numberofvertices,1);
-	vertexonland(md.elements(find(elementonland),:))=1;
+	vertexonland(md.mesh.elements(find(elementonland),:))=1;
 else
 	error('Invalid area option option');
@@ -29,13 +29,13 @@
 %Now, build the connectivity tables for this mesh.
 if size(md.mesh.vertexconnectivity,1)~=md.mesh.numberofvertices,
-	md.mesh.vertexconnectivity=NodeConnectivity(md.elements,md.mesh.numberofvertices);
+	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
 end
 if size(md.mesh.elementconnectivity,1)~=md.mesh.numberofelements,
-	md.mesh.elementconnectivity=ElementConnectivity(md.elements,md.mesh.vertexconnectivity);
+	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 end
 
 %any element with 3 nodes on land should be on land:
 elementsonwater=find(~elementonland);
-wrongelements=elementsonwater(find(( vertexonland(md.elements(elementsonwater,1)) + vertexonland(md.elements(elementsonwater,2)) + vertexonland(md.elements(elementsonwater,3)) ...
+wrongelements=elementsonwater(find(( vertexonland(md.mesh.elements(elementsonwater,1)) + vertexonland(md.mesh.elements(elementsonwater,2)) + vertexonland(md.mesh.elements(elementsonwater,3)) ...
                   )==3));
 elementonland(wrongelements)=1;
@@ -45,6 +45,6 @@
 weights={[1;1;1],[2;1;1],[1;2;1],[1;1;2]};
 	for i=1:length(weights),
-		xelem=x(md.elements)*weights{i}/sum(weights{i});
-		yelem=y(md.elements)*weights{i}/sum(weights{i});
+		xelem=x(md.mesh.elements)*weights{i}/sum(weights{i});
+		yelem=y(md.mesh.elements)*weights{i}/sum(weights{i});
 	end
 	baryonland=ContourToNodes(xelem,yelem,landname,1);
@@ -79,6 +79,6 @@
 elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
 elementongroundedice=double(~elementonfloatingice);
-vertexonfloatingice(md.elements(find(elementonfloatingice),:))=1;
-vertexongroundedice(md.elements(find(elementongroundedice),:))=1;
+vertexonfloatingice(md.mesh.elements(find(elementonfloatingice),:))=1;
+vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
 
 %now correct, so that none of the floatingice and groundedice elements and nodes are in the water.
Index: /issm/trunk/src/m/model/shear2d.m
===================================================================
--- /issm/trunk/src/m/model/shear2d.m	(revision 9732)
+++ /issm/trunk/src/m/model/shear2d.m	(revision 9733)
@@ -8,11 +8,11 @@
 %      s=shear2d(md);
 
-[alpha beta]=GetNodalFunctionsCoeff(md.elements,md.x,md.y); 
+[alpha beta]=GetNodalFunctionsCoeff(md.mesh.elements,md.x,md.y); 
 
 summation=[1;1;1];
-sx=(md.initialization.vx(md.elements).*alpha)*summation;
-uy=(md.initialization.vx(md.elements).*beta)*summation;
-vx=(md.initialization.vy(md.elements).*alpha)*summation;
-sy=(md.initialization.vy(md.elements).*beta)*summation;						
+sx=(md.initialization.vx(md.mesh.elements).*alpha)*summation;
+uy=(md.initialization.vx(md.mesh.elements).*beta)*summation;
+vx=(md.initialization.vy(md.mesh.elements).*alpha)*summation;
+sy=(md.initialization.vy(md.mesh.elements).*beta)*summation;						
 sxy=(uy+vx)/2;
 s=sqrt(sx.^2+sy.^2+sxy.^2+sx.*sy);
Index: /issm/trunk/src/m/model/sia.m
===================================================================
--- /issm/trunk/src/m/model/sia.m	(revision 9732)
+++ /issm/trunk/src/m/model/sia.m	(revision 9733)
@@ -17,6 +17,6 @@
 %Average thickness and B over all elements.
 summer=[1;1;1];
-hel=md.geometry.thickness(md.elements)*summer/3;
-Bel=md.B(md.elements)*summer/3;
+hel=md.geometry.thickness(md.mesh.elements)*summer/3;
+Bel=md.B(md.mesh.elements)*summer/3;
 
 Ael=Bel.^(-3);
Index: /issm/trunk/src/m/model/slope.m
===================================================================
--- /issm/trunk/src/m/model/slope.m	(revision 9732)
+++ /issm/trunk/src/m/model/slope.m	(revision 9733)
@@ -9,5 +9,5 @@
 	numberofelements=md.mesh.numberofelements;
 	numberofnodes=md.mesh.numberofvertices;
-	index=md.elements;
+	index=md.mesh.elements;
 	x=md.x; y=md.y;
 else
Index: /issm/trunk/src/m/model/thicknessevolution.m
===================================================================
--- /issm/trunk/src/m/model/thicknessevolution.m	(revision 9732)
+++ /issm/trunk/src/m/model/thicknessevolution.m	(revision 9733)
@@ -17,8 +17,8 @@
 vx=md.initialization.vx;
 vy=md.initialization.vy;
-index=md.elements;
+index=md.mesh.elements;
 
 %compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
-[alpha beta]=GetNodalFunctionsCoeff(md.elements,md.x,md.y); 
+[alpha beta]=GetNodalFunctionsCoeff(md.mesh.elements,md.x,md.y); 
 
 %compute dhdt=div(Hu)
Index: /issm/trunk/src/m/planet/planetmixedmesh.m
===================================================================
--- /issm/trunk/src/m/planet/planetmixedmesh.m	(revision 9732)
+++ /issm/trunk/src/m/planet/planetmixedmesh.m	(revision 9733)
@@ -86,5 +86,5 @@
 
 
-md.elements=quads;
+md.mesh.elements=quads;
 md.x=x;
 md.y=y;
@@ -95,5 +95,5 @@
 
 md.mesh.numberofvertices=length(md.x);
-md.mesh.numberofelements=size(md.elements,1);
+md.mesh.numberofelements=size(md.mesh.elements,1);
 
 md.mesh.dimension=3;
Index: /issm/trunk/src/m/planet/planettrimesh.m
===================================================================
--- /issm/trunk/src/m/planet/planettrimesh.m	(revision 9732)
+++ /issm/trunk/src/m/planet/planettrimesh.m	(revision 9733)
@@ -9,5 +9,5 @@
 md.y=results.vertices(:,2);
 md.z=results.vertices(:,3);
-md.elements=results.faces;
+md.mesh.elements=results.faces;
 
 md.r=sqrt(md.x.^2+md.y.^2+md.z.^2);
@@ -16,5 +16,5 @@
 
 md.mesh.numberofvertices=length(md.x);
-md.mesh.numberofelements=size(md.elements,1);
+md.mesh.numberofelements=size(md.mesh.elements,1);
 
 md.mesh.dimension=3;
Index: /issm/trunk/src/m/qmu/importancefactors.m
===================================================================
--- /issm/trunk/src/m/qmu/importancefactors.m	(revision 9732)
+++ /issm/trunk/src/m/qmu/importancefactors.m	(revision 9733)
@@ -53,5 +53,5 @@
 %if numel(factors)==md.mesh.numberofvertices,
 %	%get areas for each vertex.
-%	aire=GetAreas(md.elements,md.x,md.y);
+%	aire=GetAreas(md.mesh.elements,md.x,md.y);
 %	num_elements_by_node=md.nodeconnectivity(:,end);
 %	grid_aire=zeros(md.mesh.numberofvertices,1);
Index: /issm/trunk/src/m/qmu/process_qmu_response_data.m
===================================================================
--- /issm/trunk/src/m/qmu/process_qmu_response_data.m	(revision 9732)
+++ /issm/trunk/src/m/qmu/process_qmu_response_data.m	(revision 9733)
@@ -47,5 +47,5 @@
 
 	for i=1:num_mass_flux,
-		md.qmu.mass_flux_segments{i}=MeshProfileIntersection(md.elements,md.x,md.y,[md.qmu.mass_flux_profile_directory '/' md.qmu.mass_flux_profiles{i}]);
+		md.qmu.mass_flux_segments{i}=MeshProfileIntersection(md.mesh.elements,md.x,md.y,[md.qmu.mass_flux_profile_directory '/' md.qmu.mass_flux_profiles{i}]);
 	end
 
Index: /issm/trunk/src/m/solutions/flaim.m
===================================================================
--- /issm/trunk/src/m/solutions/flaim.m	(revision 9732)
+++ /issm/trunk/src/m/solutions/flaim.m	(revision 9733)
@@ -80,5 +80,5 @@
 
 display('Calling KMLMeshWrite.');
-KMLMeshWrite(md.miscellaneous.name,md.miscellaneous.notes,md.elements,md.nodeconnectivity,md.mesh.lat,md.mesh.long,md.qmu.partition,md.flaim.criterion,options.cmap,filekml);
+KMLMeshWrite(md.miscellaneous.name,md.miscellaneous.notes,md.mesh.elements,md.nodeconnectivity,md.mesh.lat,md.mesh.long,md.qmu.partition,md.flaim.criterion,options.cmap,filekml);
 %  for testing
 %filekml='issm-split-geikie1-targets.kml';
Index: /issm/trunk/src/m/utils/BC/SetIceShelfBC.m
===================================================================
--- /issm/trunk/src/m/utils/BC/SetIceShelfBC.m	(revision 9732)
+++ /issm/trunk/src/m/utils/BC/SetIceShelfBC.m	(revision 9733)
@@ -19,5 +19,5 @@
 	icefrontfile=varargin{1};
 	if ~exist(icefrontfile), error(['SetIceShelfBC error message: ice front file ' icefrontfile ' not found']); end
-	nodeinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2);
+	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.x,md.y,icefrontfile,'node',2);
 	nodeonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
 elseif nargin==1,
Index: /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m
===================================================================
--- /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 9732)
+++ /issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m	(revision 9733)
@@ -23,10 +23,10 @@
 		error(['SetMarineIceSheetBC error message: ice front file ' icefrontfile ' not found']);
 	end
-	nodeinsideicefront=ContourToMesh(md.elements,md.x,md.y,icefrontfile,'node',2);
+	nodeinsideicefront=ContourToMesh(md.mesh.elements,md.x,md.y,icefrontfile,'node',2);
 	vertexonicefront=double(md.mesh.vertexonboundary & nodeinsideicefront);
 else
 	%Guess where the ice front is
 	vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
-	vertexonfloatingice(md.elements(find(md.mask.elementonfloatingice),:))=1;
+	vertexonfloatingice(md.mesh.elements(find(md.mask.elementonfloatingice),:))=1;
 	vertexonicefront=double(md.mesh.vertexonboundary & vertexonfloatingice);
 end
Index: /issm/trunk/src/m/utils/Exp/clicktoflowline.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/clicktoflowline.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Exp/clicktoflowline.m	(revision 9733)
@@ -4,5 +4,5 @@
 % Usage: clicktoflowline(index,x,y,u,v,x0,y0,filename)
 %
-% Ex: clicktoflowline(md.elements,md.x,md.y,md.inversion.vx_obs,md.inversion.vy_obs,'flowline1.exp')
+% Ex: clicktoflowline(md.mesh.elements,md.x,md.y,md.inversion.vx_obs,md.inversion.vy_obs,'flowline1.exp')
 
 
Index: /issm/trunk/src/m/utils/Exp/downstreamflowlines.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/downstreamflowlines.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Exp/downstreamflowlines.m	(revision 9733)
@@ -10,5 +10,5 @@
 %
 %   Example:
-%      flowpath=downstreamflowlines(md.elements,md.x,md.y,md.vx,md.initialization.vy,x0,y0)
+%      flowpath=downstreamflowlines(md.mesh.elements,md.x,md.y,md.vx,md.initialization.vy,x0,y0)
 
 %check input size
Index: /issm/trunk/src/m/utils/Exp/flowlines.m
===================================================================
--- /issm/trunk/src/m/utils/Exp/flowlines.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Exp/flowlines.m	(revision 9733)
@@ -10,5 +10,5 @@
 %
 %   Example:
-%      flowpath=flowlines(md.elements,md.x,md.y,md.vx,md.initialization.vy,x0,y0)
+%      flowpath=flowlines(md.mesh.elements,md.x,md.y,md.vx,md.initialization.vy,x0,y0)
 
 %check input size
Index: /issm/trunk/src/m/utils/Geometry/FlagElements.m
===================================================================
--- /issm/trunk/src/m/utils/Geometry/FlagElements.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Geometry/FlagElements.m	(revision 9733)
@@ -34,8 +34,8 @@
 				[xlim,ylim]=basinzoom('basin',region);
 				flag_nodes=double(md.x<xlim(2) & md.x>xlim(1) &  md.y<ylim(2) & md.y>ylim(1));
-				flag=prod(flag_nodes(md.elements),2);
+				flag=prod(flag_nodes(md.mesh.elements),2);
 			else
 				%ok, flag elements
-				flag=ContourToMesh(md.elements(:,1:3),md.x,md.y,region,'element',1);
+				flag=ContourToMesh(md.mesh.elements(:,1:3),md.x,md.y,region,'element',1);
 			end
 		end
Index: /issm/trunk/src/m/utils/Interp/FillHole.m
===================================================================
--- /issm/trunk/src/m/utils/Interp/FillHole.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Interp/FillHole.m	(revision 9733)
@@ -6,5 +6,5 @@
 %
 %   Example:
-%      md.geometry.surface=FillHole(md.elements,x,md.y,md.geometry.surface)
+%      md.geometry.surface=FillHole(md.mesh.elements,x,md.y,md.geometry.surface)
 %
 
Index: /issm/trunk/src/m/utils/Mesh/BamgCall.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/BamgCall.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/BamgCall.m	(revision 9733)
@@ -20,5 +20,5 @@
 %Compute Hessian
 t1=clock; fprintf('%s','      computing Hessian...');
-hessian=ComputeHessian(md.elements,md.x,md.y,field,'node');
+hessian=ComputeHessian(md.mesh.elements,md.x,md.y,field,'node');
 t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
 
@@ -54,5 +54,5 @@
 %Triangles
 fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
-fprintf(fid,'%i %i %i %i\n',[md.elements ones(md.mesh.numberofelements,1)]');
+fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
 numberofelements1=md.mesh.numberofelements;
 
@@ -71,5 +71,5 @@
 md.y=A.y;
 md.z=zeros(A.nods,1);
-md.elements=A.index;
+md.mesh.elements=A.index;
 md.mesh.numberofvertices=A.nods;
 md.mesh.numberofelements=A.nels;
Index: /issm/trunk/src/m/utils/Mesh/BamgCallFromMetric.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/BamgCallFromMetric.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/BamgCallFromMetric.m	(revision 9733)
@@ -35,5 +35,5 @@
 %Triangles
 fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
-fprintf(fid,'%i %i %i %i\n',[md.elements ones(md.mesh.numberofelements,1)]');
+fprintf(fid,'%i %i %i %i\n',[md.mesh.elements ones(md.mesh.numberofelements,1)]');
 numberofelements1=md.mesh.numberofelements;
 
@@ -52,5 +52,5 @@
 md.y=A.y;
 md.z=zeros(A.nods,1);
-md.elements=A.index;
+md.mesh.elements=A.index;
 md.mesh.numberofvertices=A.nods;
 md.mesh.numberofelements=A.nels;
Index: /issm/trunk/src/m/utils/Mesh/ComputeHessian.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/ComputeHessian.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/ComputeHessian.m	(revision 9733)
@@ -10,5 +10,5 @@
 %
 %   Example:
-%      hessian=ComputeHessian(md.elements,md.x,md.y,md.inversion.vel_obs,'node')
+%      hessian=ComputeHessian(md.mesh.elements,md.x,md.y,md.inversion.vel_obs,'node')
 
 %some variables
Index: /issm/trunk/src/m/utils/Mesh/ElementsFromEdge.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/ElementsFromEdge.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/ElementsFromEdge.m	(revision 9733)
@@ -4,5 +4,5 @@
 % Usage: edgeelements=ElementsFromEdge(elements,A,B) 
 %
-% Eg:    edgeelements=ElementsFromEdge(md.elements,tip1,tip2)
+% Eg:    edgeelements=ElementsFromEdge(md.mesh.elements,tip1,tip2)
 %
 %
Index: /issm/trunk/src/m/utils/Mesh/GetAreas.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/GetAreas.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/GetAreas.m	(revision 9733)
@@ -10,6 +10,6 @@
 %
 %   Examples:
-%      areas  =GetAreas(md.elements,md.x,md.y);
-%      volumes=GetAreas(md.elements,md.x,md.y,md.z);
+%      areas  =GetAreas(md.mesh.elements,md.x,md.y);
+%      volumes=GetAreas(md.mesh.elements,md.x,md.y,md.z);
 
 %get number of elements and number of nodes
Index: /issm/trunk/src/m/utils/Mesh/GetCharacteristicLength.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/GetCharacteristicLength.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/GetCharacteristicLength.m	(revision 9733)
@@ -9,6 +9,6 @@
 %
 %   Examples:
-%      length  =GetCharacteristicLength(md.elements,md.x,md.y);
-%      length  =GetCharacteristicLength(md.elements,md.x,md.y,md.z);
+%      length  =GetCharacteristicLength(md.mesh.elements,md.x,md.y);
+%      length  =GetCharacteristicLength(md.mesh.elements,md.x,md.y,md.z);
 
 
Index: /issm/trunk/src/m/utils/Mesh/GetNodalFunctionsCoeff.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/GetNodalFunctionsCoeff.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/GetNodalFunctionsCoeff.m	(revision 9733)
@@ -12,5 +12,5 @@
 %
 %   Example:
-%      [alpha beta gamma]=GetNodalFunctionsCoeff(md.elements,md.x,md.y);
+%      [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.x,md.y);
 
 %make columns out of x and y
Index: /issm/trunk/src/m/utils/Mesh/MeshQuality.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/MeshQuality.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/MeshQuality.m	(revision 9733)
@@ -6,5 +6,5 @@
 
 %Get some variables from the model
-index=md.elements;
+index=md.mesh.elements;
 x=md.x;
 y=md.y;
Index: /issm/trunk/src/m/utils/Mesh/ProfileProjectOntoMesh.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/ProfileProjectOntoMesh.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/ProfileProjectOntoMesh.m	(revision 9733)
@@ -8,5 +8,5 @@
 
 %make a curve out of the mesh, to use the intersections routine.
-rows=[md.elements md.elements(:,1)]'; rows=rows(:);
+rows=[md.mesh.elements md.mesh.elements(:,1)]'; rows=rows(:);
 x=md.x(rows);
 y=md.y(rows);
@@ -48,5 +48,5 @@
 
 %now, for each node, figure out which element it belongs to.
-node_in_element=NodeInElement(newx,newy,md.elements,md.x,md.y,md.mesh.vertexconnectivity);
+node_in_element=NodeInElement(newx,newy,md.mesh.elements,md.x,md.y,md.mesh.vertexconnectivity);
 
 % eliminate nodes that don't fall in any element
Index: /issm/trunk/src/m/utils/Mesh/YamsCall.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/YamsCall.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/YamsCall.m	(revision 9733)
@@ -20,5 +20,5 @@
 %Compute Hessian
 t1=clock; fprintf('%s','      computing Hessian...');
-hessian=ComputeHessian(md.elements,md.x,md.y,field,'node');
+hessian=ComputeHessian(md.mesh.elements,md.x,md.y,field,'node');
 t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
 
@@ -51,5 +51,5 @@
 %Triangles
 fprintf(fid,'\n\n%s\n%i\n\n','Triangles',md.mesh.numberofelements);
-fprintf(fid,'%i %i %i %i\n',[md.elements zeros(md.mesh.numberofelements,1)]');
+fprintf(fid,'%i %i %i %i\n',[md.mesh.elements zeros(md.mesh.numberofelements,1)]');
 numberofelements1=md.mesh.numberofelements;
 	
@@ -91,5 +91,5 @@
 md.y=Coor(:,2);
 md.z=zeros(size(Coor,1),1);
-md.elements=Tria;
+md.mesh.elements=Tria;
 md.mesh.numberofvertices=size(Coor,1);
 md.mesh.numberofelements=size(Tria,1);
Index: /issm/trunk/src/m/utils/Mesh/argusmesh.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/argusmesh.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/argusmesh.m	(revision 9733)
@@ -77,10 +77,10 @@
 
 %Finally, use model constructor to build a complete model: 
-md.elements=elements;
+md.mesh.elements=elements;
 md.x=x;
 md.y=y;
 md.z=z;
 md.mesh.numberofvertices=size(md.x,1);
-md.mesh.numberofelements=size(md.elements,1);
+md.mesh.numberofelements=size(md.mesh.elements,1);
 md.mesh.vertexonbed=ones(md.mesh.numberofvertices,1);
 md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
Index: /issm/trunk/src/m/utils/Mesh/squaremesh.m
===================================================================
--- /issm/trunk/src/m/utils/Mesh/squaremesh.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Mesh/squaremesh.m	(revision 9733)
@@ -65,5 +65,5 @@
 
 %plug elements
-md.elements=index;
+md.mesh.elements=index;
 md.mesh.segments=segments;
 md.mesh.numberofelements=nel;
@@ -72,6 +72,6 @@
 
 %Now, build the connectivity tables for this mesh.
-md.mesh.vertexconnectivity=NodeConnectivity(md.elements,md.mesh.numberofvertices);
-md.mesh.elementconnectivity=ElementConnectivity(md.elements,md.mesh.vertexconnectivity);
+md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
 
 %plug other field
Index: /issm/trunk/src/m/utils/Numerics/cfl_step.m
===================================================================
--- /issm/trunk/src/m/utils/Numerics/cfl_step.m	(revision 9732)
+++ /issm/trunk/src/m/utils/Numerics/cfl_step.m	(revision 9733)
@@ -15,5 +15,5 @@
 end
 
-index=md.elements;
+index=md.mesh.elements;
 edgex=max(md.x(index),[],2)-min(md.x(index),[],2);
 edgey=max(md.y(index),[],2)-min(md.y(index),[],2);
Index: /issm/trunk/test/Miscellaneous/Bump/Bump.par
===================================================================
--- /issm/trunk/test/Miscellaneous/Bump/Bump.par	(revision 9732)
+++ /issm/trunk/test/Miscellaneous/Bump/Bump.par	(revision 9733)
@@ -17,5 +17,5 @@
 %Take care of iceshelves: no basal drag
 pos=find(md.mask.elementonfloatingice);
-md.drag_coefficient(md.elements(pos,:))=0;
+md.drag_coefficient(md.mesh.elements(pos,:))=0;
 md.drag_p=ones(md.mesh.numberofelements,1);
 md.drag_q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Miscellaneous/GJM_test1/SquareShelf.par
===================================================================
--- /issm/trunk/test/Miscellaneous/GJM_test1/SquareShelf.par	(revision 9732)
+++ /issm/trunk/test/Miscellaneous/GJM_test1/SquareShelf.par	(revision 9733)
@@ -20,5 +20,5 @@
 md.drag_type=2;
 md.drag_coefficient=20*ones(md.mesh.numberofvertices,1);
-md.drag_coefficient(md.elements(pos,:))=0;
+md.drag_coefficient(md.mesh.elements(pos,:))=0;
 md.drag_p=ones(md.mesh.numberofelements,1);
 md.drag_q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Miscellaneous/connectivity/Square.par
===================================================================
--- /issm/trunk/test/Miscellaneous/connectivity/Square.par	(revision 9732)
+++ /issm/trunk/test/Miscellaneous/connectivity/Square.par	(revision 9733)
@@ -19,5 +19,5 @@
 %Take care of iceshelves: no basal drag
 pos=find(md.mask.elementonfloatingice);
-md.drag_coefficient(md.elements(pos,:))=0;
+md.drag_coefficient(md.mesh.elements(pos,:))=0;
 md.drag_p=ones(md.mesh.numberofelements,1);
 md.drag_q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/NightlyRun/test1102.m
===================================================================
--- /issm/trunk/test/NightlyRun/test1102.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test1102.m	(revision 9733)
@@ -18,5 +18,5 @@
 %	%Find elements at the corner and extract model
 %	posnodes=find((md.x==0 | md.x==max(md.x)) & (md.y==0 | md.y==max(md.y)));
-%	[a,b]=find(ismember(md.elements,posnodes));
+%	[a,b]=find(ismember(md.mesh.elements,posnodes));
 %	elements=ones(md.mesh.numberofelements,1);
 %	elements(a)=0;
Index: /issm/trunk/test/NightlyRun/test1205.m
===================================================================
--- /issm/trunk/test/NightlyRun/test1205.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test1205.m	(revision 9733)
@@ -51,5 +51,5 @@
 set(gcf,'Position',[1 1 1580 1150])
 subplot(2,2,1)
-p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+p=patch('Faces',md.mesh.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
 vel,'FaceColor','interp','EdgeColor','none');
 title('Modelled velocity','FontSize',14,'FontWeight','bold')
@@ -58,5 +58,5 @@
    
 subplot(2,2,2)
-p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+p=patch('Faces',md.mesh.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
 vel_obs,'FaceColor','interp','EdgeColor','none');
 title('Analytical velocity','FontSize',14,'FontWeight','bold')
@@ -76,5 +76,5 @@
 
 subplot(2,2,4)
-p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+p=patch('Faces',md.mesh.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
 abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none');
 title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
Index: /issm/trunk/test/NightlyRun/test1206.m
===================================================================
--- /issm/trunk/test/NightlyRun/test1206.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test1206.m	(revision 9733)
@@ -50,5 +50,5 @@
 figure(1)
 subplot(2,2,1)
-p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+p=patch('Faces',md.mesh.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
 vel,'FaceColor','interp','EdgeColor','none');
 title('Modelled velocity','FontSize',14,'FontWeight','bold')
@@ -57,5 +57,5 @@
    
 subplot(2,2,2)
-p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+p=patch('Faces',md.mesh.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
 vel_obs,'FaceColor','interp','EdgeColor','none');
 title('Analytical velocity','FontSize',14,'FontWeight','bold')
@@ -75,5 +75,5 @@
 
 subplot(2,2,4)
-p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+p=patch('Faces',md.mesh.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
 abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none');
 title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
Index: /issm/trunk/test/NightlyRun/test1207.m
===================================================================
--- /issm/trunk/test/NightlyRun/test1207.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test1207.m	(revision 9733)
@@ -50,5 +50,5 @@
 figure(1)
 subplot(2,2,1)
-p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+p=patch('Faces',md.mesh.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
 vel,'FaceColor','interp','EdgeColor','none');
 title('Modelled velocity','FontSize',14,'FontWeight','bold')
@@ -57,5 +57,5 @@
    
 subplot(2,2,2)
-p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+p=patch('Faces',md.mesh.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
 vel_obs,'FaceColor','interp','EdgeColor','none');
 title('Analytical velocity','FontSize',14,'FontWeight','bold')
@@ -75,5 +75,5 @@
 
 subplot(2,2,4)
-p=patch('Faces',md.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
+p=patch('Faces',md.mesh.elements2d,'Vertices',[md.x2d md.y2d],'FaceVertexCData',...
 abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none');
 title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
Index: /issm/trunk/test/NightlyRun/test1302.m
===================================================================
--- /issm/trunk/test/NightlyRun/test1302.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test1302.m	(revision 9733)
@@ -12,6 +12,6 @@
 
 %Thermal boundary conditions
-pos1=find(md.mesh.elementonbed);     md.thermal.spctemperature(md.elements(pos1,1:3))=10;
-pos2=find(md.mesh.elementonsurface); md.thermal.spctemperature(md.elements(pos2,4:6))=0;
+pos1=find(md.mesh.elementonbed);     md.thermal.spctemperature(md.mesh.elements(pos1,1:3))=10;
+pos2=find(md.mesh.elementonsurface); md.thermal.spctemperature(md.mesh.elements(pos2,4:6))=0;
 md.initialization.vz=0.1*ones(md.mesh.numberofvertices,1);
 md.initialization.vel=sqrt( md.initialization.vx.^2+ md.initialization.vy.^2+ md.initialization.vz.^2);
Index: /issm/trunk/test/NightlyRun/test1303.m
===================================================================
--- /issm/trunk/test/NightlyRun/test1303.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test1303.m	(revision 9733)
@@ -11,6 +11,6 @@
 md=extrude(md,11,2);
 md=setflowequation(md,'Pattyn','all');
-pos1=find(md.mesh.elementonbed);     md.thermal.spctemperature(md.elements(pos1,1:3))=10;
-pos2=find(md.mesh.elementonsurface); md.thermal.spctemperature(md.elements(pos2,4:6))=0;
+pos1=find(md.mesh.elementonbed);     md.thermal.spctemperature(md.mesh.elements(pos1,1:3))=10;
+pos2=find(md.mesh.elementonsurface); md.thermal.spctemperature(md.mesh.elements(pos2,4:6))=0;
 md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
 
Index: /issm/trunk/test/NightlyRun/test1304.m
===================================================================
--- /issm/trunk/test/NightlyRun/test1304.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test1304.m	(revision 9733)
@@ -12,5 +12,5 @@
 md=setflowequation(md,'Pattyn','all');
 
-pos2=find(md.mesh.elementonsurface); md.thermal.spctemperature(md.elements(pos2,4:6))=0;
+pos2=find(md.mesh.elementonsurface); md.thermal.spctemperature(md.mesh.elements(pos2,4:6))=0;
 md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
 md.basalforcings.geothermalflux(:)=0.1; %100mW/m^2
Index: /issm/trunk/test/NightlyRun/test1501.m
===================================================================
--- /issm/trunk/test/NightlyRun/test1501.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test1501.m	(revision 9733)
@@ -96,5 +96,5 @@
 	ts = [starttime:res:endtime];
 
-	index = md.elements;
+	index = md.mesh.elements;
 	x1=md.x(index(:,1)); x2=md.x(index(:,2)); x3=md.x(index(:,3));
 	y1=md.y(index(:,1)); y2=md.y(index(:,2)); y3=md.y(index(:,3));
Index: /issm/trunk/test/NightlyRun/test1502.m
===================================================================
--- /issm/trunk/test/NightlyRun/test1502.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test1502.m	(revision 9733)
@@ -102,5 +102,5 @@
 	ts = [starttime:res:endtime];
 
-	index = md.elements;
+	index = md.mesh.elements;
 	x1=md.x(index(:,1)); x2=md.x(index(:,2)); x3=md.x(index(:,3));
 	y1=md.y(index(:,1)); y2=md.y(index(:,2)); y3=md.y(index(:,3));
Index: /issm/trunk/test/NightlyRun/test446.m
===================================================================
--- /issm/trunk/test/NightlyRun/test446.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test446.m	(revision 9733)
@@ -10,6 +10,6 @@
 %}}}
 %put our grounding line 'shelfextent' meters from the icefront {{{1
-xelem=md.x(md.elements)*[1;1;1]/3;
-yelem=md.y(md.elements)*[1;1;1]/3;
+xelem=md.x(md.mesh.elements)*[1;1;1]/3;
+yelem=md.y(md.mesh.elements)*[1;1;1]/3;
 rad=sqrt((xelem).*xelem+(yelem).*yelem);
 flags=zeros(md.mesh.numberofelements,1);
Index: /issm/trunk/test/NightlyRun/test527.m
===================================================================
--- /issm/trunk/test/NightlyRun/test527.m	(revision 9732)
+++ /issm/trunk/test/NightlyRun/test527.m	(revision 9733)
@@ -14,5 +14,5 @@
 
 %refine existing mesh 1
-hessian=ComputeHessian(md.elements,md.x,md.y,md.inversion.vy_obs,'node');
+hessian=ComputeHessian(md.mesh.elements,md.x,md.y,md.inversion.vy_obs,'node');
 metric=ComputeMetric(hessian,2/9,1,1000,25*10^3,[]);
 md.miscellaneous.dummy=metric;
Index: /issm/trunk/test/Par/79North.par
===================================================================
--- /issm/trunk/test/Par/79North.par	(revision 9732)
+++ /issm/trunk/test/Par/79North.par	(revision 9733)
@@ -18,5 +18,5 @@
 pos=find(md.mask.elementonfloatingice);
 md.friction.coefficient=50*ones(md.mesh.numberofvertices,1);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
@@ -25,5 +25,5 @@
 md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
 pos=zeros(md.mesh.numberofvertices,1);
-pos(md.elements(find(md.mask.elementonfloatingice),:))=1;
+pos(md.mesh.elements(find(md.mask.elementonfloatingice),:))=1;
 md.basalforcings.melting_rate(find(pos))=10;
 md.surfaceforcings.mass_balance=15*ones(md.mesh.numberofvertices,1);
Index: /issm/trunk/test/Par/ISMIPA.par
===================================================================
--- /issm/trunk/test/Par/ISMIPA.par	(revision 9732)
+++ /issm/trunk/test/Par/ISMIPA.par	(revision 9733)
@@ -10,5 +10,5 @@
 %Take care of iceshelves: no basal drag
 pos=find(md.mask.elementonfloatingice);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/ISMIPB.par
===================================================================
--- /issm/trunk/test/Par/ISMIPB.par	(revision 9732)
+++ /issm/trunk/test/Par/ISMIPB.par	(revision 9733)
@@ -10,5 +10,5 @@
 %Take care of iceshelves: no basal drag
 pos=find(md.mask.elementonfloatingice);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/ISMIPC.par
===================================================================
--- /issm/trunk/test/Par/ISMIPC.par	(revision 9732)
+++ /issm/trunk/test/Par/ISMIPC.par	(revision 9733)
@@ -11,5 +11,5 @@
 %Take care of iceshelves: no basal drag
 pos=find(md.mask.elementonfloatingice);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=zeros(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/ISMIPD.par
===================================================================
--- /issm/trunk/test/Par/ISMIPD.par	(revision 9732)
+++ /issm/trunk/test/Par/ISMIPD.par	(revision 9733)
@@ -10,5 +10,5 @@
 %Take care of iceshelves: no basal drag
 pos=find(md.mask.elementonfloatingice);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=zeros(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/Pig.par
===================================================================
--- /issm/trunk/test/Par/Pig.par	(revision 9732)
+++ /issm/trunk/test/Par/Pig.par	(revision 9733)
@@ -23,5 +23,5 @@
 pos=find(md.mask.elementonfloatingice);
 md.friction.coefficient=50*ones(md.mesh.numberofvertices,1);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/RoundSheetShelf.par
===================================================================
--- /issm/trunk/test/Par/RoundSheetShelf.par	(revision 9732)
+++ /issm/trunk/test/Par/RoundSheetShelf.par	(revision 9733)
@@ -52,5 +52,5 @@
 pos=find(md.mask.elementonfloatingice);
 md.friction.coefficient=20*ones(md.mesh.numberofvertices,1);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/RoundSheetStaticEISMINT.par
===================================================================
--- /issm/trunk/test/Par/RoundSheetStaticEISMINT.par	(revision 9732)
+++ /issm/trunk/test/Par/RoundSheetStaticEISMINT.par	(revision 9733)
@@ -12,5 +12,5 @@
 %Take care of iceshelves: no basal drag
 pos=find(md.mask.elementonfloatingice);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/SquareEISMINT.par
===================================================================
--- /issm/trunk/test/Par/SquareEISMINT.par	(revision 9732)
+++ /issm/trunk/test/Par/SquareEISMINT.par	(revision 9733)
@@ -12,5 +12,5 @@
 %Take care of iceshelves: no basal drag
 pos=find(md.mask.elementonfloatingice);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/SquareSheetConstrained.par
===================================================================
--- /issm/trunk/test/Par/SquareSheetConstrained.par	(revision 9732)
+++ /issm/trunk/test/Par/SquareSheetConstrained.par	(revision 9733)
@@ -26,5 +26,5 @@
 pos=find(md.mask.elementonfloatingice);
 md.friction.coefficient=20*ones(md.mesh.numberofvertices,1);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/SquareSheetShelf.par
===================================================================
--- /issm/trunk/test/Par/SquareSheetShelf.par	(revision 9732)
+++ /issm/trunk/test/Par/SquareSheetShelf.par	(revision 9733)
@@ -33,5 +33,5 @@
 pos=find(md.mask.elementonfloatingice);
 md.friction.coefficient=20*ones(md.mesh.numberofvertices,1);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/SquareShelf.par
===================================================================
--- /issm/trunk/test/Par/SquareShelf.par	(revision 9732)
+++ /issm/trunk/test/Par/SquareShelf.par	(revision 9733)
@@ -26,5 +26,5 @@
 pos=find(md.mask.elementonfloatingice);
 md.friction.coefficient=20*ones(md.mesh.numberofvertices,1);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/SquareShelfConstrained.par
===================================================================
--- /issm/trunk/test/Par/SquareShelfConstrained.par	(revision 9732)
+++ /issm/trunk/test/Par/SquareShelfConstrained.par	(revision 9733)
@@ -30,5 +30,5 @@
 pos=find(md.mask.elementonfloatingice);
 md.friction.coefficient=20*ones(md.mesh.numberofvertices,1);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
Index: /issm/trunk/test/Par/SquareThermal.par
===================================================================
--- /issm/trunk/test/Par/SquareThermal.par	(revision 9732)
+++ /issm/trunk/test/Par/SquareThermal.par	(revision 9733)
@@ -18,5 +18,5 @@
 %Take care of iceshelves: no basal drag
 pos=find(md.mask.elementonfloatingice);
-md.friction.coefficient(md.elements(pos,:))=0;
+md.friction.coefficient(md.mesh.elements(pos,:))=0;
 md.friction.p=ones(md.mesh.numberofelements,1);
 md.friction.q=ones(md.mesh.numberofelements,1);
@@ -41,3 +41,3 @@
 md.thermal.spctemperature(:)=md.initialization.temperature;
 md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1); 
-pos=find(md.mask.elementongroundedice);md.basalforcings.geothermalflux(md.elements(pos,:))=1*10^-3; %1 mW/m^2
+pos=find(md.mask.elementongroundedice);md.basalforcings.geothermalflux(md.mesh.elements(pos,:))=1*10^-3; %1 mW/m^2
