Index: /issm/trunk/src/c/objects/Materials/Matice.cpp
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 4919)
+++ /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 4920)
@@ -20,4 +20,5 @@
 Matice::Matice(){
 	this->inputs=NULL;
+	this->helement=NULL;
 	return;
 }
@@ -28,4 +29,5 @@
 	/*Intermediaries:*/
 	int    i;
+	int    matice_eid;
 
 	/*Initialize id*/
@@ -74,12 +76,18 @@
 		}
 	}
-
 	/*Else*/
 	else ISSMERROR(" Mesh type not supported yet!");
 
+	/*Hooks: */
+	matice_eid=index+1;
+	this->helement=new Hook(&matice_eid,1);
+
+	return;
+
 }
 /*}}}*/
 /*FUNCTION Matice::~Matice(){{{1*/
 Matice::~Matice(){
+	delete helement;
 	delete inputs;
 	return;
@@ -95,4 +103,6 @@
 	printf("   inputs:\n");
 	inputs->Echo();
+	printf("   element:\n");
+	helement->Echo();
 }
 /*}}}*/
@@ -104,4 +114,6 @@
 	printf("   inputs:\n");
 	inputs->DeepEcho();
+	printf("   element:\n");
+	helement->Echo();
 }		
 /*}}}*/
@@ -136,4 +148,7 @@
 	memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
 
+	/*Marshall hooks: */
+	helement->Marshall(&marshalled_dataset);
+
 	/*Marshall inputs: */
 	marshalled_inputs_size=inputs->MarshallSize();
@@ -152,4 +167,5 @@
 
 	return sizeof(mid)
+	  +helement->MarshallSize()
 	  +inputs->MarshallSize()
 	  +sizeof(int); //sizeof(int) for enum type
@@ -166,6 +182,8 @@
 	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
 	 *object data (thanks to DataSet::Demarshall):*/
-
 	memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
+
+	/*demarshall hooks: */
+	helement=new Hook(); helement->Demarshall(&marshalled_dataset);
 
 	/*demarshall inputs: */
@@ -190,11 +208,10 @@
 	Matice* matice=NULL;
 
+	/*copy fields: */
 	matice->mid=this->mid;
-	if(this->inputs){
-		matice->inputs=(Inputs*)this->inputs->Copy();
-	}
-	else{
-		matice->inputs=new Inputs();
-	}
+	matice->helement=(Hook*)this->helement->copy();
+	if(this->inputs) matice->inputs=(Inputs*)this->inputs->Copy();
+	else  matice->inputs=new Inputs();
+
 	return matice;
 }
@@ -202,4 +219,20 @@
 
 /*Matice management*/
+/*FUNCTION Matice::Configure {{{1*/
+void  Matice::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
+
+	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+	 * datasets, using internal ids and offsets hidden in hooks: */
+	helement->configure(elementsin);
+}
+/*}}}*/
+/*FUNCTION Matice::SetCurrentConfiguration {{{1*/
+void  Matice::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
+
+	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+	 * datasets, using internal ids and offsets hidden in hooks: */
+	helement->configure(elementsin);
+}
+/*}}}*/
 /*FUNCTION Matice::GetB {{{1*/
 double Matice::GetB(){
Index: /issm/trunk/src/c/objects/Materials/Matice.h
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matice.h	(revision 4919)
+++ /issm/trunk/src/c/objects/Materials/Matice.h	(revision 4920)
@@ -15,8 +15,12 @@
 
 	private: 
+		/*Id*/
 		int	   mid;
 
+		/*hooks: */
+		Hook* helement;
+
 	public:
-		/*WARNIN: input should not be public but it is an easy way to update B from T (using UpdateFromSolution) from Pentas*/
+		/*WARNING: input should not be public but it is an easy way to update B from T (using UpdateFromSolution) from Pentas*/
 		Inputs*  inputs;
 
@@ -47,4 +51,6 @@
 		/*}}}*/
 		/*Matice Numerics: {{{1*/
+		void   Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
+		void   SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
 		void   GetViscosity2d(double* pviscosity, double* pepsilon);
 		void   GetViscosity3d(double* pviscosity3d, double* pepsilon);
