Index: /issm/trunk/src/c/Bamgx/objects/MeshVertex.h
===================================================================
--- /issm/trunk/src/c/Bamgx/objects/MeshVertex.h	(revision 3419)
+++ /issm/trunk/src/c/Bamgx/objects/MeshVertex.h	(revision 3420)
@@ -1,4 +1,4 @@
-#ifndef _VERTEX_H_
-#define _VERTEX_H_
+#ifndef _MESHVERTEX_H_
+#define _MESHVERTEX_H_
 
 #include "../../objects/objects.h"
Index: /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp
===================================================================
--- /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 3419)
+++ /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 3420)
@@ -10,5 +10,5 @@
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-int	ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes,DataSet* materials,DataSet* parameters){
+int	ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes,vertices, DataSet* materials,DataSet* parameters){
 
 	int noerr=1;
@@ -19,11 +19,13 @@
 	
 	//_printf_("      Configuring elements...\n");
-	elements->Configure(elements,loads,nodes,materials,parameters);
+	elements->Configure(elements,loads,nodes,vertices,materials,parameters);
 	//_printf_("      Configuring loads...\n");
-	loads->Configure(elements,loads,nodes,materials,parameters);
+	loads->Configure(elements,loads,nodes,vertices,materials,parameters);
 	//_printf_("      Configuring nodes...\n");
-	nodes->Configure(elements,loads,nodes,materials,parameters);
+	nodes->Configure(elements,loads,nodes,vertices,materials,parameters);
+	//_printf_("      Configuring vertices...\n");
+	vertices->Configure(elements,loads,vertices,materials,parameters);
 	//_printf_("      Configuring parameters...\n");
-	parameters->Configure(elements,loads, nodes, materials,parameters);
+	parameters->Configure(elements,loads, nodes,vertices, materials,parameters);
 
 	return noerr;
Index: /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h
===================================================================
--- /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h	(revision 3419)
+++ /issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h	(revision 3420)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-int		ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* materials, DataSet* parameters);
+int		ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials, DataSet* parameters);
 
 #endif  /* _CONFIGUREOBJECTSX_H */
Index: /issm/trunk/src/c/DataSet/DataSet.cpp
===================================================================
--- /issm/trunk/src/c/DataSet/DataSet.cpp	(revision 3419)
+++ /issm/trunk/src/c/DataSet/DataSet.cpp	(revision 3420)
@@ -806,5 +806,5 @@
 /*}}}*/
 /*FUNCTION DataSet::Configure{{{1*/
-void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials,DataSet* parameters){
+void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials,DataSet* parameters){
 
 	vector<Object*>::iterator object;
@@ -828,7 +828,6 @@
 		if((*object)->Enum()==NodeEnum()){
 			node=(Node*)(*object);
-			node->Configure(nodes);
-		}
-
+			node->Configure(nodes,vertices);
+		}
 		if((*object)->Enum()==NumparEnum()){
 			numpar=(Numpar*)(*object);
Index: /issm/trunk/src/c/DataSet/DataSet.h
===================================================================
--- /issm/trunk/src/c/DataSet/DataSet.h	(revision 3419)
+++ /issm/trunk/src/c/DataSet/DataSet.h	(revision 3420)
@@ -12,5 +12,5 @@
 #include <vector>
 #include "../toolkits/toolkits.h"
-#include "../objects/objects.h"
+#include "../objects/Object.h"
 
 class DataSet{
@@ -31,7 +31,11 @@
 
 	public:
+
+		/*constructors, destructors: {{{1*/
 		DataSet();
 		DataSet(int enum_type);
 		~DataSet();
+		/*}}}*/
+		/*management: {{{1*/
 
 		int   GetEnum();
@@ -64,5 +68,5 @@
 		void  FlagNodeSets(Vec pv_g, Vec pv_m, Vec pv_n, Vec pv_f, Vec pv_s);
 		void  clear();
-		void  Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials,DataSet* parameters);
+		void  Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials,DataSet* parameters);
 		Object* GetObjectByOffset(int offset);
 		Object* GetObjectById(int* poffset,int eid);
@@ -92,4 +96,5 @@
 		void  UpdateNodePositions(double* thickness,double* bed);
 		void  OutputRifts(Vec riftproperties);
+		/*}}}*/
 
 };
Index: /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp	(revision 3419)
+++ /issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp	(revision 3420)
@@ -114,5 +114,5 @@
 		
 		for (i=0;i<iomodel->numberofelements;i++){
-			if(my_elements[i]){
+			if(iomodel->my_elements[i]){
 				if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum() | *(iomodel->elements_type+2*i+0)==PattynFormulationEnum()){ //elements of type 1 are Hutter type Tria. Don't create this elements.
 					/*Create and add penta element to elements dataset: */
@@ -168,5 +168,5 @@
 
 	
-	for (i=0;i<iomodel->numberovertices;i++){
+	for (i=0;i<iomodel->numberofvertices;i++){
 
 		/*vertices and nodes (same number, as we are running continuous galerkin formulation: */
@@ -202,4 +202,6 @@
 	vertices->Presort();
 	materials->Presort();
+
+	cleanup_and_return:
 	
 	/*Assign output pointer: */
Index: /issm/trunk/src/c/ModelProcessorx/Partitioning.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Partitioning.cpp	(revision 3419)
+++ /issm/trunk/src/c/ModelProcessorx/Partitioning.cpp	(revision 3420)
@@ -11,4 +11,8 @@
 #include <string.h>
 #include "./IoModel.h"
+#include "../shared/shared.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../include/macros.h"
+#include "../include/typedefs.h"
 
 void  DiscontinuousGalerkinPartitioning(bool** pmy_elements, bool** pmy_vertices, bool** pmy_nodes, bool** pmy_bordervertices, IoModel* iomodel, ConstDataHandle iomodel_handle);
@@ -27,4 +31,6 @@
 	/*as many nodes as there are vertices */
 
+	int i;
+
 	extern int my_rank;
 	extern int num_procs;
@@ -42,4 +48,5 @@
 	Vec  bordervertices=NULL;
 	double* serial_bordervertices=NULL;
+	int  el1,el2;
 
 	/*Number of vertices per elements, needed to correctly retrieve data: */
@@ -66,5 +73,5 @@
 	#else
 	/*In serial mode, epart is full of 0: all elements belong to cpu 0: */
-	epart=(int*)xcalloc(md.numberofelements,sizeof(int));
+	epart=(int*)xcalloc(iomodel->numberofelements,sizeof(int));
 	#endif
 
@@ -83,5 +90,5 @@
 	/*Used later on: */
 	my_vertices=(bool*)xcalloc(iomodel->numberofvertices,sizeof(bool));
-	my_elements=(boll*)xcalloc(iomodel->numberofelements,sizeof(bool));
+	my_elements=(bool*)xcalloc(iomodel->numberofelements,sizeof(bool));
 
 	/*Start figuring out, out of the partition, which elements belong to this cpu: */
@@ -136,6 +143,6 @@
 
 	/*Deal with my_nodes: */
-	my_nodes=(bool*)xmalloc(iomodel->numberofnodes*sizeof(bool));
-	memcpy(my_nodes,my_vertices,iomodel->numberofnodes*sizeof(bool));
+	my_nodes=(bool*)xmalloc(iomodel->numberofvertices*sizeof(bool));
+	memcpy(my_nodes,my_vertices,iomodel->numberofvertices*sizeof(bool));
 
 	/*Free ressources:*/
@@ -157,4 +164,6 @@
 	 * the nodes and the vertices. The vertices are similar to continuous galerkin, but the nodes partitioning involves edges, which mess up sorting of 
 	 * ids. */
+	
+	int i,j;
 
 	/*output: */
@@ -165,5 +174,8 @@
 	bool*   my_bordervertices=NULL;
 
-	/*Mathieu's code: */
+	int     i1,i2;
+	double  e1,e2;
+	int     pos;
+
 	/*First: get element and vertices partitioning from Continuous Galerkin: only the nodes are partitioned differently*/
 	ContinuousGalerkinPartitioning(&my_elements,&my_vertices,&my_nodescontinuous,&my_bordervertices,iomodel,iomodel_handle);
@@ -180,5 +192,5 @@
 
 	/*Allocate*/
-	my_nodes=(int*)xcalloc(3*iomodel->numberofelements,sizeof(int));
+	my_nodes=(bool*)xcalloc(3*iomodel->numberofelements,sizeof(int));
 
 	/*First: add all the nodes of all the elements belonging to this cpu*/
Index: /issm/trunk/src/c/objects/BamgGeom.h
===================================================================
--- /issm/trunk/src/c/objects/BamgGeom.h	(revision 3419)
+++ /issm/trunk/src/c/objects/BamgGeom.h	(revision 3420)
@@ -2,6 +2,6 @@
  */ 
 
-#ifndef BAMGGEOM_H_
-#define BAMGGEOM_H_
+#ifndef _BAMGGEOM_H_
+#define _BAMGGEOM_H_
 
 struct BamgGeom{
Index: /issm/trunk/src/c/objects/BamgMesh.h
===================================================================
--- /issm/trunk/src/c/objects/BamgMesh.h	(revision 3419)
+++ /issm/trunk/src/c/objects/BamgMesh.h	(revision 3420)
@@ -2,6 +2,6 @@
  */ 
 
-#ifndef BAMGMESH_H_
-#define BAMGMESH_H_
+#ifndef _BAMGMESH_H_
+#define _BAMGMESH_H_
 
 struct BamgMesh{
Index: /issm/trunk/src/c/objects/BamgOpts.h
===================================================================
--- /issm/trunk/src/c/objects/BamgOpts.h	(revision 3419)
+++ /issm/trunk/src/c/objects/BamgOpts.h	(revision 3420)
@@ -3,6 +3,6 @@
  */ 
 
-#ifndef BAMGOPTS_H_
-#define BAMGOPTS_H_
+#ifndef _BAMGOPTS_H_
+#define _BAMGOPTS_H_
 
 struct BamgOpts{
Index: /issm/trunk/src/c/objects/Beam.h
===================================================================
--- /issm/trunk/src/c/objects/Beam.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Beam.h	(revision 3420)
@@ -17,4 +17,7 @@
 class Object;
 class DataSet;
+class Element;
+class Hook;
+class ElementProperties;
 
 class Beam: public Element{
Index: /issm/trunk/src/c/objects/Contour.h
===================================================================
--- /issm/trunk/src/c/objects/Contour.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Contour.h	(revision 3420)
@@ -4,6 +4,6 @@
  */
 
-#ifndef CONTOUR_H_
-#define CONTOUR_H_
+#ifndef _CONTOUR_H_
+#define _CONTOUR_H_
 
 /*!Contour declaration: */
Index: /issm/trunk/src/c/objects/DakotaPlugin.h
===================================================================
--- /issm/trunk/src/c/objects/DakotaPlugin.h	(revision 3419)
+++ /issm/trunk/src/c/objects/DakotaPlugin.h	(revision 3420)
@@ -2,6 +2,6 @@
  */ 
 
-#ifndef DAKOTAPLUGIN_H
-#define DAKOTAPLUGIN_H
+#ifndef _DAKOTAPLUGIN_H
+#define _DAKOTAPLUGIN_H
 
 
Index: /issm/trunk/src/c/objects/DofIndexing.cpp
===================================================================
--- /issm/trunk/src/c/objects/DofIndexing.cpp	(revision 3419)
+++ /issm/trunk/src/c/objects/DofIndexing.cpp	(revision 3420)
@@ -39,4 +39,10 @@
 /*FUNCTION DofIndexing constructor {{{1*/
 DofIndexing::DofIndexing(int in_numberofdofs, int in_partitionborder){
+
+	this->Init(in_numberofdofs,in_partitionborder);
+}
+/*}}}*/
+/*FUNCTION DofIndexing Init: used by constructor {{{1*/
+void DofIndexing::Init(int in_numberofdofs, int in_partitionborder){
 
 	int i;
Index: /issm/trunk/src/c/objects/DofIndexing.h
===================================================================
--- /issm/trunk/src/c/objects/DofIndexing.h	(revision 3419)
+++ /issm/trunk/src/c/objects/DofIndexing.h	(revision 3420)
@@ -29,4 +29,5 @@
 		DofIndexing();
 		DofIndexing(int numberofdofs, int partitionborder);
+		void Init(int numberofdofs, int partitionborder);
 		DofIndexing(DofIndexing* properties);
 		~DofIndexing();
Index: /issm/trunk/src/c/objects/ElementProperties.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementProperties.cpp	(revision 3419)
+++ /issm/trunk/src/c/objects/ElementProperties.cpp	(revision 3420)
@@ -49,4 +49,18 @@
 
 ElementProperties::ElementProperties(int elementproperties_numnodes, double* elementproperties_h,double* elementproperties_s,double* elementproperties_b,
+		double* elementproperties_k,double* elementproperties_melting,double* elementproperties_accumulation,
+		double* elementproperties_geothermalflux, int elementproperties_friction_type,double elementproperties_p,
+		double elementproperties_q, int elementproperties_shelf, int elementproperties_onbed, bool elementproperties_onwater, 
+		int elementproperties_onsurface, int elementproperties_collapse, int elementproperties_thermal_steadystate){
+
+	this->Init(elementproperties_numnodes, elementproperties_h,elementproperties_s,elementproperties_b,
+		elementproperties_k,elementproperties_melting,elementproperties_accumulation,
+		elementproperties_geothermalflux, elementproperties_friction_type,elementproperties_p,
+		elementproperties_q, elementproperties_shelf, elementproperties_onbed, elementproperties_onwater,
+		elementproperties_onsurface, elementproperties_collapse, elementproperties_thermal_steadystate);
+}
+/*}}}*/
+/*FUNCTION ElementProperties Initialize propreties, used by constructor{{{1*/
+void ElementProperties::Init(int elementproperties_numnodes, double* elementproperties_h,double* elementproperties_s,double* elementproperties_b,
 		double* elementproperties_k,double* elementproperties_melting,double* elementproperties_accumulation,
 		double* elementproperties_geothermalflux, int elementproperties_friction_type,double elementproperties_p,
@@ -92,68 +106,4 @@
 	this->collapse=elementproperties_collapse;
 	this->thermal_steadystate=elementproperties_thermal_steadystate;
-	
-	return;
-}
-/*}}}*/
-/*FUNCTION ElementProperties constructor {{{1*/
-
-ElementProperties::ElementProperties(int elementproperties_numnodes, double* elementproperties_h,double* elementproperties_s,double* elementproperties_b,
-		double* elementproperties_k,double* elementproperties_melting,double* elementproperties_accumulation,
-		double* elementproperties_geothermalflux, int elementproperties_friction_type,double elementproperties_p,
-		double elementproperties_q, int elementproperties_shelf, int elementproperties_onbed, bool elementproperties_onwater, 
-		int elementproperties_onsurface, int elementproperties_collapse, int elementproperties_thermal_steadystate){
-
-	this->Init(elementproperties_numnodes, elementproperties_h,elementproperties_s,elementproperties_b,
-		elementproperties_k,elementproperties_melting,elementproperties_accumulation,
-		elementproperties_geothermalflux, elementproperties_friction_type,elementproperties_p,
-		elementproperties_q, elementproperties_shelf, elementproperties_onbed, elementproperties_onwater,
-		elementproperties_onsurface, elementproperties_collapse, elementproperties_thermal_steadystate);
-}
-/*}}}*/
-/*FUNCTION ElementProperties Initialize propreties, used by constructor{{{1*/
-ElementProperties::Init(int elementproperties_numnodes, double* elementproperties_h,double* elementproperties_s,double* elementproperties_b,
-		double* elementproperties_k,double* elementproperties_melting,double* elementproperties_accumulation,
-		double* elementproperties_geothermalflux, int elementproperties_friction_type,double elementproperties_p,
-		double elementproperties_q, int elementproperties_shelf, int elementproperties_onbed, bool elementproperties_onwater, 
-		int elementproperties_onsurface, int elementproperties_collapse, int elementproperties_thermal_steadystate){
-
-	int i;
-
-	this->numnodes=prop->numnodes;
-
-	if(prop->h)this->h=(double*)xmalloc(this->numnodes*sizeof(double));
-	else this->h=NULL;
-	if(prop->s)this->s=(double*)xmalloc(this->numnodes*sizeof(double));
-	else this->s=NULL;
-	if(prop->b)this->b=(double*)xmalloc(this->numnodes*sizeof(double));
-	else this->b=NULL;
-	if(prop->k)this->k=(double*)xmalloc(this->numnodes*sizeof(double));
-	else this->k=NULL;
-	if(prop->melting)this->melting=(double*)xmalloc(this->numnodes*sizeof(double));
-	else this->melting=NULL;
-	if(prop->accumulation)this->accumulation=(double*)xmalloc(this->numnodes*sizeof(double));
-	else this->accumulation=NULL;
-	if(prop->geothermalflux)this->geothermalflux=(double*)xmalloc(this->numnodes*sizeof(double));
-	else this->geothermalflux=NULL;
-
-	for(i=0;i<this->numnodes;i++){
-		if(prop->h)this->h[i]=prop->h[i];
-		if(prop->s)this->s[i]=prop->s[i];
-		if(prop->b)this->b[i]=prop->b[i];
-		if(prop->k)this->k[i]=prop->k[i];
-		if(prop->melting)this->melting[i]=prop->melting[i];
-		if(prop->accumulation)this->accumulation[i]=prop->accumulation[i];
-		if(prop->geothermalflux)this->geothermalflux[i]=prop->geothermalflux[i];
-	}
-	
-	this->friction_type=prop->friction_type;
-	this->p=prop->p;
-	this->q=prop->q;
-	this->shelf=prop->shelf;
-	this->onbed=prop->onbed;
-	this->onwater=prop->onwater;
-	this->onsurface=prop->onsurface;
-	this->collapse=prop->collapse;
-	this->thermal_steadystate=prop->thermal_steadystate;
 
 	return;
Index: /issm/trunk/src/c/objects/ElementProperties.h
===================================================================
--- /issm/trunk/src/c/objects/ElementProperties.h	(revision 3419)
+++ /issm/trunk/src/c/objects/ElementProperties.h	(revision 3420)
@@ -33,5 +33,5 @@
 		ElementProperties();
 		ElementProperties(int numnodes, double* h, double* s, double* b, double* k, double* melting, double* accumulation, double* geothermalflux, int friction_type, double p, double q, int shelf, int onbed, bool onwater, int onsurface, int collapse, int thermal_steadystate);
-		Init(int numnodes, double* h, double* s, double* b, double* k, double* melting, double* accumulation, double* geothermalflux, int friction_type, double p, double q, int shelf, int onbed, bool onwater, int onsurface, int collapse, int thermal_steadystate);
+		void Init(int numnodes, double* h, double* s, double* b, double* k, double* melting, double* accumulation, double* geothermalflux, int friction_type, double p, double q, int shelf, int onbed, bool onwater, int onsurface, int collapse, int thermal_steadystate);
 		ElementProperties(ElementProperties* properties);
 		~ElementProperties();
Index: /issm/trunk/src/c/objects/FemModel.h
===================================================================
--- /issm/trunk/src/c/objects/FemModel.h	(revision 3419)
+++ /issm/trunk/src/c/objects/FemModel.h	(revision 3420)
@@ -3,6 +3,9 @@
  */
 
-#ifndef FEMMODEL_H_
-#define FEMMODEL_H_
+#ifndef _FEMMODEL_H_
+#define _FEMMODEL_H_
+
+class DataSet;
+class DofVec;
 
 #include "./Object.h"
@@ -62,5 +65,5 @@
 		DataSet* get_elements(void);
 		DataSet* get_nodes(void);
-		DataSet* get_vertices(void){return vertices ;}
+		DataSet* get_vertices(void);
 		DataSet* get_constraints(void);
 		DataSet* get_loads(void);
Index: /issm/trunk/src/c/objects/Hook.cpp
===================================================================
--- /issm/trunk/src/c/objects/Hook.cpp	(revision 3419)
+++ /issm/trunk/src/c/objects/Hook.cpp	(revision 3420)
@@ -38,5 +38,5 @@
 /*}}}*/
 /*FUNCTION Hook::Init(int* ids, int num){{{1*/
-Hook::Init(int* in_ids, int in_num){
+void Hook::Init(int* in_ids, int in_num){
 
 	int i;
Index: /issm/trunk/src/c/objects/Hook.h
===================================================================
--- /issm/trunk/src/c/objects/Hook.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Hook.h	(revision 3420)
@@ -9,9 +9,11 @@
 #define _HOOK_H_
 
+class DataSet;
+class Object;
+
 #include "./Object.h"
 #include "../DataSet/DataSet.h"
 #include "../toolkits/toolkits.h"
 
-class DataSet;
 class Hook{
 
@@ -27,5 +29,5 @@
 		Hook();
 		Hook(int* ids, int num);
-		Init(int* ids, int num);
+		void Init(int* ids, int num);
 		Hook(Object** objects, int* ids, int* offsets,int num);
 		Hook(Hook* hook);
Index: /issm/trunk/src/c/objects/Icefront.h
===================================================================
--- /issm/trunk/src/c/objects/Icefront.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Icefront.h	(revision 3420)
@@ -5,4 +5,10 @@
 #ifndef _ICEFRONT_H_
 #define _ICEFRONT_H_
+
+class Element;
+class Load;
+class Matpar;
+class Element;
+class Node;
 
 #include "./Load.h"
@@ -14,5 +20,4 @@
 #define ICEFRONTSTRING 20 //max string length
 
-class Element;
 class Icefront: public Load {
 
Index: /issm/trunk/src/c/objects/Load.h
===================================================================
--- /issm/trunk/src/c/objects/Load.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Load.h	(revision 3420)
@@ -8,4 +8,6 @@
 #ifndef _LOAD_H_
 #define _LOAD_H_
+
+class Object;
 
 #include "./Object.h"
Index: /issm/trunk/src/c/objects/Material.h
===================================================================
--- /issm/trunk/src/c/objects/Material.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Material.h	(revision 3420)
@@ -6,4 +6,6 @@
 #ifndef _MATERIAL_H_
 #define _MATERIAL_H_
+
+class Object;
 
 #include "./Object.h"
Index: /issm/trunk/src/c/objects/Matice.cpp
===================================================================
--- /issm/trunk/src/c/objects/Matice.cpp	(revision 3419)
+++ /issm/trunk/src/c/objects/Matice.cpp	(revision 3420)
@@ -28,5 +28,5 @@
 /*}}}*/
 /*FUNCTION Matice::init {{{1*/
-Matice::Init(int in_mid,double in_B,double in_n){
+void Matice::Init(int in_mid,double in_B,double in_n){
 	this->mid=in_mid;
 	this->B=in_B;
Index: /issm/trunk/src/c/objects/Matice.h
===================================================================
--- /issm/trunk/src/c/objects/Matice.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Matice.h	(revision 3420)
@@ -6,6 +6,8 @@
 #define MATICE_H_
 
+struct IoModel;
+
 #include "./Material.h"
-
+#include "../ModelProcessorx/IoModel.h"
 class Matice: public Material{
 
@@ -20,5 +22,5 @@
 		Matice(int mid,double B,double n);
 		Matice(int i, IoModel* iomodel, int num_vertices);
-		Init(int mid,double B,double n);
+		void Init(int mid,double B,double n);
 		~Matice();
 
Index: /issm/trunk/src/c/objects/Matpar.cpp
===================================================================
--- /issm/trunk/src/c/objects/Matpar.cpp	(revision 3419)
+++ /issm/trunk/src/c/objects/Matpar.cpp	(revision 3420)
@@ -62,5 +62,5 @@
 /*}}}1*/
 /*FUNCTION Matpar::Init {{{1*/
-Matpar::Init(int	matpar_mid, double	matpar_rho_ice, double	matpar_rho_water, double  matpar_heatcapacity, double  matpar_thermalconductivity, double  matpar_latentheat, double  matpar_beta, double  matpar_meltingpoint, double  matpar_mixed_layer_capacity, double  matpar_thermal_exchange_velocity, double  matpar_g){
+void Matpar::Init(int	matpar_mid, double	matpar_rho_ice, double	matpar_rho_water, double  matpar_heatcapacity, double  matpar_thermalconductivity, double  matpar_latentheat, double  matpar_beta, double  matpar_meltingpoint, double  matpar_mixed_layer_capacity, double  matpar_thermal_exchange_velocity, double  matpar_g){
 
 	this->mid=matpar_mid; 
Index: /issm/trunk/src/c/objects/Matpar.h
===================================================================
--- /issm/trunk/src/c/objects/Matpar.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Matpar.h	(revision 3420)
@@ -6,5 +6,8 @@
 #define _MATPAR_H_
 
+struct IoModel;
+
 #include "./Material.h"
+#include "../ModelProcessorx/IoModel.h"
 
 class Matpar: public Material{
@@ -28,7 +31,6 @@
 	
 		Matpar(int	mid, double	rho_ice, double	rho_water, double  heatcapacity, double  thermalconductivity, double  latentheat, double  beta, double  meltingpoint, double  mixed_layer_capacity, double  thermal_exchange_velocity, double  g);
-		Init(int	mid, double	rho_ice, double	rho_water, double  heatcapacity, double  thermalconductivity, double  latentheat, double  beta, double  meltingpoint, double  mixed_layer_capacity, double  thermal_exchange_velocity, double  g);
+		void Init(int	mid, double	rho_ice, double	rho_water, double  heatcapacity, double  thermalconductivity, double  latentheat, double  beta, double  meltingpoint, double  mixed_layer_capacity, double  thermal_exchange_velocity, double  g);
 		Matpar(IoModel* iomodel);
-		
 		~Matpar();
 
Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 3419)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 3420)
@@ -60,4 +60,5 @@
 	int partitionborder;
 	int vertex_id;
+	int upper_node_id;
 
 
@@ -67,5 +68,5 @@
 	/*indexing:*/
 	DistributeNumDofs(&numdofs,iomodel->analysis_type,iomodel->sub_analysis_type); //number of dofs per node
-	if(my_bordervertices[i])partitionborder=1; else partitionborder=0;//is this node on a partition border?
+	if(iomodel->my_bordervertices[i])partitionborder=1; else partitionborder=0;//is this node on a partition border?
 
 	this->indexing.Init(numdofs,partitionborder);
@@ -94,6 +95,6 @@
 	}
 
-	this->hvertex->Init(vertex_id,1); //node id is the same as the vertex id, continuous galerkin!
-	this->hupper_node->Init(upper_node_id,1);
+	this->hvertex.Init(&vertex_id,1); //node id is the same as the vertex id, continuous galerkin!
+	this->hupper_node.Init(&upper_node_id,1);
 	
 
@@ -103,5 +104,5 @@
 		if (iomodel->deadgrids[i]){
 			for(k=1;k<=numdofs;k++){
-				node->FreezeDof(k);
+				this->FreezeDof(k);
 			}
 		}
@@ -109,5 +110,5 @@
 	if (iomodel->gridonhutter[i]){
 		for(k=1;k<=numdofs;k++){
-			node->FreezeDof(k);
+			this->FreezeDof(k);
 		}
 	}
Index: /issm/trunk/src/c/objects/Node.h
===================================================================
--- /issm/trunk/src/c/objects/Node.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Node.h	(revision 3420)
@@ -6,8 +6,13 @@
 #define _NODE_H_
 
+
 /*indefinitions: */
 class Object;
 class Vertex;
+struct IoModel;
 class Hook;
+class DofIndexing;
+class NodeProperties;
+class Node;
 
 #include "./Object.h"
@@ -18,4 +23,5 @@
 #include "./NodeProperties.h"
 #include "../toolkits/toolkits.h"
+#include "../ModelProcessorx/IoModel.h"
 
 class Node: public Object{
Index: /issm/trunk/src/c/objects/NodeProperties.cpp
===================================================================
--- /issm/trunk/src/c/objects/NodeProperties.cpp	(revision 3419)
+++ /issm/trunk/src/c/objects/NodeProperties.cpp	(revision 3420)
@@ -36,5 +36,5 @@
 /*}}}*/
 /*FUNCTION NodeProperties init: used by constructor {{{1*/
-NodeProperties::Init(int nodeproperties_onbed, int nodeproperties_onsurface, int nodeproperties_onshelf, int nodeproperties_onsheet){
+void NodeProperties::Init(int nodeproperties_onbed, int nodeproperties_onsurface, int nodeproperties_onshelf, int nodeproperties_onsheet){
 
 	this->onbed=nodeproperties_onbed;
Index: /issm/trunk/src/c/objects/NodeProperties.h
===================================================================
--- /issm/trunk/src/c/objects/NodeProperties.h	(revision 3419)
+++ /issm/trunk/src/c/objects/NodeProperties.h	(revision 3420)
@@ -17,5 +17,5 @@
 		NodeProperties();
 		NodeProperties(int onbed, int onsurface, int onshelf, int onsheet);
-		Init(int onbed, int onsurface, int onshelf, int onsheet);
+		void Init(int onbed, int onsurface, int onshelf, int onsheet);
 		NodeProperties(NodeProperties* properties);
 		~NodeProperties();
Index: /issm/trunk/src/c/objects/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Penta.cpp	(revision 3419)
+++ /issm/trunk/src/c/objects/Penta.cpp	(revision 3420)
@@ -59,4 +59,7 @@
 	int offset;
 	int penta_node_ids[6];
+	int penta_matice_id;
+	int penta_matpar_id;
+	int penta_numpar_id;
 	double penta_h[6];
 	double penta_s[6];
@@ -65,4 +68,11 @@
 	double penta_melting[6];
 	double penta_accumulation[6];
+	int    penta_friction_type;
+	double penta_p,penta_q;
+	int    penta_shelf;
+	bool   penta_onwater;
+	int    penta_onsurface;
+	int    penta_onbed;
+	int    penta_collapse;
 
 	/*id: */
@@ -77,8 +87,8 @@
 	penta_numpar_id=1; //refers to numerical parameters object
 
-	this->hnodes->Init(penta_node_ids,6);
-	this->hmatice->Init(penta_matice_id,1);
-	this->hmatpar->Init(penta_matpar_id,1);
-	this->hnumpar->Init(penta_numpar_id,1);
+	this->hnodes.Init(penta_node_ids,6);
+	this->hmatice.Init(&penta_matice_id,1);
+	this->hmatpar.Init(&penta_matpar_id,1);
+	this->hnumpar.Init(&penta_numpar_id,1);
 
 	/*properties: */
@@ -97,9 +107,9 @@
 	penta_q=iomodel->q[i];
 	penta_shelf=(int)*(iomodel->elementoniceshelf+i);
-	penta_onwater=(bool)*(iomodel->elementonwater+i);
+	penta_onbed=(bool)*(iomodel->elementonbed+i);
 	penta_onsurface=(int)*(iomodel->elementonsurface+i);
 	penta_onwater=(bool)*(iomodel->elementonwater+i);
 
-	if (*(iomodel->elements_type+2*i+0)==macayealformulationenum()){ //elements of type 3 are macayeal type penta. we collapse the formulation on their base.
+	if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 3 are macayeal type penta. we collapse the formulation on their base.
 		penta_collapse=1;
 	}
@@ -108,5 +118,5 @@
 	}
 
-	this->properties->Init(6,penta_h, penta_s, penta_b, penta_k, penta_melting, penta_accumulation, NULL, penta_friction_type, penta_p, penta_q, penta_shelf, penta_onbed, penta_onwater, penta_onsurface, penta_collapse, UNDEF);
+	this->properties.Init(6,penta_h, penta_s, penta_b, penta_k, penta_melting, penta_accumulation, NULL, penta_friction_type, penta_p, penta_q, penta_shelf, penta_onbed, penta_onwater, penta_onsurface, penta_collapse, UNDEF);
 
 
Index: /issm/trunk/src/c/objects/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Penta.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Penta.h	(revision 3420)
@@ -5,4 +5,12 @@
 #ifndef _PENTA_H
 #define _PENTA_H
+
+class Object;
+class Node;
+class Hook;
+class ElementProperties;
+class DataSet;
+struct IoModel;
+
 
 #include "./Object.h"
@@ -14,12 +22,7 @@
 #include "./Hook.h"
 #include "./ElementProperties.h"
+#include "../ModelProcessorx/IoModel.h"
 #include "./ParameterInputs.h"
 #include "./Node.h"
-
-class Object;
-class Node;
-class Hook;
-class ElementProperties;
-class DataSet;
 
 class Penta: public Element{
Index: /issm/trunk/src/c/objects/Sing.h
===================================================================
--- /issm/trunk/src/c/objects/Sing.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Sing.h	(revision 3420)
@@ -13,4 +13,7 @@
 #include "./ElementProperties.h"
 #include "./Hook.h"
+
+class Hook;
+class ElementProperties;
 
 class Sing: public Element{
Index: /issm/trunk/src/c/objects/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Tria.cpp	(revision 3419)
+++ /issm/trunk/src/c/objects/Tria.cpp	(revision 3420)
@@ -10,4 +10,6 @@
 
 #include "stdio.h"
+#include "./Object.h"
+#include "./Hook.h"
 #include "./Tria.h"
 #include "./Hook.h"
@@ -67,4 +69,7 @@
 	int offset;
 	int tria_node_ids[3];
+	int tria_matice_id;
+	int tria_matpar_id;
+	int tria_numpar_id;
 	double tria_h[3];
 	double tria_s[3];
@@ -73,4 +78,9 @@
 	double tria_melting[3];
 	double tria_accumulation[3];
+	int    tria_friction_type;
+	double tria_p,tria_q;
+	int tria_shelf;
+	int tria_onwater;
+	
 
 	/*id: */
@@ -85,8 +95,8 @@
 	tria_numpar_id=1; //refers to numerical parameters object
 
-	this->hnodes->Init(tria_node_ids,3);
-	this->hmatice->Init(tria_matice_id,1);
-	this->hmatpar->Init(tria_matpar_id,1);
-	this->hnumpar->Init(tria_numpar_id,1);
+	this->hnodes.Init(tria_node_ids,3);
+	this->hmatice.Init(&tria_matice_id,1);
+	this->hmatpar.Init(&tria_matpar_id,1);
+	this->hnumpar.Init(&tria_numpar_id,1);
 
 	/*properties: */
@@ -107,5 +117,5 @@
 	tria_onwater=(bool)*(iomodel->elementonwater+i);
 	
-	this->properties->Init(3,tria_h, tria_s, tria_b, tria_k, tria_melting, tria_accumulation, NULL,
+	this->properties.Init(3,tria_h, tria_s, tria_b, tria_k, tria_melting, tria_accumulation, NULL,
 			tria_friction_type, tria_p, tria_q, tria_shelf, UNDEF,tria_onwater, UNDEF,UNDEF,UNDEF);
 
@@ -5019,36 +5029,4 @@
 }
 /*}}}*/
-/*FUNCTION MaticeConfiguration {{{1*/
-void  Tria::MaticeConfiguration(Matice* tria_matice,int tria_matice_offset){
-
-	/*dynamic objects pointed to by hooks: */
-	Matice* matice=NULL;
-
-	/*recover objects from hooks: */
-	matice=(Matice*)hmatice.delivers();
-	
-	ISSMERROR("not supported yet!");
-
-	/*matice=tria_matice;
-	matice_offset=tria_matice_offset;*/
-
-}
-/*}}}*/
-/*FUNCTION MatparConfiguration {{{1*/
-void  Tria::MatparConfiguration(Matpar* tria_matpar,int tria_matpar_offset){
-
-	/*dynamic objects pointed to by hooks: */
-	Matpar* matpar=NULL;
-
-	/*recover objects from hooks: */
-	matpar=(Matpar*)hmatpar.delivers();
-
-	ISSMERROR("not supported yet!");
-
-	/*matpar=tria_matpar;
-	matpar_offset=tria_matpar_offset;*/
-
-}
-/*}}}*/
 /*FUNCTION Misfit {{{1*/
 double Tria::Misfit(void* vinputs,int analysis_type,int sub_analysis_type){
@@ -5267,40 +5245,4 @@
 }
 /*}}}*/
-/*FUNCTION NodeConfiguration {{{1*/
-void  Tria::NodeConfiguration(int* tria_node_ids,Node* tria_nodes[3],int* tria_node_offsets){
-
-	/*dynamic objects pointed to by hooks: */
-	Node**  nodes=NULL;
-
-	/*recover objects from hooks: */
-	nodes=(Node**)hnodes.deliverp();
-
-	ISSMERROR("not supported yet!");
-
-	/*int i;
-	for(i=0;i<3;i++){
-		node_ids[i]=tria_node_ids[i];
-		nodes[i]=tria_nodes[i];
-		node_offsets[i]=tria_node_offsets[i];
-	}*/
-
-}
-/*}}}*/
-/*FUNCTION NumparConfiguration {{{1*/
-void  Tria::NumparConfiguration(Numpar* tria_numpar,int tria_numpar_offset){
-
-	/*dynamic objects pointed to by hooks: */
-	Numpar* numpar=NULL;
-
-	/*recover objects from hooks: */
-	numpar=(Numpar*)hnumpar.delivers();
-
-	ISSMERROR("not supported yet!");
-
-	/*numpar=tria_numpar;
-	numpar_offset=tria_numpar_offset;*/
-
-}
-/*}}}*/
 /*FUNCTION SurfaceNormal{{{1*/
 
Index: /issm/trunk/src/c/objects/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Tria.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Tria.h	(revision 3420)
@@ -6,4 +6,11 @@
 #define _TRIA_H_
 
+class Object;
+class Element;
+class Hook;
+class ElementProperties;
+class DataSet;
+class Node;
+struct IoModel;
 
 #include "./Object.h"
@@ -12,12 +19,6 @@
 #include "./Node.h"
 #include "./ElementProperties.h"
+#include "../ModelProcessorx/IoModel.h"
 #include "../DataSet/DataSet.h"
-
-class Object;
-class Element;
-class Hook;
-class ElementProperties;
-class DataSet;
-class Node;
 
 class Tria: public Element{
@@ -102,8 +103,4 @@
 		void  GetThicknessList(double* thickness_list);
 		void  GetBedList(double* bed_list);
-		void  NodeConfiguration(int* tria_node_ids,Node* tria_nodes[3],int* tria_node_offsets);
-		void  MaticeConfiguration(Matice* matice,int matice_offset);
-		void  MatparConfiguration(Matpar* matpar,int matpar_offset);
-		void  NumparConfiguration(Numpar* tria_numpar,int tria_numpar_offset);
 		void  ComputePressure(Vec p_g);
 		void  CreateKMatrixThermal(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type);
Index: /issm/trunk/src/c/objects/Vertex.cpp
===================================================================
--- /issm/trunk/src/c/objects/Vertex.cpp	(revision 3419)
+++ /issm/trunk/src/c/objects/Vertex.cpp	(revision 3420)
@@ -17,4 +17,5 @@
 #include "../include/typedefs.h"
 #include "../include/macros.h"
+#include "../ModelProcessorx/IoModel.h"
 /*}}}*/
 
@@ -31,5 +32,5 @@
 /*}}}*/
 /*FUNCTION Vertex init, used by constructor {{{1*/
-Vertex::Init(int tria_id, double tria_x, double tria_y, double tria_z, double tria_sigma, int partitionborder){
+void Vertex::Init(int tria_id, double tria_x, double tria_y, double tria_z, double tria_sigma, int partitionborder){
 
 	/*all the initialization has been done by the initializer, just fill in the id: */
@@ -50,5 +51,5 @@
 
 	/*is this vertex on a partition border? */
-	if(my_bordervertices[i])partitionborder=1;
+	if(iomodel->my_bordervertices[i])partitionborder=1;
 	else partitionborder=0;
 
Index: /issm/trunk/src/c/objects/Vertex.h
===================================================================
--- /issm/trunk/src/c/objects/Vertex.h	(revision 3419)
+++ /issm/trunk/src/c/objects/Vertex.h	(revision 3420)
@@ -6,4 +6,5 @@
 #define _VERTEX_H_
 
+#include "../ModelProcessorx/IoModel.h"
 #include "./Object.h"
 
@@ -26,5 +27,5 @@
 		Vertex();
 		Vertex(int id, double x, double y, double z, double sigma,int partitionborder); 
-		Init(int id, double x, double y, double z, double sigma,int partitionborder);
+		void Init(int id, double x, double y, double z, double sigma,int partitionborder);
 		Vertex(int i, IoModel* iomodel);
 		~Vertex();
Index: /issm/trunk/src/c/objects/objects.h
===================================================================
--- /issm/trunk/src/c/objects/objects.h	(revision 3419)
+++ /issm/trunk/src/c/objects/objects.h	(revision 3420)
@@ -5,4 +5,24 @@
 #ifndef ALL_OBJECTS_H_
 #define ALL_OBJECTS_H_
+
+class Object;
+class Matice;
+class Matpar;
+class Node;
+class Penta;
+class Tria;
+class Sing;
+class Beam;
+class Spc;
+class Rgb;
+class Icefront;
+class Riftfront;
+class Penpair;
+class Pengrid;
+class Numericalflux;
+class Param;
+class Element;
+class NodeSets;
+class Model;
 
 /*Abstract class: */
