Index: /issm/trunk-jpl/src/c/classes/Nodes.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Nodes.cpp	(revision 23573)
+++ /issm/trunk-jpl/src/c/classes/Nodes.cpp	(revision 23574)
@@ -46,4 +46,79 @@
 
 /*Numerics*/
+Nodes* Nodes::Copy() {/*{{{*/
+
+	int num_proc = IssmComm::GetSize();
+
+	/*Copy dataset*/
+	Nodes* output=new Nodes();
+	output->sorted=this->sorted;
+	output->numsorted=this->numsorted;
+	output->presorted=this->presorted;
+	for(vector<Object*>::iterator obj=this->objects.begin() ; obj < this->objects.end(); obj++ ){
+		output->AddObject((*obj)->copy());
+	}
+
+	/*Build id_offsets and sorted_ids*/
+	int objsize = this->numsorted;
+	if(this->sorted && objsize>0 && this->id_offsets){	
+		/*Allocate new ids*/
+		output->id_offsets=xNew<int>(objsize);
+		xMemCpy<int>(output->id_offsets,this->id_offsets,objsize);
+	}
+	else output->id_offsets=NULL;
+	if(this->sorted && objsize>0 && this->sorted_ids){
+		/*Allocate new ids*/
+		output->sorted_ids=xNew<int>(objsize);
+		xMemCpy<int>(output->sorted_ids,this->sorted_ids,objsize);
+	}
+	else output->sorted_ids=NULL;
+
+
+	if(this->common_recv){
+		output->common_recv=xNew<int>(num_proc);
+		for(int i=0;i<num_proc;i++) output->common_recv[i]=this->common_recv[i];
+	}
+	if(this->common_send){
+		output->common_send=xNew<int>(num_proc);
+		for(int i=0;i<num_proc;i++) output->common_send[i]=this->common_send[i];
+	}
+	if(this->common_recv_ids){
+		output->common_recv_ids = xNew<int*>(num_proc);
+		for(int i=0;i<num_proc;i++){
+			output->common_recv_ids[i]=xNew<int>(this->common_recv[i]);
+			for(int j=0;j<this->common_recv[i];j++) output->common_recv_ids[i][j]=this->common_recv_ids[i][j];
+		}
+	}
+	if(this->common_send_ids){
+		output->common_send_ids = xNew<int*>(num_proc);
+		for(int i=0;i<num_proc;i++){
+			output->common_send_ids[i]=xNew<int>(this->common_send[i]);
+			for(int j=0;j<this->common_send[i];j++) output->common_send_ids[i][j]=this->common_send_ids[i][j];
+		}
+	}
+
+	return output;
+}
+/*}}}*/
+void Nodes::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
+
+	int num_procs=IssmComm::GetSize();
+	int test = num_procs;
+	MARSHALLING_ENUM(NodesEnum);
+	MARSHALLING(test);
+	if(test!=num_procs) _error_("number of cores is not the same as before");
+	MARSHALLING_DYNAMIC(this->common_recv,int,num_procs);
+	MARSHALLING_DYNAMIC(this->common_send,int,num_procs);
+	if(marshall_direction == MARSHALLING_BACKWARD){
+		this->common_recv_ids = xNew<int*>(num_procs);
+		this->common_send_ids = xNew<int*>(num_procs);
+	}
+	for(int i=0;i<num_procs;i++){
+		MARSHALLING_DYNAMIC(this->common_recv_ids[i],int,this->common_recv[i]);
+		MARSHALLING_DYNAMIC(this->common_send_ids[i],int,this->common_send[i]);
+	}
+	DataSet::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+}
+/*}}}*/
 void  Nodes::DistributeDofs(int analysis_type,int setenum){/*{{{*/
 
Index: /issm/trunk-jpl/src/c/classes/Nodes.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Nodes.h	(revision 23573)
+++ /issm/trunk-jpl/src/c/classes/Nodes.h	(revision 23574)
@@ -28,4 +28,8 @@
 		~Nodes();
 
+		/*Objects virtual functions*/
+		Nodes* Copy();
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
+
 		/*numerics*/
 		void  DistributeDofs(int analysis_type,int SETENUM);
