Index: issm/trunk/src/c/objects/Numericalflux.cpp
===================================================================
--- issm/trunk/src/c/objects/Numericalflux.cpp	(revision 3371)
+++ issm/trunk/src/c/objects/Numericalflux.cpp	(revision 3378)
@@ -17,4 +17,6 @@
 #include "./objects.h"
 
+extern int my_rank;
+
 /*Object constructors and destructor*/
 /*FUNCTION Numericalflux::Numericalflux(){{{1*/
@@ -24,5 +26,5 @@
 /*}}}*/
 /*FUNCTION Numericalflux::Numericalflux(char numericalflux_type[NUMERICALFLUXSTRING],int numericalflux_fill...){{{1*/
-Numericalflux::Numericalflux(int numericalflux_id,char numericalflux_type[NUMERICALFLUXSTRING], int numericalflux_node_ids[MAX_NUMERICALFLUX_NODES],int numericalflux_element_ids[MAX_NUMERICALFLUX_ELEMS]){
+Numericalflux::Numericalflux(int numericalflux_id,char numericalflux_type[NUMERICALFLUXSTRING], int numericalflux_node_ids[MAX_NUMERICALFLUX_NODES],int numericalflux_element_id){
 
 	int i;
@@ -30,10 +32,8 @@
 	strcpy(type,numericalflux_type);
 	id=numericalflux_id;
-	
-	for(i=0;i<MAX_NUMERICALFLUX_ELEMS;i++){
-		element_ids[i]=numericalflux_element_ids[i];
-		element_offsets[i]=UNDEF;
-		elements[i]=NULL;
-	}
+
+	element_id=numericalflux_element_id;
+	element_offset=UNDEF;
+	element=NULL;
 
 	for(i=0;i<MAX_NUMERICALFLUX_NODES;i++){
@@ -73,7 +73,7 @@
 	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
 
-	memcpy(&element_ids,marshalled_dataset,sizeof(element_ids));marshalled_dataset+=sizeof(element_ids);
-	memcpy(&element_offsets,marshalled_dataset,sizeof(element_offsets));marshalled_dataset+=sizeof(element_offsets);
-	for(i=0;i<MAX_NUMERICALFLUX_ELEMS;i++)elements[i]=NULL;
+	memcpy(&element_id,marshalled_dataset,sizeof(element_id));marshalled_dataset+=sizeof(element_id);
+	memcpy(&element_offset,marshalled_dataset,sizeof(element_offset));marshalled_dataset+=sizeof(element_offset);
+	element=NULL;
 	
 	memcpy(&node_ids,marshalled_dataset,sizeof(node_ids));marshalled_dataset+=sizeof(node_ids);
@@ -105,6 +105,6 @@
 	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
 	
-	memcpy(marshalled_dataset,&element_ids,sizeof(element_ids));marshalled_dataset+=sizeof(element_ids);
-	memcpy(marshalled_dataset,&element_offsets,sizeof(element_offsets));marshalled_dataset+=sizeof(element_offsets);
+	memcpy(marshalled_dataset,&element_id,sizeof(element_id));marshalled_dataset+=sizeof(element_id);
+	memcpy(marshalled_dataset,&element_offset,sizeof(element_offset));marshalled_dataset+=sizeof(element_offset);
 
 	memcpy(marshalled_dataset,&node_ids,sizeof(node_ids));marshalled_dataset+=sizeof(node_ids);
@@ -120,6 +120,6 @@
 	return sizeof(type)+
 		sizeof(id)+
-		sizeof(element_ids)+
-		sizeof(element_offsets)+
+		sizeof(element_id)+
+		sizeof(element_offset)+
 		sizeof(node_ids)+
 		sizeof(node_offsets)+
@@ -142,11 +142,10 @@
 	if (strcmp(type,"internal")==0){
 		ResolvePointers((Object**)nodes,node_ids,node_offsets,4,nodesin);
-		ResolvePointers((Object**)elements,element_ids,element_offsets,2,elementsin);
 	}
 	else if (strcmp(type,"boundary")==0){
 		ResolvePointers((Object**)nodes,node_ids,node_offsets,2,nodesin);
-		ResolvePointers((Object**)elements,element_ids,element_offsets,1,elementsin);
 	}
 	else ISSMERROR("type not supported yet");
+	ResolvePointers((Object**)&element,&element_id,&element_offset,1,elementsin);
 
 }
@@ -176,10 +175,8 @@
 	printf("   id: %i\n",id);
 	
+	printf("   element_id=%i\n",element_id);
+	printf("   element_offset=%i\n",element_offset);
+	if(element)element->Echo();
 	if (strcmp(type,"internal")==0){
-		printf("   element_ids=[%i,%i]\n",element_ids[0],element_ids[1]);
-		printf("   element_offsets=[%i,%i]\n",element_offsets[0],element_offsets[1]);
-		for(i=0;i<2;i++){
-			if(elements[i])elements[i]->Echo();
-		}
 		printf("   node_ids=[%i,%i,%i,%i]\n",node_ids[0],node_ids[1],node_ids[2],node_ids[3]);
 		printf("   node_offsets=[%i,%i,%i,%i]\n",node_offsets[0],node_offsets[1],node_offsets[2],node_offsets[3]);
@@ -189,9 +186,4 @@
 	}
 	else{
-		printf("   element_ids=[%i,%i]\n",element_ids[0],element_ids[1]);
-		printf("   element_offsets=[%i,%i]\n",element_offsets[0],element_offsets[1]);
-		for(i=0;i<1;i++){
-			if(elements[i])elements[i]->Echo();
-		}
 		printf("   node_ids=[%i,%i,%i,%i]\n",node_ids[0],node_ids[1],node_ids[2],node_ids[3]);
 		printf("   node_offsets=[%i,%i,%i,%i]\n",node_offsets[0],node_offsets[1],node_offsets[2],node_offsets[3]);
@@ -215,13 +207,12 @@
 	printf("   id: %i\n",id);
 
+	printf("   element_id=%i\n",element_id);
+	printf("   element_offset=%i]\n",element_offset);
+
 	if (strcmp(type,"internal")==0){
-		printf("   element_ids=[%i,%i]\n",element_ids[0],element_ids[1]);
-		printf("   element_offsets=[%i,%i]\n",element_offsets[0],element_offsets[1]);
 		printf("   node_ids=[%i,%i,%i,%i]\n",node_ids[0],node_ids[1],node_ids[2],node_ids[3]);
 		printf("   node_offsets=[%i,%i,%i,%i]\n",node_offsets[0],node_offsets[1],node_offsets[2],node_offsets[3]);
 	}
 	else{
-		printf("   element_ids=%i\n",element_ids[0]);
-		printf("   element_offsets=%i\n",element_offsets[0]);
 		printf("   node_ids=[%i,%i]\n",node_ids[0],node_ids[1]);
 		printf("   node_offsets=[%i,%i]\n",node_offsets[0],node_offsets[1]);
