Index: /issm/trunk/src/c/objects/Loads/Icefront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 5713)
+++ /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 5714)
@@ -30,9 +30,14 @@
 /*FUNCTION Icefront::Icefront() {{{1*/
 Icefront::Icefront(){
+
 	this->inputs=NULL;
 	this->parameters=NULL;
+
 	this->hnodes=NULL;
+	this->nodes= NULL;
 	this->helement=NULL;
+	this->element= NULL;
 	this->hmatpar=NULL;
+	this->matpar= NULL;
 }
 /*}}}*/
@@ -93,6 +98,9 @@
 	this->inputs->AddInput(new IntInput(TypeEnum,in_icefront_type));
 	
-	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
+	//parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
 	this->parameters=NULL;
+	this->nodes= NULL;
+	this->element= NULL;
+	this->matpar= NULL;
 }
 
@@ -218,4 +226,9 @@
 	hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
 	
+	/*pointers are garbabe, until configuration is carried out: */
+	nodes=NULL;
+	element=NULL;
+	matpar=NULL;
+
 	/*demarshall inputs: */
 	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
@@ -260,4 +273,9 @@
 	icefront->hmatpar=(Hook*)this->hmatpar->copy();
 
+	/*corresponding fields*/
+	icefront->nodes  =(Node**)icefront->hnodes->deliverp();
+	icefront->element=(Element*)icefront->helement->delivers();
+	icefront->matpar =(Matpar*)icefront->hmatpar->delivers();
+
 	return icefront;
 
@@ -275,4 +293,9 @@
 	hmatpar->configure(materialsin);
 
+	/*Initialize hooked fields*/
+	this->nodes  =(Node**)hnodes->deliverp();
+	this->element=(Element*)helement->delivers();
+	this->matpar =(Matpar*)hmatpar->delivers();
+
 	/*point parameters to real dataset: */
 	this->parameters=parametersin;
@@ -281,5 +304,4 @@
 /*FUNCTION Icefront::SetCurrentConfiguration {{{1*/
 void  Icefront::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
-
 }
 /*}}}*/
@@ -295,7 +317,11 @@
 void  Icefront::CreatePVector(Vec pg){
 
+	/*Checks in debugging mode*/
+	ISSMASSERT(nodes);
+	ISSMASSERT(element);
+	ISSMASSERT(matpar);
+
+	/*Retrieve parameters: */
 	int analysis_type;
-
-	/*Retrieve parameters: */
 	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
 
@@ -404,7 +430,4 @@
 	/*Objects: */
 	double    pe_g[numdofs] = {0.0};
-	Matpar   *matpar        = NULL;
-	Node    **nodes         = NULL;
-	Element  *element       = NULL;
 
 	/*Segment*/
@@ -429,8 +452,4 @@
 	Penta*  penta=NULL;
 
-	/*Recover hook objects: */
-	matpar =(Matpar*)hmatpar->delivers();
-	element=(Element*)helement->delivers();
-	nodes  =(Node**)hnodes->deliverp();
 	BeamRef* beam=NULL;
 
@@ -539,8 +558,5 @@
 	/*Objects: */
 	double  pe_g[numdofs]={0.0};
-	Matpar* matpar=NULL;
 	Node**  element_nodes=NULL;
-	Node**   nodes=NULL;
-	Element* element=NULL;
 	int    element_type;
 		
@@ -559,8 +575,4 @@
 	double v45[3];
 
-	/*Recover hook objects: */
-	matpar=(Matpar*)hmatpar->delivers();
-	element=(Element*)helement->delivers();
-	nodes=(Node**)hnodes->deliverp();
 
 	element_type=element->Enum();
@@ -675,8 +687,5 @@
 	/*Objects: */
 	double  pe_g[numdofs]={0.0};
-	Matpar* matpar=NULL;
 	Node**  element_nodes=NULL;
-	Node**   nodes=NULL;
-	Element* element=NULL;
 	Penta*   penta=NULL;
 
@@ -696,9 +705,4 @@
 	int approximation;
 
-	/*Recover hook objects: */
-	matpar=(Matpar*)hmatpar->delivers();
-	element=(Element*)helement->delivers();
-	nodes=(Node**)hnodes->deliverp();
-
 	/*check icefront is associated to a pentaelem: */
 	if(element->Enum()!=PentaEnum) ISSMERROR("Only Penta supported yet");
@@ -806,9 +810,4 @@
 	int* doflist=NULL;
 
-	/*pointers: */
-	Node**   nodes=NULL;
-	
-	/*recover pointers: */
-	nodes=(Node**)hnodes->deliverp();
 	
 	/*recover type: */
@@ -1368,12 +1367,4 @@
 	double value;
 
-	/*dynamic objects pointed to by hooks: */
-	Element* element=NULL;
-	Node**   nodes=NULL;
-
-	/*recover objects from hooks: */
-	element=(Element*)helement->delivers();
-	nodes=(Node**)hnodes->deliverp();
-
 	/*Get value on Element 1*/
 	element->GetParameterValue(&value,nodes[0],nodes[1],gauss_coord,input_in);
Index: /issm/trunk/src/c/objects/Loads/Icefront.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Icefront.h	(revision 5713)
+++ /issm/trunk/src/c/objects/Loads/Icefront.h	(revision 5714)
@@ -12,4 +12,7 @@
 class Inputs;
 class Parameters;
+class Matpar;
+class Node;
+class Element;
 class IoModel;
 /*}}}*/
@@ -25,4 +28,9 @@
 		Hook* helement;
 		Hook* hmatpar;
+
+		/*Corresponding fields*/
+		Matpar   *matpar;
+		Node    **nodes;
+		Element  *element;
 
 		/*inputs and parameters: */
