Index: /issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateLoadsPrognostic2.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateLoadsPrognostic2.cpp	(revision 3645)
+++ /issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateLoadsPrognostic2.cpp	(revision 3646)
@@ -14,18 +14,9 @@
 
 	/*Intermediary*/
-	int i,j;
-	int i1,i2;
-	int pos1,pos2;
-	double e1,e2;
+	int i;
+	int element;
 
 	/*Output*/
 	DataSet* loads=NULL;
-
-	/*numericalflux intermediary data: */
-	char numericalflux_type[NUMERICALFLUXSTRING];
-	int  numericalflux_id;
-	int  numericalflux_node_ids[MAX_NUMERICALFLUX_NODES];
-	int  numericalflux_elem_id;
-	double numericalflux_h[MAX_NUMERICALFLUX_NODES];
 
 	/*Create loads: */
@@ -41,65 +32,11 @@
 
 		/*Get left and right elements*/
-		e1=iomodel->edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2]
-		e2=iomodel->edges[4*i+3]-1; //edges are [node1 node2 elem1 elem2]
+		element=(int)iomodel->edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2]
 
 		/*Now, if this element is not in the partition, pass: */
-		if(!iomodel->my_elements[(int)e1]) continue;
+		if(!iomodel->my_elements[element]) continue;
 
-		/*Create load*/
-		numericalflux_id=i+1; //Matlab indexing
-		numericalflux_elem_id=(int)e1+1;//id is in matlab index
-
-		/*1: Get vertices ids*/
-		i1=(int)iomodel->edges[4*i+0];
-		i2=(int)iomodel->edges[4*i+1];
-
-		if (!isnan(e2)){
-			strcpy(numericalflux_type,"internal");
-
-			/*Now, we must get the nodes of the 4 nodes located on the edge*/
-
-			/*2: Get the column where these ids are located in the index*/
-			pos1=pos2=UNDEF;
-			for(j=0;j<3;j++){
-				if (iomodel->elements[3*(int)e1+j]==i1) pos1=j+1;
-				if (iomodel->elements[3*(int)e2+j]==i1) pos2=j+1;
-			}
-			ISSMASSERT(pos1!=UNDEF && pos2!=UNDEF);
-
-			/*3: We have the id of the elements and the position of the vertices in the index
-			 * we can compute their dofs!*/
-			numericalflux_node_ids[0]=3*(int)e1+pos1;       //ex: 1 2 3
-			numericalflux_node_ids[1]=3*(int)e1+(pos1%3)+1; //ex: 2 3 1
-			numericalflux_node_ids[2]=3*(int)e2+pos2;           //ex: 1 2 3
-			numericalflux_node_ids[3]=3*(int)e2+((pos2+1)%3)+1; //ex: 3 1 2
-
-			numericalflux_h[0]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[0]-1] -1];
-			numericalflux_h[1]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[1]-1]-1];
-			numericalflux_h[2]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[2]-1]-1];
-			numericalflux_h[3]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[3]-1]-1];
-		}
-		else{
-			strcpy(numericalflux_type,"boundary");
-
-			/*2: Get the column where these ids are located in the index*/
-			pos1==UNDEF;
-			for(j=0;j<3;j++){
-				if (iomodel->elements[3*(int)e1+j]==i1) pos1=j+1;
-			}
-			ISSMASSERT(pos1!=UNDEF);
-
-			/*3: We have the id of the elements and the position of the vertices in the index
-			 * we can compute their dofs!*/
-			numericalflux_node_ids[0]=3*(int)e1+pos1;
-			numericalflux_node_ids[1]=3*(int)e1+(pos1%3)+1;
-
-			numericalflux_h[0]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[0]-1]-1];
-			numericalflux_h[1]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[1]-1]-1];
-			numericalflux_h[2]=UNDEF;
-			numericalflux_h[3]=UNDEF;
-		}
-
-		loads->AddObject(new Numericalflux(numericalflux_id,numericalflux_type,numericalflux_node_ids,numericalflux_elem_id,numericalflux_h));
+		/* Add load */
+		loads->AddObject(new Numericalflux(i+1,i,iomodel));
 	}
 
