Index: /issm/trunk/src/c/objects/DofIndexing.cpp
===================================================================
--- /issm/trunk/src/c/objects/DofIndexing.cpp	(revision 5253)
+++ /issm/trunk/src/c/objects/DofIndexing.cpp	(revision 5254)
@@ -27,9 +27,10 @@
 	this->s_set=NULL;
 	this->doflist=NULL;
+	this->doftype=NULL;
 }
 /*}}}*/
 /*FUNCTION DofIndexing::DofIndexing(int numberofdofs){{{1*/
 DofIndexing::DofIndexing(int in_numberofdofs){
-	this->Init(in_numberofdofs);
+	this->Init(in_numberofdofs,NULL);
 }
 /*}}}*/
@@ -44,4 +45,6 @@
 	this->s_set=(int*)xmalloc(this->numberofdofs*sizeof(int));
 	this->doflist=(int*)xmalloc(this->numberofdofs*sizeof(int));
+	if (in->doftype) this->doftype=(int*)xmalloc(this->numberofdofs*sizeof(int));
+	else this->doftype=NULL;
 
 	for(i=0;i<this->numberofdofs;i++){
@@ -49,4 +52,5 @@
 		this->s_set[i]=in->s_set[i];
 		this->doflist[i]=in->doflist[i];
+		if (in->doftype) this->doftype[i]=in->doftype[i];
 	}
 }
@@ -58,9 +62,10 @@
 	xfree((void**)&s_set); 
 	xfree((void**)&doflist); 
+	xfree((void**)&doftype); 
 
 }
 /*}}}*/
 /*FUNCTION DofIndexing::Init{{{1*/
-void DofIndexing::Init(int in_numberofdofs){
+void DofIndexing::Init(int in_numberofdofs,int* in_doftype){
 
 	int i;
@@ -72,5 +77,5 @@
 	this->s_set=(int*)xmalloc(this->numberofdofs*sizeof(int));
 	this->doflist=(int*)xmalloc(this->numberofdofs*sizeof(int));
-
+	if (in_doftype) this->doftype=(int*)xmalloc(this->numberofdofs*sizeof(int));
 
 	for (i=0;i<this->numberofdofs;i++){
@@ -79,4 +84,5 @@
 		this->s_set[i]=0;
 		this->doflist[i]=UNDEF;
+		if(in_doftype) this->doftype[i]=in_doftype[i];
 	}
 }
@@ -115,4 +121,13 @@
 	printf("\n");
 
+	if(doftype){
+		printf("   doftype: |");
+		for(i=0;i<numberofdofs;i++){
+			printf(" %i |",doftype[i]);
+		}
+		printf("\n");
+	}
+	else printf("   NULL doftype");
+
 }		
 /*}}}*/
@@ -122,4 +137,5 @@
 	char* marshalled_dataset=NULL;
 	int   enum_type;
+	int   flagdoftype;
 
 	/*recover marshalled_dataset: */
@@ -141,4 +157,11 @@
 	memcpy(doflist,marshalled_dataset,numberofdofs*sizeof(int));marshalled_dataset+=numberofdofs*sizeof(int);
 	
+	memcpy(&flagdoftype,marshalled_dataset,sizeof(flagdoftype));marshalled_dataset+=sizeof(flagdoftype);
+	if(flagdoftype){ // there is a hook so demarshall it
+		this->doftype=(int*)xmalloc(this->numberofdofs*sizeof(int));
+		memcpy(doftype,marshalled_dataset,numberofdofs*sizeof(int));marshalled_dataset+=numberofdofs*sizeof(int);
+	}
+	else this->doftype=NULL; //There is no coupling, so doftype is NULL
+
 	/*return: */
 	*pmarshalled_dataset=marshalled_dataset;
@@ -151,4 +174,5 @@
 	char* marshalled_dataset=NULL;
 	int   enum_type=0;
+	int   flagdoftype; //to indicate if there are some doftype or if NULL
 
 	/*recover marshalled_dataset: */
@@ -168,4 +192,15 @@
 	memcpy(marshalled_dataset,doflist,numberofdofs*sizeof(int));marshalled_dataset+=numberofdofs*sizeof(int);
 
+	/*marshall doftype if there are some and add a flag*/
+	if(this->doftype){
+		flagdoftype=1;
+		memcpy(marshalled_dataset,&flagdoftype,sizeof(flagdoftype));marshalled_dataset+=sizeof(flagdoftype);
+		memcpy(marshalled_dataset,doftype,numberofdofs*sizeof(int));marshalled_dataset+=numberofdofs*sizeof(int);
+	}
+	else{
+		flagdoftype=0;
+		memcpy(marshalled_dataset,&flagdoftype,sizeof(flagdoftype));marshalled_dataset+=sizeof(flagdoftype);
+	}
+
 	*pmarshalled_dataset=marshalled_dataset;
 	return;
@@ -174,4 +209,12 @@
 /*FUNCTION DofIndexing::MarshallSize{{{1*/
 int   DofIndexing::MarshallSize(){
+
+	int doftype_size=0;
+	
+	/*FInd size of doftype*/
+	doftype_size+=sizeof(int); //Flag 0 or 1
+	if (this->doftype){
+		doftype_size+=numberofdofs*sizeof(int);
+	}
 
 	return sizeof(numberofdofs)+
@@ -180,4 +223,5 @@
 		numberofdofs*sizeof(int)+
 		numberofdofs*sizeof(int)+
+		doftype_size+
 		sizeof(int); //sizeof(int) for enum type
 }
Index: /issm/trunk/src/c/objects/DofIndexing.h
===================================================================
--- /issm/trunk/src/c/objects/DofIndexing.h	(revision 5253)
+++ /issm/trunk/src/c/objects/DofIndexing.h	(revision 5254)
@@ -21,9 +21,10 @@
 		/*list of degrees of freedom: */
 		int*     doflist; //dof list on which we solve
+		int*     doftype; //approximation type of the dofs (used only for coupling)
 
 		/*DofIndexing constructors, destructors {{{1*/
 		DofIndexing();
 		DofIndexing(int numberofdofs);
-		void Init(int numberofdofs);
+		void Init(int numberofdofs,int* doftype);
 		DofIndexing(DofIndexing* properties);
 		~DofIndexing();
Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 5253)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 5254)
@@ -23,7 +23,7 @@
 /*FUNCTION Node::Node() default constructor {{{1*/
 Node::Node(){
-	this->inputs=NULL;
-	this->hvertex=NULL;
-	return;
+		 this->inputs=NULL;
+		 this->hvertex=NULL;
+		 return;
 }
 /*}}}*/
@@ -71,6 +71,6 @@
 
 	/*indexing:*/
-	DistributeNumDofs(&numdofs,analysis_type,iomodel->vertices_type+2*io_index); //number of dofs per node
-	this->indexing.Init(numdofs);
+	DistributeNumDofs(&this->indexing,analysis_type,iomodel->vertices_type+2*io_index); //number of dofs per node
+	numdofs=this->indexing.numberofdofs;
 
 	/*Hooks*/
