Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 15371)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 15372)
@@ -77,8 +77,8 @@
 					./classes/Elements/Elements.h\
 					./classes/Elements/Elements.cpp\
+					./classes/Elements/ElementHook.h\
+					./classes/Elements/ElementHook.cpp\
 					./classes/Elements/Tria.h\
 					./classes/Elements/Tria.cpp\
-					./classes/Elements/TriaHook.h\
-					./classes/Elements/TriaHook.cpp\
 					./classes/Elements/TriaRef.h\
 					./classes/Elements/TriaRef.cpp\
@@ -537,6 +537,4 @@
 				     ./classes/Elements/Penta.h\
 				     ./classes/Elements/Penta.cpp\
-				     ./classes/Elements/PentaHook.h\
-				     ./classes/Elements/PentaHook.cpp\
 				     ./classes/Elements/PentaRef.h\
 				     ./classes/Elements/PentaRef.cpp
Index: /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp	(revision 15372)
+++ /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp	(revision 15372)
@@ -0,0 +1,114 @@
+/*!\file ElementHook.c
+ * \brief: implementation of the ElementHook object
+ */
+
+/*Headers:*/
+/*{{{*/
+#ifdef HAVE_CONFIG_H
+	#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../classes.h"
+#include "../../shared/shared.h"
+/*}}}*/
+
+/*Object constructors and destructor*/
+/*FUNCTION ElementHook::ElementHook(){{{*/
+ElementHook::ElementHook(){
+	numanalyses=UNDEF;
+	this->hnodes     = NULL;
+	this->hvertices  = NULL;
+	this->hmaterial  = NULL;
+	this->hmatpar    = NULL;
+	this->hneighbors = NULL;
+}
+/*}}}*/
+/*FUNCTION ElementHook::~ElementHook(){{{*/
+ElementHook::~ElementHook(){
+
+	int i;
+
+	for(i=0;i<this->numanalyses;i++){
+		if (this->hnodes[i]) delete this->hnodes[i];
+	}
+	delete [] this->hnodes;
+	delete hvertices;
+	delete hmaterial;
+	delete hmatpar;
+	delete hneighbors;
+}
+/*}}}*/
+/*FUNCTION ElementHook::ElementHook(int in_numanalyses,int element_id, int numvertices,IoModel* iomodel){{{*/
+ElementHook::ElementHook(int in_numanalyses,int element_id,int numvertices,IoModel* iomodel){
+
+	/*intermediary: */
+	int matpar_id;
+	int material_id;
+
+	/*retrieve material_id: */
+	iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
+
+	/*retrieve material_id*/
+	material_id = element_id;
+
+	/*retrieve vertices ids*/
+	int* vertex_ids = xNew<int>(numvertices);
+	for(int i=0;i<numvertices;i++){ 
+		vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[(element_id-1)*numvertices+i]);
+	}
+
+	this->numanalyses = in_numanalyses;
+	this->hnodes      = new Hook*[in_numanalyses];
+	this->hvertices   = new Hook(&vertex_ids[0],numvertices);
+	this->hmaterial   = new Hook(&material_id,1);
+	this->hmatpar     = new Hook(&matpar_id,1);
+	this->hneighbors  = NULL;
+
+	/*Initialize hnodes as NULL*/
+	for(int i=0;i<this->numanalyses;i++){
+		this->hnodes[i]=NULL;
+	}
+
+	/*Clean up*/
+	xDelete<int>(vertex_ids);
+
+}
+/*}}}*/
+
+/*FUNCTION ElementHook::SetHookNodes{{{*/
+void ElementHook::SetHookNodes(int* node_ids,int numnodes,int analysis_counter){
+	this->hnodes[analysis_counter]= new Hook(node_ids,numnodes);
+}
+/*}}}*/
+/*FUNCTION ElementHook::InitHookNeighbors{{{*/
+void ElementHook::InitHookNeighbors(int* element_ids){
+	this->hneighbors=new Hook(element_ids,2);
+}
+/*}}}*/
+/*FUNCTION ElementHook::SpawnTriaHook{{{*/
+void ElementHook::SpawnTriaHook(ElementHook* triahook,int* indices){
+
+	int i;
+	int zero=0;
+
+	triahook->numanalyses=this->numanalyses;
+	triahook->hnodes=new Hook*[this->numanalyses];
+
+	for(i=0;i<this->numanalyses;i++){
+		/*Do not do anything if Hook is empty*/
+		if (!this->hnodes[i] || this->hnodes[i]->GetNum()==0){
+			triahook->hnodes[i]=NULL;
+		}
+		else{
+			/*Else, spawn Hook*/
+			triahook->hnodes[i]=this->hnodes[i]->Spawn(indices,3);
+		}
+	}
+	// do not spawn hmaterial. material will be taken care of by Penta
+	triahook->hmaterial=NULL;
+	triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,3);
+	triahook->hmatpar=(Hook*)this->hmatpar->copy();
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/Elements/ElementHook.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/ElementHook.h	(revision 15372)
+++ /issm/trunk-jpl/src/c/classes/Elements/ElementHook.h	(revision 15372)
@@ -0,0 +1,31 @@
+/*!\file: ElementHook.h
+ * \brief prototypes for ElementHook.h
+ */ 
+
+#ifndef _ELEMENTHOOK_H_
+#define _ELEMENTHOOK_H_
+
+class Hook;
+class IoModel;
+
+class ElementHook{
+
+	public: 
+		int    numanalyses;   //number of analysis types
+		Hook **hnodes;        // set of nodes for each analysis type
+		Hook  *hvertices;     // vertices
+		Hook  *hmaterial;     // 1 ice material
+		Hook  *hmatpar;       // 1 material parameter
+		Hook  *hneighbors;    // 2 elements, first down, second up in 3d only
+
+		/*constructors, destructors*/
+		ElementHook();
+		ElementHook(int in_numanalyses,int material_id,int numvertices,IoModel* iomodel);
+		~ElementHook();
+
+		void SetHookNodes(int* node_ids,int numnodes,int analysis_counter);
+		void SpawnTriaHook(ElementHook* triahook,int* indices);    //3d only
+		void InitHookNeighbors(int* element_ids);               //3d only
+};
+
+#endif //ifndef _ELEMENTHOOK_H_
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15371)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 15372)
@@ -44,5 +44,5 @@
 Penta::Penta(int penta_id, int penta_sid, int index, IoModel* iomodel,int nummodels)
 	:PentaRef(nummodels)
-	,PentaHook(nummodels,index+1,iomodel) //index+1: material id, iomodel->numberofelements+1: matpar id
+	,ElementHook(nummodels,index+1,6,iomodel) //index+1: material id, iomodel->numberofelements+1: matpar id
                                                                       { //i is the element index
 
@@ -99,5 +99,5 @@
 	for(i=0;i<this->numanalyses;i++) penta->element_type_list[i]=this->element_type_list[i];
 
-	//deal with PentaHook mother class
+	//deal with ElementHook
 	penta->numanalyses=this->numanalyses;
 	penta->hnodes=new Hook*[penta->numanalyses];
@@ -2824,5 +2824,5 @@
 	tria->parameters=tria_parameters;
 	tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED)
-	this->SpawnTriaHook(dynamic_cast<TriaHook*>(tria),&indices[0]);
+	this->SpawnTriaHook(dynamic_cast<ElementHook*>(tria),&indices[0]);
 
 	/*Spawn material*/
@@ -3044,5 +3044,5 @@
 
 	/*hooks: */
-	this->SetHookNodes(penta_node_ids,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type
+	this->SetHookNodes(penta_node_ids,6,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type
 
 	/*Fill with IoModel*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Penta.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 15371)
+++ /issm/trunk-jpl/src/c/classes/Elements/Penta.h	(revision 15372)
@@ -9,7 +9,7 @@
 /*{{{*/
 #include "./Element.h"
-#include "./PentaHook.h"
+#include "./ElementHook.h"
 #include "./PentaRef.h"
-class  Object;
+class Object;
 class Parameters;
 class Results;
@@ -28,5 +28,5 @@
 /*}}}*/
 
-class Penta: public Element,public PentaHook,public PentaRef{
+class Penta: public Element,public ElementHook,public PentaRef{
 
 	public:
Index: sm/trunk-jpl/src/c/classes/Elements/PentaHook.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/PentaHook.cpp	(revision 15371)
+++ 	(revision )
@@ -1,112 +1,0 @@
-/*!\file PentaHook.c
- * \brief: implementation of the PentaHook object
- */
-
-/*Headers:*/
-/*{{{*/
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "../classes.h"
-#include "../../shared/shared.h"
-/*}}}*/
-
-/*Object constructors and destructor*/
-/*FUNCTION PentaHook::PentaHook(){{{*/
-PentaHook::PentaHook(){
-	numanalyses=UNDEF;
-	this->hnodes     = NULL;
-	this->hvertices  = NULL;
-	this->hmaterial  = NULL;
-	this->hmatpar    = NULL;
-	this->hneighbors = NULL;
-}
-/*}}}*/
-/*FUNCTION PentaHook::~PentaHook(){{{*/
-PentaHook::~PentaHook(){
-
-	int i;
-
-	for(i=0;i<this->numanalyses;i++){
-		if (this->hnodes[i]) delete this->hnodes[i];
-	}
-	delete [] this->hnodes;
-	delete hvertices;
-	delete hmaterial;
-	delete hmatpar;
-	delete hneighbors;
-}
-/*}}}*/
-/*FUNCTION PentaHook::PentaHook(int in_numanalyses,int element_id, int matpar_id){{{*/
-PentaHook::PentaHook(int in_numanalyses,int element_id, IoModel* iomodel){
-
-	/*intermediary: */
-	int matpar_id;
-	int material_id;
-	int penta_vertex_ids[6];
-
-	/*retrieve material_id: */
-	iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
-
-	/*retrive material_id*/
-	material_id = element_id;
-
-	/*retrieve vertices ids*/
-	for(int i=0;i<6;i++){ 
-		penta_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[6*(element_id-1)+i]);
-	}
-
-	this->numanalyses = in_numanalyses;
-	this->hnodes      = new Hook*[in_numanalyses];
-	this->hvertices   = new Hook(&penta_vertex_ids[0],6);
-	this->hmaterial   = new Hook(&material_id,1);
-	this->hmatpar     = new Hook(&matpar_id,1);
-	this->hneighbors  = NULL;
-
-	//Initialize hnodes as NULL
-	for(int i=0;i<this->numanalyses;i++){
-		this->hnodes[i]=NULL;
-	}
-
-}
-/*}}}*/
-
-/*FUNCTION PentaHook::SetHookNodes{{{*/
-void PentaHook::SetHookNodes(int* node_ids,int analysis_counter){
-	this->hnodes[analysis_counter]= new Hook(node_ids,6);
-}
-/*}}}*/
-/*FUNCTION PentaHook::InitHookNeighbors{{{*/
-void PentaHook::InitHookNeighbors(int* element_ids){
-	this->hneighbors=new Hook(element_ids,2);
-
-}
-/*}}}*/
-/*FUNCTION PentaHook::SpawnTriaHook{{{*/
-void PentaHook::SpawnTriaHook(TriaHook* triahook,int* indices){
-
-	int i;
-	int zero=0;
-
-	triahook->numanalyses=this->numanalyses;
-	triahook->hnodes=new Hook*[this->numanalyses];
-
-	for(i=0;i<this->numanalyses;i++){
-		/*Do not do anything if Hook is empty*/
-		if (!this->hnodes[i] || this->hnodes[i]->GetNum()==0){
-			triahook->hnodes[i]=NULL;
-		}
-		else{
-			/*Else, spawn Hook*/
-			triahook->hnodes[i]=this->hnodes[i]->Spawn(indices,3);
-		}
-	}
-	// do not spawn hmaterial. material will be taken care of by Penta
-	triahook->hmaterial=NULL;
-	triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,3);
-	triahook->hmatpar=(Hook*)this->hmatpar->copy();
-}
-/*}}}*/
Index: sm/trunk-jpl/src/c/classes/Elements/PentaHook.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/PentaHook.h	(revision 15371)
+++ 	(revision )
@@ -1,32 +1,0 @@
-/*!\file: PentaHook.h
- * \brief prototypes for PentaHook.h
- */ 
-
-#ifndef _PENTAHOOK_H_
-#define  _PENTAHOOK_H_
-
-class Hook;
-class TriaHook;
-class IoModel;
-
-class PentaHook{
-
-	public: 
-		int    numanalyses;   //number of analysis types
-		Hook **hnodes;        // set of nodes for each analysis type
-		Hook  *hvertices;     // 6 vertices for each analysis type
-		Hook  *hmaterial;     // 1 ice material
-		Hook  *hmatpar;       // 1 material parameter
-		Hook  *hneighbors;    // 2 elements, first down, second up
-
-		/*constructors, destructors*/
-		PentaHook();
-		PentaHook(int in_numanalyses,int material_id, IoModel* iomodel);
-		~PentaHook();
-
-		void SetHookNodes(int* node_ids,int analysis_counter);
-		void SpawnTriaHook(TriaHook* triahook,int* indices);
-		void InitHookNeighbors(int* element_ids);
-};
-
-#endif //ifndef _PENTAHOOK_H_
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 15371)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 15372)
@@ -41,5 +41,5 @@
 Tria::Tria(int tria_id, int tria_sid, int index, IoModel* iomodel,int nummodels)
 	:TriaRef(nummodels)
-	,TriaHook(nummodels,index+1,iomodel){
+	,ElementHook(nummodels,index+1,3,iomodel){
 
 		/*id: */
@@ -85,5 +85,5 @@
 	for(i=0;i<this->numanalyses;i++) tria->element_type_list[i]=this->element_type_list[i];
 
-	//deal with TriaHook mother class
+	//deal with ElementHook mother class
 	tria->numanalyses=this->numanalyses;
 	tria->hnodes=new Hook*[tria->numanalyses];
@@ -2729,12 +2729,12 @@
 
 	/*Intermediaries*/
-	int    i,j;
-	int    tria_node_ids[3];
-	int    tria_vertex_ids[3];
-	int    tria_type;
+	int        i                   ,j;
+	int        tria_node_ids[3];
+	int        tria_vertex_ids[3];
+	int        tria_type;
 	IssmDouble nodeinputs[3];
 	IssmDouble yts;
-	int    progstabilization,balancestabilization;
-	bool   dakota_analysis;
+	int        progstabilization,balancestabilization;
+	bool       dakota_analysis;
 
 	/*Checks if debuging*/
@@ -2780,5 +2780,5 @@
 
 	/*hooks: */
-	this->SetHookNodes(tria_node_ids,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type
+	this->SetHookNodes(tria_node_ids,3,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type
 
 	/*Fill with IoModel*/
Index: /issm/trunk-jpl/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 15371)
+++ /issm/trunk-jpl/src/c/classes/Elements/Tria.h	(revision 15372)
@@ -9,5 +9,5 @@
 /*{{{*/
 #include "./Element.h"
-#include "./TriaHook.h"
+#include "./ElementHook.h"
 #include "./TriaRef.h"
 class Parameters;
@@ -26,5 +26,5 @@
 /*}}}*/
 
-class Tria: public Element,public TriaHook,public TriaRef{
+class Tria: public Element,public ElementHook,public TriaRef{
 
 	public:
Index: sm/trunk-jpl/src/c/classes/Elements/TriaHook.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/TriaHook.cpp	(revision 15371)
+++ 	(revision )
@@ -1,80 +1,0 @@
-/*!\file TriaHook.c
- * \brief: implementation of the TriaHook object
- */
-
-/*Headers:*/
-/*{{{*/
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "../classes.h"
-#include "../../shared/shared.h"
-/*}}}*/
-
-/*Object constructors and destructor*/
-/*FUNCTION TriaHook::TriaHook(){{{*/
-TriaHook::TriaHook(){
-	numanalyses=UNDEF;
-	this->hnodes    = NULL;
-	this->hvertices = NULL;
-	this->hmaterial = NULL;
-	this->hmatpar   = NULL;
-}
-/*}}}*/
-/*FUNCTION TriaHook::~TriaHook(){{{*/
-TriaHook::~TriaHook(){
-	int i;
-
-	for(i=0;i<this->numanalyses;i++){
-		if (this->hnodes[i]) delete this->hnodes[i];
-	}
-	delete [] hnodes;
-	delete hvertices;
-	delete hmaterial;
-	delete hmatpar;
-
-}
-/*}}}*/
-/*FUNCTION TriaHook::TriaHook(int in_numanalyses,int element_id, int matpar_id){{{*/
-TriaHook::TriaHook(int in_numanalyses,int element_id, IoModel* iomodel){
-
-	/*intermediary: */
-	int matpar_id;
-	int material_id;
-	int tria_vertex_ids[3];
-
-	/*retrieve material_id: */
-	iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
-
-	/*retrive material_id*/
-	material_id = element_id;
-
-	/*retrieve vertices ids*/
-	for(int i=0;i<3;i++){ 
-		tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*(element_id-1)+i]);
-	}
-
-	this->numanalyses = in_numanalyses;
-	this->hnodes      = new Hook*[in_numanalyses];
-	this->hvertices   = new Hook(&tria_vertex_ids[0],3);
-	this->hmaterial   = new Hook(&material_id,1);
-	this->hmatpar     = new Hook(&matpar_id,1);
-
-	//Initialize hnodes as NULL
-	for(int i=0;i<this->numanalyses;i++){
-		this->hnodes[i]=NULL;
-	}
-
-}
-/*}}}*/
-
-/*FUNCTION TriaHook::SetHookNodes{{{*/
-void TriaHook::SetHookNodes(int* node_ids,int analysis_counter){
-
-	/*initialize hook*/
-	this->hnodes[analysis_counter]=new Hook(node_ids,3);
-}
-/*}}}*/
Index: sm/trunk-jpl/src/c/classes/Elements/TriaHook.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Elements/TriaHook.h	(revision 15371)
+++ 	(revision )
@@ -1,29 +1,0 @@
-/*!\file: TriaHook.h
- * \brief prototypes for TriaHook.h
- */ 
-
-#ifndef _TRIAHOOK_H_
-#define  _TRIAHOOK_H_
-
-class Hook;
-class IoModel;
-
-class TriaHook{
-
-	public: 
-		int    numanalyses;   //number of analysis types
-		Hook **hnodes;        // nodes for each analysis type
-		Hook  *hvertices;     // 3 vertices
-		Hook  *hmaterial;     // 1 ice material
-		Hook  *hmatpar;       // 1 material parameter
-
-		/*FUNCTION constructors, destructors {{{*/
-		TriaHook();
-		TriaHook(int in_numanalyses,int material_id, IoModel* iomodel);
-		~TriaHook();
-		void SetHookNodes(int* node_ids,int analysis_counter);
-		/*}}}*/
-
-};
-
-#endif //ifndef _TRIAHOOK_H_
Index: /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 15371)
+++ /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 15372)
@@ -33,9 +33,7 @@
 /*}}}*/
 /*FUNCTION Numericalflux::Numericalflux(int id, int i, IoModel* iomodel, int analysis_type) {{{*/
-Numericalflux::Numericalflux(int numericalflux_id,int i, IoModel* iomodel, int in_analysis_type){
+Numericalflux::Numericalflux(int numericalflux_id,int i,int i1,int i2,int e1,int e2,IoModel* iomodel, int in_analysis_type){
 
 	/* Intermediary */
-	int  e1,e2;
-	int  i1,i2;
 	int  j;
 	int  pos1,pos2,pos3,pos4;
@@ -59,10 +57,7 @@
 
 	/*First, see wether this is an internal or boundary edge (if e2=-1)*/
-	if (iomodel->Data(MeshEdgesEnum)[4*i+3]==-1.){ //edges are [node1 node2 elem1 elem2]
+	if(e2==-1){
 		/* Boundary edge, only one element */
-		e1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+2]);
-		e2=reCast<int>(UNDEF);
-		num_elems=1;
-		num_nodes=2;
+		num_elems=1; num_nodes=2;
 		numericalflux_type=BoundaryEnum;
 		numericalflux_elem_ids[0]=e1;
@@ -70,8 +65,5 @@
 	else{
 		/* internal edge: connected to 2 elements */
-		e1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+2]);
-		e2=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+3]);
-		num_elems=2;
-		num_nodes=4;
+		num_elems=2; num_nodes=4;
 		numericalflux_type=InternalEnum;
 		numericalflux_elem_ids[0]=e1;
@@ -80,6 +72,4 @@
 
 	/*1: Get vertices ids*/
-	i1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+0]);
-	i2=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+1]);
 	numericalflux_vertex_ids[0]=i1;
 	numericalflux_vertex_ids[1]=i2;
@@ -93,8 +83,8 @@
 		pos1=pos2=pos3=pos4=UNDEF;
 		for(j=0;j<3;j++){
-			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
-			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
-			if (iomodel->Data(MeshElementsEnum)[3*(e2-1)+j]==i1) pos3=j+1;
-			if (iomodel->Data(MeshElementsEnum)[3*(e2-1)+j]==i2) pos4=j+1;
+			if(iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
+			if(iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
+			if(iomodel->Data(MeshElementsEnum)[3*(e2-1)+j]==i1) pos3=j+1;
+			if(iomodel->Data(MeshElementsEnum)[3*(e2-1)+j]==i2) pos4=j+1;
 		}
 		_assert_(pos1!=UNDEF && pos2!=UNDEF && pos3!=UNDEF && pos4!=UNDEF);
@@ -112,6 +102,6 @@
 		pos1=pos2=UNDEF;
 		for(j=0;j<3;j++){
-			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
-			if (iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
+			if(iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
+			if(iomodel->Data(MeshElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
 		}
 		_assert_(pos1!=UNDEF && pos2!=UNDEF);
Index: /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.h	(revision 15371)
+++ /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.h	(revision 15372)
@@ -37,5 +37,5 @@
 		/*Numericalflux constructors,destructors {{{*/
 		Numericalflux();
-		Numericalflux(int numericalflux_id,int i, IoModel* iomodel,int analysis_type);
+		Numericalflux(int numericalflux_id,int i,int i1,int i2,int e1,int e2,IoModel* iomodel,int analysis_type);
 		~Numericalflux();
 		/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/classes.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/classes.h	(revision 15371)
+++ /issm/trunk-jpl/src/c/classes/classes.h	(revision 15372)
@@ -39,9 +39,8 @@
 #include "./Elements/Element.h"
 #include "./Elements/Penta.h"
-#include "./Elements/PentaHook.h"
 #include "./Elements/PentaRef.h"
 #include "./Elements/Tria.h"
-#include "./Elements/TriaHook.h"
 #include "./Elements/TriaRef.h"
+#include "./Elements/ElementHook.h"
 
 /*Option parsing objects: */
