Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 3431)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 3432)
@@ -52,5 +52,5 @@
 }
 /*}}}*/
-/*FUNCTION Node constructor  from iomodel{{{2*/
+/*FUNCTION Node constructor from iomodel continuous Galerkin{{{2*/
 Node::Node(int i, IoModel* iomodel){ //i is the node index
 
@@ -98,4 +98,5 @@
 
 	/*set single point constraints.: */
+	/*FROM DIAGNOSTICHORIZ*/
 	if (strcmp(iomodel->meshtype,"3d")==0){
 		/*We have a  3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */
@@ -111,4 +112,5 @@
 		}
 	}
+	/*FROM DIAGNOSTICSTOKES*/
 	/*On a 3d mesh, in stokes formualtions, only stokes grids are free, the others are frozen: */
 	if (iomodel->borderstokes[i]){
@@ -123,4 +125,57 @@
 		}
 	}
+	/*FROM DIAGNOSTICHUTTER*/
+	if (!iomodel->gridonhutter[i]){
+		for(k=1;k<=numdofs;k++){
+			node->FreezeDof(k);
+		}
+	}
+}
+/*}}}*/
+/*FUNCTION Node constructor from iomodel discontinuous Galerkin{{{2*/
+Node::Node(int i,int j,IoModel* iomodel){
+	/* i -> index of the vertex in C indexing
+	 * j -> index of the node in C indexing*/
+
+	int numdofs;
+	int partitionborder;
+	int vertex_id;
+	int upper_node_id;
+
+	/*id: */
+	this->id=j+1; //matlab indexing
+
+	/*indexing:*/
+	DistributeNumDofs(&numdofs,iomodel->analysis_type,iomodel->sub_analysis_type); //number of dofs per node
+	if(iomodel->my_bordervertices[i])partitionborder=1; else partitionborder=0;//is this node on a partition border?
+
+	this->indexing.Init(numdofs,partitionborder);
+
+	/*properties (come from vertex number i): */
+	this->properties.Init(
+				(int)iomodel->gridonbed[i],
+				(int)iomodel->gridonsurface[i],
+				(int)iomodel->gridoniceshelf[i],
+				(int)iomodel->gridonicesheet[i]);
+
+	/*hooks: */
+	vertex_id=i+1; //matlab indexing
+
+	if (strcmp(iomodel->meshtype,"3d")==0){
+		if (isnan(iomodel->uppernodes[i])){
+			upper_node_id=this->id; //nodes on surface do not have upper nodes, only themselves.
+		}
+		else{
+			upper_node_id=(int)iomodel->uppernodes[i];
+		}
+	}
+	else{
+		/*If we are running 2d, upper_node does not mean much. Just point towards itself!:*/
+		upper_node_id=this->id;
+	}
+
+	this->hvertex.Init(&vertex_id,1);
+	this->hupper_node.Init(&upper_node_id,1);
+
 }
 /*}}}*/
