Index: /issm/trunk/src/c/objects/Constraints/Rgb.cpp
===================================================================
--- /issm/trunk/src/c/objects/Constraints/Rgb.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Constraints/Rgb.cpp	(revision 4248)
@@ -18,5 +18,5 @@
 #include "../objects.h"
 
-/*Object constructors and destructor*/
+/*Rgb constructors and destructor*/
 /*FUNCTION Rgb::constructor {{{1*/
 Rgb::Rgb(){
@@ -42,5 +42,38 @@
 /*}}}1*/
 		
-/*Object marshall*/
+/*Object virtual functions definitions:*/
+/*FUNCTION Rgb::Echo {{{1*/
+void Rgb::Echo(void){
+
+	printf("Rgb:\n");
+	printf("   id: %i\n",id);
+	printf("   nodeid1: %i\n",nodeid1);
+	printf("   nodeid2: %i\n",nodeid2);
+	printf("   dof: %i\n",dof);
+	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
+	return;
+}
+/*}}}1*/
+/*FUNCTION Rgb::DeepEcho {{{1*/
+void Rgb::DeepEcho(void){
+
+	printf("Rgb:\n");
+	printf("   id: %i\n",id);
+	printf("   nodeid1: %i\n",nodeid1);
+	printf("   nodeid2: %i\n",nodeid2);
+	printf("   dof: %i\n",dof);
+	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
+	return;
+}		
+/*}}}1*/
+/*FUNCTION Rgb::Id {{{1*/
+int    Rgb::Id(void){ return id; }
+/*}}}1*/
+/*FUNCTION Rgb::MyRank {{{1*/
+int    Rgb::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}1*/
 /*FUNCTION Rgb::Marshall {{{1*/
 void  Rgb::Marshall(char** pmarshalled_dataset){
@@ -102,35 +135,4 @@
 }
 /*}}}1*/
-
-/*Object functions*/
-/*FUNCTION Rgb::copy {{{1*/
-Object* Rgb::copy() {
-	return new Rgb(*this); 
-}
-/*}}}1*/
-/*FUNCTION Rgb::DeepEcho {{{1*/
-void Rgb::DeepEcho(void){
-
-	printf("Rgb:\n");
-	printf("   id: %i\n",id);
-	printf("   nodeid1: %i\n",nodeid1);
-	printf("   nodeid2: %i\n",nodeid2);
-	printf("   dof: %i\n",dof);
-	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
-	return;
-}		
-/*}}}1*/
-/*FUNCTION Rgb::Echo {{{1*/
-void Rgb::Echo(void){
-
-	printf("Rgb:\n");
-	printf("   id: %i\n",id);
-	printf("   nodeid1: %i\n",nodeid1);
-	printf("   nodeid2: %i\n",nodeid2);
-	printf("   dof: %i\n",dof);
-	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
-	return;
-}
-/*}}}1*/
 /*FUNCTION Rgb::Enum {{{1*/
 int Rgb::Enum(void){
@@ -140,7 +142,11 @@
 }
 /*}}}1*/
-/*FUNCTION Rgb::Id {{{1*/
-int    Rgb::Id(void){ return id; }
+/*FUNCTION Rgb::copy {{{1*/
+Object* Rgb::copy() {
+	return new Rgb(*this); 
+}
 /*}}}1*/
+
+/*Rgb functions*/
 /*FUNCTION Rgb::GetNodeId1{{{1*/
 int   Rgb::GetNodeId1(){
@@ -160,10 +166,4 @@
 }
 /*}}}1*/
-/*FUNCTION Rgb::MyRank {{{1*/
-int    Rgb::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}1*/
 /*FUNCTION Rgb::InAnalysis(int analysis_type){{{1*/
 bool Rgb::InAnalysis(int in_analysis_type){
Index: /issm/trunk/src/c/objects/Constraints/Rgb.h
===================================================================
--- /issm/trunk/src/c/objects/Constraints/Rgb.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Constraints/Rgb.h	(revision 4248)
@@ -23,22 +23,26 @@
 	public:
 
+		/*Rgb constructors, destructors:{{{1*/
 		Rgb();
 		Rgb(int rgb_id,int rgb_nodeid1,int rgb_nodeid2, int rgb_dof,int analysis_type);
 		~Rgb();
-
-		void   Echo();
-		void   DeepEcho();
-		void   Marshall(char** pmarshalled_dataset);
-		int    MarshallSize();
-		void   Demarshall(char** pmarshalled_dataset);
-		int    Enum();
-		int    Id(); 
-		int    MyRank();
-		/*non virtual: */
+		/*}}}*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
+		/*}}}*/
+		/*Rgb management: {{{1*/
 		int    GetNodeId1();
 		int    GetNodeId2();
 		int    GetDof();
-		Object* copy();
-		bool  InAnalysis(int analysis_type);
+		bool   InAnalysis(int analysis_type);
+		/*}}}*/
 
 
Index: /issm/trunk/src/c/objects/Constraints/Spc.cpp
===================================================================
--- /issm/trunk/src/c/objects/Constraints/Spc.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Constraints/Spc.cpp	(revision 4248)
@@ -19,5 +19,5 @@
 
 		
-/*Object constructors and destructor*/
+/*Spc constructors and destructor*/
 /*FUNCTION Spc::constructor {{{1*/
 Spc::Spc(){
@@ -43,5 +43,38 @@
 /*}}}1*/
 		
-/*Object marshall*/
+/*Object virtual functions definitions:*/
+/*FUNCTION Spc::Echo {{{1*/
+void Spc::Echo(void){
+
+	printf("Spc:\n");
+	printf("   sid: %i\n",sid);
+	printf("   nodeid: %i\n",nodeid);
+	printf("   dof: %i\n",dof);
+	printf("   value: %g\n",value);
+	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
+	return;
+}
+/*}}}1*/
+/*FUNCTION Spc::DeepEcho {{{1*/
+void Spc::DeepEcho(void){
+
+	printf("Spc:\n");
+	printf("   sid: %i\n",sid);
+	printf("   nodeid: %i\n",nodeid);
+	printf("   dof: %i\n",dof);
+	printf("   value: %g\n",value);
+	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
+	return;
+}		
+/*}}}1*/
+/*FUNCTION Spc::Id {{{1*/
+int    Spc::Id(void){ return sid; }
+/*}}}1*/
+/*FUNCTION Spc::MyRank {{{1*/
+int    Spc::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}1*/
 /*FUNCTION Spc::Marshall {{{1*/
 void  Spc::Marshall(char** pmarshalled_dataset){
@@ -103,35 +136,4 @@
 }
 /*}}}1*/
-
-/*Object functions*/
-/*FUNCTION Spc::copy {{{1*/
-Object* Spc::copy() {
-	return new Spc(*this); 
-}
-/*}}}1*/
-/*FUNCTION Spc::DeepEcho {{{1*/
-void Spc::DeepEcho(void){
-
-	printf("Spc:\n");
-	printf("   sid: %i\n",sid);
-	printf("   nodeid: %i\n",nodeid);
-	printf("   dof: %i\n",dof);
-	printf("   value: %g\n",value);
-	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
-	return;
-}		
-/*}}}1*/
-/*FUNCTION Spc::Echo {{{1*/
-void Spc::Echo(void){
-
-	printf("Spc:\n");
-	printf("   sid: %i\n",sid);
-	printf("   nodeid: %i\n",nodeid);
-	printf("   dof: %i\n",dof);
-	printf("   value: %g\n",value);
-	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
-	return;
-}
-/*}}}1*/
 /*FUNCTION Spc::Enum {{{1*/
 int Spc::Enum(void){
@@ -141,11 +143,15 @@
 }
 /*}}}1*/
+/*FUNCTION Spc::copy {{{1*/
+Object* Spc::copy() {
+	return new Spc(*this); 
+}
+/*}}}1*/
+
+/*Spc functions*/
 /*FUNCTION Spc::GetDof {{{1*/
 int Spc::GetDof(){
 	return dof;
 }
-/*}}}1*/
-/*FUNCTION Spc::Id {{{1*/
-int    Spc::Id(void){ return sid; }
 /*}}}1*/
 /*FUNCTION Spc::GetNodeId {{{1*/
@@ -160,10 +166,4 @@
 }
 /*}}}1*/
-/*FUNCTION Spc::MyRank {{{1*/
-int    Spc::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}1*/
 /*FUNCTION Spc::InAnalysis(int analysis_type){{{1*/
 bool Spc::InAnalysis(int in_analysis_type){
Index: /issm/trunk/src/c/objects/Constraints/Spc.h
===================================================================
--- /issm/trunk/src/c/objects/Constraints/Spc.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Constraints/Spc.h	(revision 4248)
@@ -23,23 +23,26 @@
 	public:
 
+		/*Spc constructors, destructors:{{{1*/
 		Spc();
 		Spc(int sid,int nodeid, int dof,double value,int analysis_type);
 		~Spc();
-
-		void   Echo();
-		void   DeepEcho();
-		void   Marshall(char** pmarshalled_dataset);
-		int    MarshallSize();
-		void   Demarshall(char** pmarshalled_dataset);
-		int    Enum();
-		int    Id(); 
-		int    MyRank();
+		/*}}}*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
+		/*}}}*/
+		/*Spc management:{{{1 */
 		int    GetNodeId();
 		int    GetDof();
 		double GetValue();
-		Object* copy();
 		bool    InAnalysis(int analysis_type);
-
-
+		/*}}}*/
 
 };
Index: /issm/trunk/src/c/objects/DofIndexing.cpp
===================================================================
--- /issm/trunk/src/c/objects/DofIndexing.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/DofIndexing.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../include/include.h"
 
-/*Object constructors and destructor*/
+/*DofIndexing constructors and destructor*/
 /*FUNCTION DofIndexing::DofIndexing(){{{1*/
 DofIndexing::DofIndexing(){
@@ -60,6 +60,33 @@
 }
 /*}}}*/
+/*FUNCTION DofIndexing::Init{{{1*/
+void DofIndexing::Init(int in_numberofdofs){
 
-/*Object management: */
+	int i;
+	this->numberofdofs=in_numberofdofs;
+	this->clone=0;
+
+	for (i=0;i<MAXDOFSPERNODE;i++){
+		/*assume dof is free, no constraints, no rigid body constraint: */
+		this->m_set[i]=0;
+		this->n_set[i]=1;
+		this->f_set[i]=1;
+		this->s_set[i]=0;
+		this->doflist[i]=UNDEF;
+	}
+}
+/*}}}*/
+
+/*Some of the Object functionality: */
+/*FUNCTION DofIndexing::Echo{{{1*/
+void DofIndexing::Echo(void){
+
+	int i;
+
+	printf("DofIndexing:\n");
+	printf("   numberofdofs: %i\n",numberofdofs);
+	printf("   clone: %i\n",clone);
+}
+/*}}}*/
 /*FUNCTION DofIndexing::DeepEcho{{{1*/
 void DofIndexing::DeepEcho(void){
@@ -112,31 +139,4 @@
 }
 /*}}}*/
-/*FUNCTION DofIndexing::Echo{{{1*/
-void DofIndexing::Echo(void){
-
-	int i;
-
-	printf("DofIndexing:\n");
-	printf("   numberofdofs: %i\n",numberofdofs);
-	printf("   clone: %i\n",clone);
-}
-/*}}}*/
-/*FUNCTION DofIndexing::Init{{{1*/
-void DofIndexing::Init(int in_numberofdofs){
-
-	int i;
-	this->numberofdofs=in_numberofdofs;
-	this->clone=0;
-
-	for (i=0;i<MAXDOFSPERNODE;i++){
-		/*assume dof is free, no constraints, no rigid body constraint: */
-		this->m_set[i]=0;
-		this->n_set[i]=1;
-		this->f_set[i]=1;
-		this->s_set[i]=0;
-		this->doflist[i]=UNDEF;
-	}
-}
-/*}}}*/
 /*FUNCTION DofIndexing::Marshall{{{1*/
 void  DofIndexing::Marshall(char** pmarshalled_dataset){
Index: /issm/trunk/src/c/objects/DofIndexing.h
===================================================================
--- /issm/trunk/src/c/objects/DofIndexing.h	(revision 4247)
+++ /issm/trunk/src/c/objects/DofIndexing.h	(revision 4248)
@@ -26,4 +26,5 @@
 		int     doflist[MAXDOFSPERNODE]; //dof list on which we solve
 
+		/*DofIndexing constructors, destructors {{{1*/
 		DofIndexing();
 		DofIndexing(int numberofdofs);
@@ -31,12 +32,16 @@
 		DofIndexing(DofIndexing* properties);
 		~DofIndexing();
-		
+		/*}}}*/
+		/*Object like functionality: {{{1*/
+		void  Echo(void); 
+		void  DeepEcho(void); 
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		void  copy(DofIndexing* properties);
-		void  Echo(void); 
-		void  DeepEcho(void); 
+		/*}}}*/
+		/*DofIndexing management: {{{1*/
 		DofIndexing* Spawn(int* indices, int numindices);
+		/*}}}*/
 
 };
Index: /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.cpp	(revision 4248)
@@ -18,5 +18,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*BeamVertexElementResult constructors and destructor*/
 /*FUNCTION BeamVertexElementResult::BeamVertexElementResult(){{{1*/
 BeamVertexElementResult::BeamVertexElementResult(){
@@ -40,10 +40,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION BeamVertexElementResult::copy{{{1*/
-Object* BeamVertexElementResult::copy() {
-	
-	return new BeamVertexElementResult(this->enum_type,this->values,this->step,this->time);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION BeamVertexElementResult::Echo {{{1*/
+void BeamVertexElementResult::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -59,46 +57,12 @@
 }
 /*}}}*/
-/*FUNCTION BeamVertexElementResult::Demarshall{{{1*/
-void  BeamVertexElementResult::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
-	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION BeamVertexElementResult::Echo {{{1*/
-void BeamVertexElementResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION BeamVertexElementResult::Enum{{{1*/
-int BeamVertexElementResult::Enum(void){
-
-	return BeamVertexElementResultEnum;
-
-}
-/*}}}*/
-/*FUNCTION BeamVertexElementResult::EnumType{{{1*/
-int BeamVertexElementResult::EnumType(void){
-
-	return this->enum_type;
-
-}
-/*}}}*/
 /*FUNCTION BeamVertexElementResult::Id{{{1*/
 int    BeamVertexElementResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION BeamVertexElementResult::MyRank{{{1*/
+int    BeamVertexElementResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION BeamVertexElementResult::Marshall{{{1*/
@@ -136,12 +100,49 @@
 }
 /*}}}*/
-/*FUNCTION BeamVertexElementResult::MyRank{{{1*/
-int    BeamVertexElementResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
+/*FUNCTION BeamVertexElementResult::Demarshall{{{1*/
+void  BeamVertexElementResult::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
+	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
+	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION BeamVertexElementResult::Enum{{{1*/
+int BeamVertexElementResult::Enum(void){
+
+	return BeamVertexElementResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION BeamVertexElementResult::copy{{{1*/
+Object* BeamVertexElementResult::copy() {
+	
+	return new BeamVertexElementResult(this->enum_type,this->values,this->step,this->time);
+
 }
 /*}}}*/
 
-/*ElementResult functions*/
+
+/*ElementResult management*/
+/*FUNCTION BeamVertexElementResult::EnumType{{{1*/
+int BeamVertexElementResult::EnumType(void){
+
+	return this->enum_type;
+
+}
+/*}}}*/
 /*FUNCTION BeamVertexElementResult::ProcessUnits(Parameters* parameters){{{1*/
 void BeamVertexElementResult::ProcessUnits(Parameters* parameters){
Index: /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.h	(revision 4248)
@@ -23,22 +23,21 @@
 	public:
 
-		/*constructors, destructors: {{{1*/
+		/*BeamVertexElementResult constructors, destructors: {{{1*/
 		BeamVertexElementResult();
 		BeamVertexElementResult(int enum_type,double* values,int step,double time);
 		~BeamVertexElementResult();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
-		int   EnumType();
 		/*}}}*/
-		/*result virtual functions: {{{1*/
+		/*ElementResult virtual functions definitions: {{{1*/
 		ElementResult* SpawnSingElementResult(int  index){ISSMERROR("Not implemented yet!");}
 		ElementResult* SpawnBeamElementResult(int* indices){ISSMERROR("Not implemented yet!");}
@@ -48,4 +47,7 @@
 		void    PatchFill(int row, Patch* patch);
 		/*}}}*/
+		/*BeamVertexElementResult management: {{{1*/
+		int   EnumType();
+		/*}}}*/
 
 };
Index: /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp	(revision 4248)
@@ -18,5 +18,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*DoubleElementResult constructors and destructor*/
 /*FUNCTION DoubleElementResult::DoubleElementResult(){{{1*/
 DoubleElementResult::DoubleElementResult(){
@@ -39,10 +39,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION DoubleElementResult::copy{{{1*/
-Object* DoubleElementResult::copy() {
-
-	return new DoubleElementResult(this->enum_type,this->value,this->step,this->time);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION DoubleElementResult::Echo {{{1*/
+void DoubleElementResult::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -55,4 +53,37 @@
 	printf("   step: %i\n",this->step);
 	printf("   time: %g\n",this->time);
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::Id{{{1*/
+int    DoubleElementResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION DoubleElementResult::MyRank{{{1*/
+int    DoubleElementResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::Marshall{{{1*/
+void  DoubleElementResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of DoubleElementResult: */
+	enum_value=DoubleElementResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall DoubleElementResult data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
+	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
+	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
+
+	*pmarshalled_dataset=marshalled_dataset;
 }
 /*}}}*/
@@ -78,9 +109,4 @@
 }
 /*}}}*/
-/*FUNCTION DoubleElementResult::Echo {{{1*/
-void DoubleElementResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION DoubleElementResult::Enum{{{1*/
 int DoubleElementResult::Enum(void){
@@ -90,38 +116,13 @@
 }
 /*}}}*/
-/*FUNCTION DoubleElementResult::EnumType{{{1*/
-int DoubleElementResult::EnumType(void){
-
-	return this->enum_type;
-
-}
-/*}}}*/
-/*FUNCTION DoubleElementResult::Id{{{1*/
-int    DoubleElementResult::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION DoubleElementResult::Marshall{{{1*/
-void  DoubleElementResult::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of DoubleElementResult: */
-	enum_value=DoubleElementResultEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall DoubleElementResult data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
+/*FUNCTION DoubleElementResult::copy{{{1*/
+Object* DoubleElementResult::copy() {
+
+	return new DoubleElementResult(this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+
+/*ElementResult management*/
 /*FUNCTION DoubleElementResult::MarshallSize{{{1*/
 int   DoubleElementResult::MarshallSize(){
@@ -134,12 +135,11 @@
 }
 /*}}}*/
-/*FUNCTION DoubleElementResult::MyRank{{{1*/
-int    DoubleElementResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*ElementResult functions*/
+/*FUNCTION DoubleElementResult::EnumType{{{1*/
+int DoubleElementResult::EnumType(void){
+
+	return this->enum_type;
+
+}
+/*}}}*/
 /*FUNCTION DoubleElementResult::SpawnSingElementResult{{{1*/
 ElementResult* DoubleElementResult::SpawnSingElementResult(int index){
Index: /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h	(revision 4248)
@@ -25,22 +25,21 @@
 	public:
 
-		/*constructors, destructors: {{{1*/
+		/*DoubleElementResult constructors, destructors: {{{1*/
 		DoubleElementResult();
 		DoubleElementResult(int enum_type,double value,int step,double time);
 		~DoubleElementResult();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
-		int   EnumType();
 		/*}}}*/
-		/*result virtual functions: {{{1*/
+		/*ElementResult virtual functions definitions: {{{1*/
 		ElementResult* SpawnSingElementResult(int  index);
 		ElementResult* SpawnBeamElementResult(int* indices);
@@ -50,5 +49,7 @@
 		void    PatchFill(int row, Patch* patch);
 		/*}}}*/
-
+		/*DoubleElementResult management: {{{1*/
+		int   EnumType();
+		/*}}}*/
 };
 #endif  /* _DOUBLEELEMENTRESULT_H */
Index: /issm/trunk/src/c/objects/ElementResults/ElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/ElementResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/ElementResult.h	(revision 4248)
@@ -18,9 +18,7 @@
 		virtual        ~ElementResult(){};
 		
-		virtual void Echo(void)=0;
-
-		virtual ElementResult* SpawnSingElementResult(int  index)=0;
-		virtual ElementResult* SpawnBeamElementResult(int* indices)=0;
-		virtual ElementResult* SpawnTriaElementResult(int* indices)=0;
+		virtual         ElementResult* SpawnSingElementResult(int  index)=0;
+		virtual         ElementResult* SpawnBeamElementResult(int* indices)=0;
+		virtual         ElementResult* SpawnTriaElementResult(int* indices)=0;
 		virtual void    ProcessUnits(Parameters* parameters)=0;
 		virtual int     NumberOfNodalValues(void)=0;
Index: /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp	(revision 4248)
@@ -18,5 +18,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*PentaVertexElementResult constructors and destructor*/
 /*FUNCTION PentaVertexElementResult::PentaVertexElementResult(){{{1*/
 PentaVertexElementResult::PentaVertexElementResult(){
@@ -41,10 +41,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION PentaVertexElementResult::copy{{{1*/
-Object* PentaVertexElementResult::copy() {
-	
-	return new PentaVertexElementResult(this->enum_type,this->values,this->step,this->time);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION PentaVertexElementResult::Echo {{{1*/
+void PentaVertexElementResult::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -58,4 +56,47 @@
 	printf("   time: %g\n",this->time);
 
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::Id{{{1*/
+int    PentaVertexElementResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::MyRank{{{1*/
+int    PentaVertexElementResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::Marshall{{{1*/
+void  PentaVertexElementResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of PentaVertexElementResult: */
+	enum_value=PentaVertexElementResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall PentaVertexElementResult data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
+	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
+	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::MarshallSize{{{1*/
+int   PentaVertexElementResult::MarshallSize(){
+	
+	return sizeof(values)+
+		+sizeof(enum_type)
+		+sizeof(time)
+		+sizeof(step)
+		+sizeof(int); //sizeof(int) for enum value
 }
 /*}}}*/
@@ -81,9 +122,4 @@
 }
 /*}}}*/
-/*FUNCTION PentaVertexElementResult::Echo {{{1*/
-void PentaVertexElementResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION PentaVertexElementResult::Enum{{{1*/
 int PentaVertexElementResult::Enum(void){
@@ -93,4 +129,14 @@
 }
 /*}}}*/
+/*FUNCTION PentaVertexElementResult::copy{{{1*/
+Object* PentaVertexElementResult::copy() {
+	
+	return new PentaVertexElementResult(this->enum_type,this->values,this->step,this->time);
+
+}
+/*}}}*/
+
+
+/*ElementResult management*/
 /*FUNCTION PentaVertexElementResult::EnumType{{{1*/
 int PentaVertexElementResult::EnumType(void){
@@ -100,49 +146,4 @@
 }
 /*}}}*/
-/*FUNCTION PentaVertexElementResult::Id{{{1*/
-int    PentaVertexElementResult::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::Marshall{{{1*/
-void  PentaVertexElementResult::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of PentaVertexElementResult: */
-	enum_value=PentaVertexElementResultEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall PentaVertexElementResult data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
-	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::MarshallSize{{{1*/
-int   PentaVertexElementResult::MarshallSize(){
-	
-	return sizeof(values)+
-		+sizeof(enum_type)
-		+sizeof(time)
-		+sizeof(step)
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::MyRank{{{1*/
-int    PentaVertexElementResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*ElementResult functions*/
 /*FUNCTION PentaVertexElementResult::SpawnSingElementResult{{{1*/
 ElementResult* PentaVertexElementResult::SpawnSingElementResult(int index){
Index: /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h	(revision 4248)
@@ -24,22 +24,21 @@
 	public:
 
-		/*constructors, destructors: {{{1*/
+		/*PentaVertexElementResult constructors, destructors: {{{1*/
 		PentaVertexElementResult();
 		PentaVertexElementResult(int enum_type,double* values,int step, double time);
 		~PentaVertexElementResult();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
-		int   EnumType();
 		/*}}}*/
-		/*result virtual functions: {{{1*/
+		/*ElementResult virtual functions definitions: {{{1*/
 		ElementResult* SpawnSingElementResult(int  index);
 		ElementResult* SpawnBeamElementResult(int* indices);
@@ -49,4 +48,7 @@
 		void    PatchFill(int row, Patch* patch);
 		/*}}}*/
+		/*PentaVertexElementResult management: {{{1*/
+		int   EnumType();
+		/*}}}*/
 
 };
Index: /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.cpp	(revision 4248)
@@ -18,5 +18,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*SingVertexElementResult constructors and destructor*/
 /*FUNCTION SingVertexElementResult::SingVertexElementResult(){{{1*/
 SingVertexElementResult::SingVertexElementResult(){
@@ -39,10 +39,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION SingVertexElementResult::copy{{{1*/
-Object* SingVertexElementResult::copy() {
-	
-	return new SingVertexElementResult(this->enum_type,this->value,this->step,this->time);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION SingVertexElementResult::Echo {{{1*/
+void SingVertexElementResult::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -58,46 +56,12 @@
 }
 /*}}}*/
-/*FUNCTION SingVertexElementResult::Demarshall{{{1*/
-void  SingVertexElementResult::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION SingVertexElementResult::Echo {{{1*/
-void SingVertexElementResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION SingVertexElementResult::Enum{{{1*/
-int SingVertexElementResult::Enum(void){
-
-	return SingVertexElementResultEnum;
-
-}
-/*}}}*/
-/*FUNCTION SingVertexElementResult::EnumType{{{1*/
-int SingVertexElementResult::EnumType(void){
-
-	return this->enum_type;
-
-}
-/*}}}*/
 /*FUNCTION SingVertexElementResult::Id{{{1*/
 int    SingVertexElementResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION SingVertexElementResult::MyRank{{{1*/
+int    SingVertexElementResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION SingVertexElementResult::Marshall{{{1*/
@@ -135,12 +99,41 @@
 }
 /*}}}*/
-/*FUNCTION SingVertexElementResult::MyRank{{{1*/
-int    SingVertexElementResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
+/*FUNCTION SingVertexElementResult::Demarshall{{{1*/
+void  SingVertexElementResult::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
+	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
+	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION SingVertexElementResult::Enum{{{1*/
+int SingVertexElementResult::Enum(void){
+
+	return SingVertexElementResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION SingVertexElementResult::copy{{{1*/
+Object* SingVertexElementResult::copy() {
+	
+	return new SingVertexElementResult(this->enum_type,this->value,this->step,this->time);
+
 }
 /*}}}*/
 
-/*ElementResult functions*/
+/*ElementResult virtual functions definitions*/
 /*FUNCTION SingVertexElementResult::ProcessUnits(Parameters* parameters){{{1*/
 void SingVertexElementResult::ProcessUnits(Parameters* parameters){
@@ -165,2 +158,11 @@
 }
 /*}}}*/
+
+/*SingVertexElementResult management:*/
+/*FUNCTION SingVertexElementResult::EnumType{{{1*/
+int SingVertexElementResult::EnumType(void){
+
+	return this->enum_type;
+
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.h	(revision 4248)
@@ -23,22 +23,21 @@
 	public:
 
-		/*constructors, destructors: {{{1*/
+		/*SingVertexElementResult constructors, destructors: {{{1*/
 		SingVertexElementResult();
 		SingVertexElementResult(int enum_type,double value,int step,double time);
 		~SingVertexElementResult();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
-		int   EnumType();
 		/*}}}*/
-		/*result virtual functions: {{{1*/
+		/*ElementResult virtual functions definitions: {{{1*/
 		ElementResult* SpawnSingElementResult(int  index){ISSMERROR("Not implemented yet!");}
 		ElementResult* SpawnBeamElementResult(int* indices){ISSMERROR("Not implemented yet!");}
@@ -48,4 +47,7 @@
 		void    PatchFill(int row, Patch* patch);
 		/*}}}*/
+		/*SingVertexElementResult management: {{{1*/
+		int   EnumType();
+		/*}}}*/
 
 };
Index: /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp	(revision 4248)
@@ -18,5 +18,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*TriaVertexElementResult constructors and destructor*/
 /*FUNCTION TriaVertexElementResult::TriaVertexElementResult(){{{1*/
 TriaVertexElementResult::TriaVertexElementResult(){
@@ -41,10 +41,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION TriaVertexElementResult::copy{{{1*/
-Object* TriaVertexElementResult::copy() {
-	
-	return new TriaVertexElementResult(this->enum_type,this->values,this->step,this->time);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION TriaVertexElementResult::Echo {{{1*/
+void TriaVertexElementResult::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -59,4 +57,48 @@
 }
 /*}}}*/
+/*FUNCTION TriaVertexElementResult::Id{{{1*/
+int    TriaVertexElementResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::MyRank{{{1*/
+int    TriaVertexElementResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::Marshall{{{1*/
+void  TriaVertexElementResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of TriaVertexElementResult: */
+	enum_value=TriaVertexElementResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall TriaVertexElementResult data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
+	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
+	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::MarshallSize{{{1*/
+int   TriaVertexElementResult::MarshallSize(){
+	
+	return sizeof(values)
+		+sizeof(enum_type)
+		+sizeof(time)
+		+sizeof(step)
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
 /*FUNCTION TriaVertexElementResult::Demarshall{{{1*/
 void  TriaVertexElementResult::Demarshall(char** pmarshalled_dataset){
@@ -80,9 +122,4 @@
 }
 /*}}}*/
-/*FUNCTION TriaVertexElementResult::Echo {{{1*/
-void TriaVertexElementResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION TriaVertexElementResult::Enum{{{1*/
 int TriaVertexElementResult::Enum(void){
@@ -92,4 +129,14 @@
 }
 /*}}}*/
+/*FUNCTION TriaVertexElementResult::copy{{{1*/
+Object* TriaVertexElementResult::copy() {
+	
+	return new TriaVertexElementResult(this->enum_type,this->values,this->step,this->time);
+
+}
+/*}}}*/
+
+
+/*ElementResult management*/
 /*FUNCTION TriaVertexElementResult::EnumType{{{1*/
 int TriaVertexElementResult::EnumType(void){
@@ -99,50 +146,4 @@
 }
 /*}}}*/
-/*FUNCTION TriaVertexElementResult::Id{{{1*/
-int    TriaVertexElementResult::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::Marshall{{{1*/
-void  TriaVertexElementResult::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of TriaVertexElementResult: */
-	enum_value=TriaVertexElementResultEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall TriaVertexElementResult data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
-	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::MarshallSize{{{1*/
-int   TriaVertexElementResult::MarshallSize(){
-	
-	return sizeof(values)
-		+sizeof(enum_type)
-		+sizeof(time)
-		+sizeof(step)
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::MyRank{{{1*/
-int    TriaVertexElementResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*ElementResult functions*/
 /*FUNCTION TriaVertexElementResult::SpawnSingElementResult{{{1*/
 ElementResult* TriaVertexElementResult::SpawnSingElementResult(int index){
Index: /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h	(revision 4248)
@@ -23,22 +23,21 @@
 	public:
 
-		/*constructors, destructors: {{{1*/
+		/*TriaVertexElementResult constructors, destructors: {{{1*/
 		TriaVertexElementResult();
 		TriaVertexElementResult(int enum_type,double* values,int step,double time);
 		~TriaVertexElementResult();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
-		int   EnumType();
 		/*}}}*/
-		/*result virtual functions: {{{1*/
+		/*ElementResult virtual functions definitions: {{{1*/
 		ElementResult* SpawnSingElementResult(int  index);
 		ElementResult* SpawnBeamElementResult(int* indices);
@@ -48,4 +47,7 @@
 		void    PatchFill(int row, Patch* patch);
 		/*}}}*/
+		/*TriaVertexElementResult management: {{{1*/
+		int   EnumType();
+		/*}}}*/
 
 };
Index: /issm/trunk/src/c/objects/Elements/Beam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Beam.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Elements/Beam.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*Beam constructors and destructor*/
 /*FUNCTION Beam::Beam(){{{1*/
 Beam::Beam(){
@@ -37,40 +37,5 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION Beam::copy{{{1*/
-Object* Beam::copy() {
-
-	int i;
-	Beam* beam=NULL;
-
-	beam=new Beam();
-
-	/*copy fields: */
-	beam->id=this->id;
-	if(this->inputs){
-		beam->inputs=(Inputs*)this->inputs->Copy();
-	}
-	else{
-		beam->inputs=new Inputs();
-	}
-	/*point parameters: */
-	beam->parameters=this->parameters;
-
-	/*pointers: */
-	beam->nodes=(Node**)xmalloc(2*sizeof(Node*)); 
-	for(i=0;i<2;i++)beam->nodes[i]=this->nodes[i];
-	beam->matice=this->matice;
-	beam->matpar=this->matpar;
-
-	return beam;
-}
-/*}}}*/
-/*FUNCTION Beam::Configure {{{1*/
-void  Beam::Configure(Elements* elementsin,Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
-
-	ISSMERROR(" not supported yet!");
-
-}
-/*}}}*/
+/*Object virtual functions definitions: */
 /*FUNCTION Beam::DeepEcho{{{1*/
 void Beam::DeepEcho(void){
@@ -93,7 +58,70 @@
 }
 /*}}}*/
+/*FUNCTION Beam::Id{{{1*/
+int    Beam::Id(void){ return id; }
+/*}}}*/
+/*FUNCTION Beam::MyRank{{{1*/
+int    Beam::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION Beam::Marshall{{{1*/
+void  Beam::Marshall(char** pmarshalled_dataset){
+	ISSMERROR("not supported yet!");
+}
+/*}}}*/
+/*FUNCTION Beam::MarshallSize{{{1*/
+int   Beam::MarshallSize(){
+	ISSMERROR("not supported yet!");
+}
+/*}}}*/
 /*FUNCTION Beam::Demarshall{{{1*/
 void  Beam::Demarshall(char** pmarshalled_dataset){
 	ISSMERROR("not supported yet!");
+}
+/*}}}*/
+/*FUNCTION Beam::Enum{{{1*/
+int Beam::Enum(void){
+
+	return BeamEnum;
+
+}
+/*}}}*/
+/*FUNCTION Beam::copy{{{1*/
+Object* Beam::copy() {
+
+	int i;
+	Beam* beam=NULL;
+
+	beam=new Beam();
+
+	/*copy fields: */
+	beam->id=this->id;
+	if(this->inputs){
+		beam->inputs=(Inputs*)this->inputs->Copy();
+	}
+	else{
+		beam->inputs=new Inputs();
+	}
+	/*point parameters: */
+	beam->parameters=this->parameters;
+
+	/*pointers: */
+	beam->nodes=(Node**)xmalloc(2*sizeof(Node*)); 
+	for(i=0;i<2;i++)beam->nodes[i]=this->nodes[i];
+	beam->matice=this->matice;
+	beam->matpar=this->matpar;
+
+	return beam;
+}
+/*}}}*/
+
+/*Beam management*/
+/*FUNCTION Beam::Configure {{{1*/
+void  Beam::Configure(Elements* elementsin,Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
+
+	ISSMERROR(" not supported yet!");
+
 }
 /*}}}*/
@@ -125,14 +153,4 @@
 	}
 	else return false;
-}
-/*}}}*/
-/*FUNCTION Beam::Marshall{{{1*/
-void  Beam::Marshall(char** pmarshalled_dataset){
-	ISSMERROR("not supported yet!");
-}
-/*}}}*/
-/*FUNCTION Beam::MarshallSize{{{1*/
-int   Beam::MarshallSize(){
-	ISSMERROR("not supported yet!");
 }
 /*}}}*/
@@ -442,11 +460,4 @@
 }
 /*}}}*/
-/*FUNCTION Beam::Enum{{{1*/
-int Beam::Enum(void){
-
-	return BeamEnum;
-
-}
-/*}}}*/
 /*FUNCTION Beam::GetBedList{{{1*/
 void  Beam::GetBedList(double*){
@@ -483,7 +494,4 @@
 }
 /*}}}*/
-/*FUNCTION Beam::Id{{{1*/
-int    Beam::Id(void){ return id; }
-/*}}}*/
 /*FUNCTION Beam::GetJacobianDeterminant{{{1*/
 void Beam::GetJacobianDeterminant(double* pJdet,double* z_list, double gauss_coord){
@@ -580,10 +588,4 @@
 double Beam::Misfit(void){
 	ISSMERROR(" not supported yet!");
-}
-/*}}}*/
-/*FUNCTION Beam::MyRank{{{1*/
-int    Beam::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Elements/Beam.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Beam.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Elements/Beam.h	(revision 4248)
@@ -37,5 +37,5 @@
 	
 
-		/*constructors, destructors: {{{1*/
+		/*Beam constructors and destructor: {{{1*/
 		Beam();
 		~Beam();
@@ -43,16 +43,18 @@
 		void  UpdateGeometry(void){ISSMERROR("not implemented yet");};
 		/*}}}*/
-		/*Object virtual functions resolution: {{{1*/
-		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+		/*Object virtual functions definitions: {{{1*/
 		void  Echo();
 		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   Id(); 
+		Object* copy();
+		/*}}}*/
+		/*Beam management: {{{1*/
+		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
 		bool  IsInput(int name);
-		int   MyRank();
-		Object* copy();
 		void  SetClone(int* minranks);
 		void  InputDepthAverageAtBase(int enum_type,int average_enum_type){ISSMERROR("not implemented yet");};
Index: /issm/trunk/src/c/objects/Elements/Element.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Element.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Elements/Element.h	(revision 4248)
@@ -25,6 +25,6 @@
 		
 		virtual        ~Element(){};
+	
 		virtual void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
-		
 		virtual void   CreateKMatrix(Mat Kgg)=0;
 		virtual void   CreatePVector(Vec pg)=0;
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*Penta constructors and destructor*/
 /*FUNCTION Penta::Penta(){{{1*/
 Penta::Penta(){
@@ -229,118 +229,10 @@
 }
 /*}}}*/
-/*FUNCTION Penta::copy {{{1*/
-Object* Penta::copy() {
-
-	int i;
-
-	Penta* penta=NULL;
-
-	penta=new Penta();
-
-	/*copy fields: */
-	penta->id=this->id;
-	if(this->inputs){
-		penta->inputs=(Inputs*)this->inputs->Copy();
-	}
-	else{
-		penta->inputs=new Inputs();
-	}
-	if(this->results){
-		penta->results=(Results*)this->results->Copy();
-	}
-	else{
-		penta->results=new Results();
-	}
-	/*point parameters: */
-	penta->parameters=this->parameters;
-
-	/*now deal with hooks and objects: */
-	penta->InitHookNodes(this->numanalyses);
-	for(i=0;i<this->numanalyses;i++)penta->hnodes[i].copy(&this->hnodes[i]);
-	penta->hmatice.copy(&this->hmatice);
-	penta->hmatpar.copy(&this->hmatpar);
-	penta->hneighbors.copy(&this->hneighbors);
-
-	/*recover objects: */
-	penta->nodes=(Node**)xmalloc(6*sizeof(Node*)); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
-	for(i=0;i<6;i++)penta->nodes[i]=this->nodes[i];
-	penta->matice=(Matice*)penta->hmatice.delivers();
-	penta->matpar=(Matpar*)penta->hmatpar.delivers();
-	penta->neighbors=(Penta**)penta->hneighbors.deliverp();
-
-	return penta;
-}
-/*}}}*/
-
-/*Object management: */
-/*FUNCTION Penta::Configure {{{1*/
-void  Penta::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
-
-	int analysis_counter;
-	
-	/*go into parameters and get the analysis_counter: */
-	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
-
-	/*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: */
-	this->hnodes[analysis_counter].configure(nodesin);
-	this->hmatice.configure(materialsin);
-	this->hmatpar.configure(materialsin);
-	this->hneighbors.configure(elementsin);
-
-	/*Now, go pick up the objects inside the hooks: */
-	this->nodes=(Node**)this->hnodes[analysis_counter].deliverp();
-	this->matice=(Matice*)this->hmatice.delivers();
-	this->matpar=(Matpar*)this->hmatpar.delivers();
-	this->neighbors=(Penta**)this->hneighbors.deliverp();
-
-	/*point parameters to real dataset: */
-	this->parameters=parametersin;
-}
-/*}}}*/
-/*FUNCTION Penta::Demarshall {{{1*/
-void  Penta::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
-
-	/*allocate dynamic memory: */
-	collapse=(bool*)xmalloc(numanalyses*sizeof(bool));
-	InitHookNodes(numanalyses);
-
-	/*demarshall hooks: */
-	for(i=0;i<numanalyses;i++)hnodes[i].Demarshall(&marshalled_dataset);
-	hmatice.Demarshall(&marshalled_dataset);
-	hmatpar.Demarshall(&marshalled_dataset);
-	hneighbors.Demarshall(&marshalled_dataset);
-
-	/*pointers are garbage, until configuration is carried out: */
-	nodes=NULL;
-	matice=NULL;
-	matpar=NULL;
-	neighbors=NULL;
-	
-	/*demarshall inputs and results: */
-	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
-	results=(Results*)DataSetDemarshallRaw(&marshalled_dataset); 
-
-	/*demarshall internal parameters: */
-	memcpy(collapse,marshalled_dataset,numanalyses*sizeof(bool));marshalled_dataset+=numanalyses*sizeof(bool);
-
-	/*parameters: may not exist even yet, so let Configure handle it: */
-	this->parameters=NULL;
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
+
+/*Object virtual functions definitions: */
+/*FUNCTION Penta::Echo{{{1*/
+
+void Penta::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -372,15 +264,13 @@
 }
 /*}}}*/
-/*FUNCTION Penta::Echo{{{1*/
-
-void Penta::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION Penta::Enum {{{1*/
-int Penta::Enum(void){
-
-	return PentaEnum;
-
+/*FUNCTION Penta::Id {{{1*/
+int    Penta::Id(void){
+	return id; 
+}
+/*}}}*/
+/*FUNCTION Penta::MyRank {{{1*/
+int    Penta::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
 }
 /*}}}*/
@@ -455,4 +345,128 @@
 		+numanalyses*sizeof(bool)
 		+sizeof(int); //sizeof(int) for enum type
+}
+/*}}}*/
+/*FUNCTION Penta::Demarshall {{{1*/
+void  Penta::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
+
+	/*allocate dynamic memory: */
+	collapse=(bool*)xmalloc(numanalyses*sizeof(bool));
+	InitHookNodes(numanalyses);
+
+	/*demarshall hooks: */
+	for(i=0;i<numanalyses;i++)hnodes[i].Demarshall(&marshalled_dataset);
+	hmatice.Demarshall(&marshalled_dataset);
+	hmatpar.Demarshall(&marshalled_dataset);
+	hneighbors.Demarshall(&marshalled_dataset);
+
+	/*pointers are garbage, until configuration is carried out: */
+	nodes=NULL;
+	matice=NULL;
+	matpar=NULL;
+	neighbors=NULL;
+	
+	/*demarshall inputs and results: */
+	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
+	results=(Results*)DataSetDemarshallRaw(&marshalled_dataset); 
+
+	/*demarshall internal parameters: */
+	memcpy(collapse,marshalled_dataset,numanalyses*sizeof(bool));marshalled_dataset+=numanalyses*sizeof(bool);
+
+	/*parameters: may not exist even yet, so let Configure handle it: */
+	this->parameters=NULL;
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION Penta::Enum {{{1*/
+int Penta::Enum(void){
+
+	return PentaEnum;
+
+}
+/*}}}*/
+/*FUNCTION Penta::copy {{{1*/
+Object* Penta::copy() {
+
+	int i;
+
+	Penta* penta=NULL;
+
+	penta=new Penta();
+
+	/*copy fields: */
+	penta->id=this->id;
+	if(this->inputs){
+		penta->inputs=(Inputs*)this->inputs->Copy();
+	}
+	else{
+		penta->inputs=new Inputs();
+	}
+	if(this->results){
+		penta->results=(Results*)this->results->Copy();
+	}
+	else{
+		penta->results=new Results();
+	}
+	/*point parameters: */
+	penta->parameters=this->parameters;
+
+	/*now deal with hooks and objects: */
+	penta->InitHookNodes(this->numanalyses);
+	for(i=0;i<this->numanalyses;i++)penta->hnodes[i].copy(&this->hnodes[i]);
+	penta->hmatice.copy(&this->hmatice);
+	penta->hmatpar.copy(&this->hmatpar);
+	penta->hneighbors.copy(&this->hneighbors);
+
+	/*recover objects: */
+	penta->nodes=(Node**)xmalloc(6*sizeof(Node*)); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
+	for(i=0;i<6;i++)penta->nodes[i]=this->nodes[i];
+	penta->matice=(Matice*)penta->hmatice.delivers();
+	penta->matpar=(Matpar*)penta->hmatpar.delivers();
+	penta->neighbors=(Penta**)penta->hneighbors.deliverp();
+
+	return penta;
+}
+/*}}}*/
+
+
+/*Penta functionality: */
+		/*FUNCTION Penta::Configure {{{1*/
+void  Penta::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
+
+	int analysis_counter;
+	
+	/*go into parameters and get the analysis_counter: */
+	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
+
+	/*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: */
+	this->hnodes[analysis_counter].configure(nodesin);
+	this->hmatice.configure(materialsin);
+	this->hmatpar.configure(materialsin);
+	this->hneighbors.configure(elementsin);
+
+	/*Now, go pick up the objects inside the hooks: */
+	this->nodes=(Node**)this->hnodes[analysis_counter].deliverp();
+	this->matice=(Matice*)this->hmatice.delivers();
+	this->matpar=(Matpar*)this->hmatpar.delivers();
+	this->neighbors=(Penta**)this->hneighbors.deliverp();
+
+	/*point parameters to real dataset: */
+	this->parameters=parametersin;
 }
 /*}}}*/
@@ -3820,9 +3834,4 @@
 	}
 
-}
-/*}}}*/
-/*FUNCTION Penta::Id {{{1*/
-int    Penta::Id(void){
-	return id; 
 }
 /*}}}*/
@@ -4643,10 +4652,4 @@
 }
 /*}}}*/
-/*FUNCTION Penta::MyRank {{{1*/
-int    Penta::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
 /*FUNCTION Penta::ReduceMatrixStokes {{{1*/
 void Penta::ReduceMatrixStokes(double* Ke_reduced, double* Ke_temp){
Index: /issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Elements/Penta.h	(revision 4248)
@@ -41,5 +41,5 @@
 		bool        *collapse; //collapse elements, depending on analysis_type
 
-		/*FUNCTION constructors, destructors {{{1*/
+		/*Penta constructors and destructor: {{{1*/
 		Penta();
 		Penta(int penta_id,int i, IoModel* iomodel,int nummodels);
@@ -48,18 +48,20 @@
 		~Penta();
 		/*}}}*/
-		/*Object virtual functions resolution: {{{1*/
+		/*Object virtual functions definitions: {{{1*/
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
+		/*}}}*/
+		/*Penta management: {{{1*/
 		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
-		Object* copy();
-		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id(); 
 		bool  IsInput(int name);
 		bool  IsOnSurface(void);
 		Penta* GetUpperElement(void);
-		void  Marshall(char** pmarshalled_dataset);
-		int   MarshallSize();
-		int   MyRank();
 		void* SpawnSing(int g0);
 		void* SpawnBeam(int g0, int g1);
Index: /issm/trunk/src/c/objects/Elements/Sing.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Sing.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Elements/Sing.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*Sing constructors and destructor*/
 /*FUNCTION Sing::Sing(){{{1*/
 Sing::Sing(){
@@ -37,37 +37,18 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION Sing::Configure {{{1*/
-void  Sing::Configure(Elements* elementsin,Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
-
-	ISSMERROR(" not supported yet!");
-
-}
-/*}}}*/
-/*FUNCTION Sing::copy {{{1*/
-Object* Sing::copy() {
-
-	int i;
-	Sing* sing=NULL;
-
-	sing=new Sing();
-
-	/*copy fields: */
-	sing->id=this->id;
-	if(this->inputs){
-		sing->inputs=(Inputs*)this->inputs->Copy();
-	}
-	else{
-		sing->inputs=new Inputs();
-	}
-	/*point parameters: */
-	sing->parameters=this->parameters;
-
-	/*pointers: */
-	sing->node=this->node;
-	sing->matice=this->matice;
-	sing->matpar=this->matpar;
-
-	return sing;
+/*Object virtual functions definitions: */
+/*FUNCTION Sing::Echo{{{1*/
+
+void Sing::Echo(void){
+
+	printf("Sing:\n");
+	printf("   id: %i\n",id);
+	node->Echo();
+	matice->Echo();
+	matpar->Echo();
+	printf("   parameters\n");
+	parameters->Echo();
+	printf("   inputs\n");
+	inputs->Echo();
 }
 /*}}}*/
@@ -88,4 +69,23 @@
 }
 /*}}}*/
+/*FUNCTION Sing::Id {{{1*/
+int    Sing::Id(void){ return id; }
+/*}}}*/
+/*FUNCTION Sing::MyRank {{{1*/
+int    Sing::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION Sing::Marshall {{{1*/
+void  Sing::Marshall(char** pmarshalled_dataset){
+	ISSMERROR(" not supported yet!");
+}
+/*}}}*/
+/*FUNCTION Sing::MashallSize {{{1*/
+int   Sing::MarshallSize(){
+	ISSMERROR(" not supported yet!");
+}
+/*}}}*/
 /*FUNCTION Sing::Demarshall {{{1*/
 void  Sing::Demarshall(char** pmarshalled_dataset){
@@ -93,17 +93,45 @@
 }
 /*}}}*/
-/*FUNCTION Sing::Echo{{{1*/
-
-void Sing::Echo(void){
-
-	printf("Sing:\n");
-	printf("   id: %i\n",id);
-	node->Echo();
-	matice->Echo();
-	matpar->Echo();
-	printf("   parameters\n");
-	parameters->Echo();
-	printf("   inputs\n");
-	inputs->Echo();
+/*FUNCTION Sing::Enum {{{1*/
+int Sing::Enum(void){
+
+	return SingEnum;
+
+}
+/*}}}*/
+/*FUNCTION Sing::copy {{{1*/
+Object* Sing::copy() {
+
+	int i;
+	Sing* sing=NULL;
+
+	sing=new Sing();
+
+	/*copy fields: */
+	sing->id=this->id;
+	if(this->inputs){
+		sing->inputs=(Inputs*)this->inputs->Copy();
+	}
+	else{
+		sing->inputs=new Inputs();
+	}
+	/*point parameters: */
+	sing->parameters=this->parameters;
+
+	/*pointers: */
+	sing->node=this->node;
+	sing->matice=this->matice;
+	sing->matpar=this->matpar;
+
+	return sing;
+}
+/*}}}*/
+
+/*Sing management*/
+/*FUNCTION Sing::Configure {{{1*/
+void  Sing::Configure(Elements* elementsin,Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
+
+	ISSMERROR(" not supported yet!");
+
 }
 /*}}}*/
@@ -117,14 +145,4 @@
 }
 /*}}}*/
-/*FUNCTION Sing::Marshall {{{1*/
-void  Sing::Marshall(char** pmarshalled_dataset){
-	ISSMERROR(" not supported yet!");
-}
-/*}}}*/
-/*FUNCTION Sing::MashallSize {{{1*/
-int   Sing::MarshallSize(){
-	ISSMERROR(" not supported yet!");
-}
-/*}}}*/
 /*FUNCTION Sing::InputUpdateFromSolution {{{1*/
 void  Sing::InputUpdateFromSolution(double* solution){
@@ -148,5 +166,5 @@
 /*}}}*/
 		
-/*Object functions*/
+/*Sing functions*/
 /*FUNCTION Sing::ComputeBasalStress {{{1*/
 void  Sing::ComputeBasalStress(Vec p_g){
@@ -304,11 +322,4 @@
 }
 /*}}}*/
-/*FUNCTION Sing::Enum {{{1*/
-int Sing::Enum(void){
-
-	return SingEnum;
-
-}
-/*}}}*/
 /*FUNCTION Sing::GetBedList {{{1*/
 void  Sing::GetBedList(double*){
@@ -341,7 +352,4 @@
 }
 /*}}}*/
-/*FUNCTION Sing::Id {{{1*/
-int    Sing::Id(void){ return id; }
-/*}}}*/
 /*FUNCTION Sing::GetMatPar {{{1*/
 void* Sing::GetMatPar(){
@@ -399,10 +407,4 @@
 double Sing::Misfit(void){
 	ISSMERROR(" not supported yet!");
-}
-/*}}}*/
-/*FUNCTION Sing::MyRank {{{1*/
-int    Sing::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Elements/Sing.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Sing.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Elements/Sing.h	(revision 4248)
@@ -37,5 +37,5 @@
 
 
-		/*constructors, destructors: {{{1*/
+		/*Sing constructors, destructors: {{{1*/
 		Sing();
 		~Sing();
@@ -43,17 +43,19 @@
 		void  UpdateGeometry(void){ISSMERROR("not implemented yet");};
 		/*}}}*/
-		/*Object virtual functions resolution: {{{1*/
-		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
 		int   Id(); 
-		bool  IsInput(int name);
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
+		/*}}}*/
+		/*Sing managemnet: {{{1*/
+		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
+		bool  IsInput(int name);
 		void  SetClone(int* minranks);
-		int   MyRank();
 		void  InputDepthAverageAtBase(int enum_type,int average_enum_type){ISSMERROR("not implemented yet");};
 		void  InputToResult(int enum_type,int step,double time);
@@ -69,5 +71,4 @@
 		void  InputUpdateFromSolution(double* solutiong);
 		/*}}}*/
-
 		/*numerics: {{{1*/
 		void  CreateKMatrix(Mat Kggg);
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*Tria constructors and destructor*/
 /*FUNCTION Tria::Tria(){{{1*/
 Tria::Tria(){
@@ -212,143 +212,6 @@
 }
 /*}}}*/
-/*FUNCTION Tria::copy {{{1*/
-Object* Tria::copy() {
-
-	int i;
-	Tria* tria=NULL;
-
-	tria=new Tria();
-
-	/*copy fields: */
-	tria->id=this->id;
-	tria->interpolation_type=this->interpolation_type;
-	if(this->inputs){
-		tria->inputs=(Inputs*)this->inputs->Copy();
-	}
-	else{
-		tria->inputs=new Inputs();
-	}
-	if(this->results){
-		tria->results=(Results*)this->results->Copy();
-	}
-	else{
-		tria->results=new Results();
-	}
-	/*point parameters: */
-	tria->parameters=this->parameters;
-
-	/*now deal with hooks and objects: */
-	tria->InitHookNodes(this->numanalyses);
-	for(i=0;i<this->numanalyses;i++)tria->hnodes[i].copy(&this->hnodes[i]);
-	tria->hmatice.copy(&this->hmatice);
-	tria->hmatpar.copy(&this->hmatpar);
-
-	/*recover objects: */
-	tria->nodes=(Node**)xmalloc(3*sizeof(Node*)); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
-	for(i=0;i<3;i++)tria->nodes[i]=this->nodes[i];
-	tria->matice=(Matice*)tria->hmatice.delivers();
-	tria->matpar=(Matpar*)tria->hmatpar.delivers();
-
-	return tria;
-}
-/*}}}*/
-
-/*Object management: */
-/*FUNCTION Tria::Configure {{{1*/
-void  Tria::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
-
-	int analysis_counter;
-	
-	/*go into parameters and get the analysis_counter: */
-	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
-
-	/*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: */
-	this->hnodes[analysis_counter].configure(nodesin);
-	this->hmatice.configure(materialsin);
-	this->hmatpar.configure(materialsin);
-
-	/*Now, go pick up the objects inside the hooks: */
-	this->nodes=(Node**)this->hnodes[analysis_counter].deliverp();
-	this->matice=(Matice*)this->hmatice.delivers();
-	this->matpar=(Matpar*)this->hmatpar.delivers();
-
-	/*point parameters to real dataset: */
-	this->parameters=parametersin;
-
-}
-/*}}}*/
-/*FUNCTION Tria::Demarshall {{{1*/
-void  Tria::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&interpolation_type,marshalled_dataset,sizeof(interpolation_type));marshalled_dataset+=sizeof(interpolation_type);
-	memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
-
-	/*allocate dynamic memory: */
-	InitHookNodes(numanalyses);
-
-	/*demarshall hooks: */
-	for(i=0;i<numanalyses;i++)hnodes[i].Demarshall(&marshalled_dataset);
-	hmatice.Demarshall(&marshalled_dataset);
-	hmatpar.Demarshall(&marshalled_dataset);
-
-	/*pointers are garbabe, until configuration is carried out: */
-	nodes=NULL;
-	matice=NULL;
-	matpar=NULL;
-	
-	/*demarshall inputs: */
-	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
-	results=(Results*)DataSetDemarshallRaw(&marshalled_dataset); 
-
-	/*parameters: may not exist even yet, so let Configure handle it: */
-	this->parameters=NULL;
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION Tria::DeepEcho{{{1*/
-void Tria::DeepEcho(void){
-
-	printf("Tria:\n");
-	printf("   id: %i\n",id);
-	if(nodes){
-		nodes[0]->DeepEcho();
-		nodes[1]->DeepEcho();
-		nodes[2]->DeepEcho();
-	}
-	else printf("nodes = NULL\n");
-
-	if (matice) matice->DeepEcho();
-	else printf("matice = NULL\n");
-
-	if (matpar) matpar->DeepEcho();
-	else printf("matpar = NULL\n");
-
-	printf("   parameters\n");
-	if (parameters) parameters->DeepEcho();
-	else printf("parameters = NULL\n");
-
-	printf("   inputs\n");
-	if (inputs) inputs->DeepEcho();
-	else printf("inputs=NULL\n");
-
-	if (results) results->DeepEcho();
-	else printf("results=NULL\n");
-	
-	return;
-}
-/*}}}*/
+
+/*Object virtual functions definitions:*/
 /*FUNCTION Tria::Echo{{{1*/
 void Tria::Echo(void){
@@ -378,4 +241,45 @@
 	if (results) results->Echo();
 	else printf("results=NULL\n");
+}
+/*}}}*/
+/*FUNCTION Tria::DeepEcho{{{1*/
+void Tria::DeepEcho(void){
+
+	printf("Tria:\n");
+	printf("   id: %i\n",id);
+	if(nodes){
+		nodes[0]->DeepEcho();
+		nodes[1]->DeepEcho();
+		nodes[2]->DeepEcho();
+	}
+	else printf("nodes = NULL\n");
+
+	if (matice) matice->DeepEcho();
+	else printf("matice = NULL\n");
+
+	if (matpar) matpar->DeepEcho();
+	else printf("matpar = NULL\n");
+
+	printf("   parameters\n");
+	if (parameters) parameters->DeepEcho();
+	else printf("parameters = NULL\n");
+
+	printf("   inputs\n");
+	if (inputs) inputs->DeepEcho();
+	else printf("inputs=NULL\n");
+
+	if (results) results->DeepEcho();
+	else printf("results=NULL\n");
+	
+	return;
+}
+/*}}}*/
+/*FUNCTION Tria::Id {{{1*/
+int    Tria::Id(){ return id; }
+/*}}}*/
+/*FUNCTION Tria::MyRank {{{1*/
+int    Tria::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
 }
 /*}}}*/
@@ -448,4 +352,118 @@
 		+results->MarshallSize()
 		+sizeof(int); //sizeof(int) for enum type
+}
+/*}}}*/
+/*FUNCTION Tria::Demarshall {{{1*/
+void  Tria::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&interpolation_type,marshalled_dataset,sizeof(interpolation_type));marshalled_dataset+=sizeof(interpolation_type);
+	memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
+
+	/*allocate dynamic memory: */
+	InitHookNodes(numanalyses);
+
+	/*demarshall hooks: */
+	for(i=0;i<numanalyses;i++)hnodes[i].Demarshall(&marshalled_dataset);
+	hmatice.Demarshall(&marshalled_dataset);
+	hmatpar.Demarshall(&marshalled_dataset);
+
+	/*pointers are garbabe, until configuration is carried out: */
+	nodes=NULL;
+	matice=NULL;
+	matpar=NULL;
+	
+	/*demarshall inputs: */
+	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
+	results=(Results*)DataSetDemarshallRaw(&marshalled_dataset); 
+
+	/*parameters: may not exist even yet, so let Configure handle it: */
+	this->parameters=NULL;
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION Tria::Enum {{{1*/
+int Tria::Enum(void){
+
+	return TriaEnum;
+
+}
+/*}}}*/
+/*FUNCTION Tria::copy {{{1*/
+Object* Tria::copy() {
+
+	int i;
+	Tria* tria=NULL;
+
+	tria=new Tria();
+
+	/*copy fields: */
+	tria->id=this->id;
+	tria->interpolation_type=this->interpolation_type;
+	if(this->inputs){
+		tria->inputs=(Inputs*)this->inputs->Copy();
+	}
+	else{
+		tria->inputs=new Inputs();
+	}
+	if(this->results){
+		tria->results=(Results*)this->results->Copy();
+	}
+	else{
+		tria->results=new Results();
+	}
+	/*point parameters: */
+	tria->parameters=this->parameters;
+
+	/*now deal with hooks and objects: */
+	tria->InitHookNodes(this->numanalyses);
+	for(i=0;i<this->numanalyses;i++)tria->hnodes[i].copy(&this->hnodes[i]);
+	tria->hmatice.copy(&this->hmatice);
+	tria->hmatpar.copy(&this->hmatpar);
+
+	/*recover objects: */
+	tria->nodes=(Node**)xmalloc(3*sizeof(Node*)); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
+	for(i=0;i<3;i++)tria->nodes[i]=this->nodes[i];
+	tria->matice=(Matice*)tria->hmatice.delivers();
+	tria->matpar=(Matpar*)tria->hmatpar.delivers();
+
+	return tria;
+}
+/*}}}*/
+
+/*Tria management: */
+/*FUNCTION Tria::Configure {{{1*/
+void  Tria::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
+
+	int analysis_counter;
+	
+	/*go into parameters and get the analysis_counter: */
+	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
+
+	/*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: */
+	this->hnodes[analysis_counter].configure(nodesin);
+	this->hmatice.configure(materialsin);
+	this->hmatpar.configure(materialsin);
+
+	/*Now, go pick up the objects inside the hooks: */
+	this->nodes=(Node**)this->hnodes[analysis_counter].deliverp();
+	this->matice=(Matice*)this->hmatice.delivers();
+	this->matpar=(Matpar*)this->hmatpar.delivers();
+
+	/*point parameters to real dataset: */
+	this->parameters=parametersin;
+
 }
 /*}}}*/
@@ -3625,11 +3643,4 @@
 }
 /*}}}*/
-/*FUNCTION Tria::Enum {{{1*/
-int Tria::Enum(void){
-
-	return TriaEnum;
-
-}
-/*}}}*/
 /*FUNCTION Tria::GetArea {{{1*/
 double Tria::GetArea(void){
@@ -3861,7 +3872,4 @@
 
 }
-/*}}}*/
-/*FUNCTION Tria::Id {{{1*/
-int    Tria::Id(){ return id; }
 /*}}}*/
 /*FUNCTION Tria::GetJacobian {{{1*/
@@ -4921,10 +4929,4 @@
 }
 /*}}}*/
-/*FUNCTION Tria::MyRank {{{1*/
-int    Tria::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
 /*FUNCTION Tria::Tria::SetClone {{{1*/
 void  Tria::SetClone(int* minranks){
Index: /issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Elements/Tria.h	(revision 4248)
@@ -36,5 +36,5 @@
 		Results*  results; 
 
-		/*FUNCTION constructors, destructors {{{1*/
+		/*Tria constructors, destructors {{{1*/
 		Tria();
 		Tria(int tria_id,int i, IoModel* iomodel,int nummodels);
@@ -43,16 +43,18 @@
 		~Tria();
 		/*}}}*/
-		/*Object virtual functions resolution: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
+		/*}}}*/
+		/*Tria management:{{{1*/
 		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
-		Object* copy();
-		void  DeepEcho(void);
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo(void);
-		int   Enum(void);
-		int   Id(void); 
 		bool  IsInput(int name);
-		void  Marshall(char** pmarshalled_dataset);
-		int   MarshallSize(void);
-		int   MyRank(void);
 		void  SetClone(int* minranks);
 		void  InputDepthAverageAtBase(int enum_type,int average_enum_type);
Index: /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*BoolExternalResult constructors and destructor*/
 /*FUNCTION BoolExternalResult::BoolExternalResult(){{{1*/
 BoolExternalResult::BoolExternalResult(){
@@ -42,10 +42,8 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION BoolExternalResult::copy{{{1*/
-Object* BoolExternalResult::copy() {
-	
-	return new BoolExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION BoolExternalResult::Echo {{{1*/
+void BoolExternalResult::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -59,4 +57,49 @@
 	printf("   step: %i\n",this->step);
 	printf("   time: %g\n",this->time);
+}
+/*}}}*/
+/*FUNCTION BoolExternalResult::Id{{{1*/
+int    BoolExternalResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION BoolExternalResult::MyRank{{{1*/
+int    BoolExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION BoolExternalResult::Marshall{{{1*/
+void  BoolExternalResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of BoolExternalResult: */
+	enum_value=BoolExternalResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall BoolExternalResult data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
+	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
+	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION BoolExternalResult::MarshallSize{{{1*/
+int   BoolExternalResult::MarshallSize(){
+	
+	return sizeof(value)+
+		+sizeof(id)
+		+sizeof(enum_type)
+		+sizeof(step)
+		+sizeof(time)
+		+sizeof(int); //sizeof(int) for enum value
 }
 /*}}}*/
@@ -83,9 +126,4 @@
 }
 /*}}}*/
-/*FUNCTION BoolExternalResult::Echo {{{1*/
-void BoolExternalResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION BoolExternalResult::Enum{{{1*/
 int BoolExternalResult::Enum(void){
@@ -95,51 +133,13 @@
 }
 /*}}}*/
-/*FUNCTION BoolExternalResult::Id{{{1*/
-int    BoolExternalResult::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION BoolExternalResult::Marshall{{{1*/
-void  BoolExternalResult::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of BoolExternalResult: */
-	enum_value=BoolExternalResultEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall BoolExternalResult data: */
-	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION BoolExternalResult::MarshallSize{{{1*/
-int   BoolExternalResult::MarshallSize(){
-	
-	return sizeof(value)+
-		+sizeof(id)
-		+sizeof(enum_type)
-		+sizeof(step)
-		+sizeof(time)
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION BoolExternalResult::MyRank{{{1*/
-int    BoolExternalResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*Numerics: */
+/*FUNCTION BoolExternalResult::copy{{{1*/
+Object* BoolExternalResult::copy() {
+	
+	return new BoolExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+
+/*BoolExternalResult management: */
 /*FUNCTION BoolExternalResult::WriteData(FILE* fid) {{{1*/
 void   BoolExternalResult::WriteData(FILE* fid){
Index: /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.h	(revision 4248)
@@ -37,23 +37,21 @@
 		double time;
 
-
-		/*constructors, destructors: {{{1*/
+		/*BoolExternalResult constructors, destructors: {{{1*/
 		BoolExternalResult();
 		BoolExternalResult(int id, int enum_type,bool value,int step,double time);
 		~BoolExternalResult();
-
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*ExternalResult methods: {{{1*/
+		/*ExternalResult management: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  WriteData(FILE* fid);
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*DoubleExternalResult constructors and destructor*/
 /*FUNCTION DoubleExternalResult::DoubleExternalResult(){{{1*/
 DoubleExternalResult::DoubleExternalResult(){
@@ -42,10 +42,8 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION DoubleExternalResult::copy{{{1*/
-Object* DoubleExternalResult::copy() {
-	
-	return new DoubleExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION DoubleExternalResult::Echo {{{1*/
+void DoubleExternalResult::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -61,40 +59,12 @@
 }
 /*}}}*/
-/*FUNCTION DoubleExternalResult::Demarshall{{{1*/
-void  DoubleExternalResult::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION DoubleExternalResult::Echo {{{1*/
-void DoubleExternalResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION DoubleExternalResult::Enum{{{1*/
-int DoubleExternalResult::Enum(void){
-
-	return DoubleExternalResultEnum;
-
-}
-/*}}}*/
 /*FUNCTION DoubleExternalResult::Id{{{1*/
 int    DoubleExternalResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION DoubleExternalResult::MyRank{{{1*/
+int    DoubleExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION DoubleExternalResult::Marshall{{{1*/
@@ -134,12 +104,42 @@
 }
 /*}}}*/
-/*FUNCTION DoubleExternalResult::MyRank{{{1*/
-int    DoubleExternalResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
+/*FUNCTION DoubleExternalResult::Demarshall{{{1*/
+void  DoubleExternalResult::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
+	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
+	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION DoubleExternalResult::Enum{{{1*/
+int DoubleExternalResult::Enum(void){
+
+	return DoubleExternalResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION DoubleExternalResult::copy{{{1*/
+Object* DoubleExternalResult::copy() {
+	
+	return new DoubleExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+
 }
 /*}}}*/
 
-/*Numerics: */
+/*DoubleExternalResult management: */
 /*FUNCTION DoubleExternalResult::WriteData(FILE* fid) {{{1*/
 void   DoubleExternalResult::WriteData(FILE* fid){
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.h	(revision 4248)
@@ -38,22 +38,21 @@
 
 
-		/*constructors, destructors: {{{1*/
+		/*DoubleExternalResult constructors, destructors: {{{1*/
 		DoubleExternalResult();
 		DoubleExternalResult(int id,int enum_type,double value,int step,double time);
 		~DoubleExternalResult();
-
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*ExternalResult methods: {{{1*/
+		/*ExternalResult management: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  WriteData(FILE* fid);
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*DoubleMatExternalResult constructors and destructor*/
 /*FUNCTION DoubleMatExternalResult::DoubleMatExternalResult(){{{1*/
 DoubleMatExternalResult::DoubleMatExternalResult(){
@@ -53,9 +53,22 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION DoubleMatExternalResult::copy{{{1*/
-Object* DoubleMatExternalResult::copy() {
-	
-	return new DoubleMatExternalResult(this->id,this->enum_type,this->values,this->M,this->N,this->step,this->time);
+/*Object virtual functions definitions:*/
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
+/*FUNCTION DoubleMatExternalResult::Echo {{{1*/
+void DoubleMatExternalResult::Echo(void){
+
+	printf("DoubleMatExternalResult:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+	printf("   matrix size: %i-%i\n",this->M,this->N);
 
 }
@@ -83,51 +96,12 @@
 }
 /*}}}*/
-/*FUNCTION DoubleMatExternalResult::Demarshall{{{1*/
-void  DoubleMatExternalResult::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	
-	/*data: */
-	memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
-	memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
-	values=(double*)xmalloc(M*N*sizeof(double));
-	memcpy(values,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
-	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION DoubleMatExternalResult::Echo {{{1*/
-void DoubleMatExternalResult::Echo(void){
-
-	printf("DoubleMatExternalResult:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
-	printf("   step: %i\n",this->step);
-	printf("   time: %g\n",this->time);
-	printf("   matrix size: %i-%i\n",this->M,this->N);
-
-}
-/*}}}*/
-/*FUNCTION DoubleMatExternalResult::Enum{{{1*/
-int DoubleMatExternalResult::Enum(void){
-
-	return DoubleMatExternalResultEnum;
-
-}
-/*}}}*/
 /*FUNCTION DoubleMatExternalResult::Id{{{1*/
 int    DoubleMatExternalResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION DoubleMatExternalResult::MyRank{{{1*/
+int    DoubleMatExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION DoubleMatExternalResult::Marshall{{{1*/
@@ -171,12 +145,47 @@
 }
 /*}}}*/
-/*FUNCTION DoubleMatExternalResult::MyRank{{{1*/
-int    DoubleMatExternalResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*Numerics: */
+/*FUNCTION DoubleMatExternalResult::Demarshall{{{1*/
+void  DoubleMatExternalResult::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*data: */
+	memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
+	memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
+	values=(double*)xmalloc(M*N*sizeof(double));
+	memcpy(values,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
+	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
+	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION DoubleMatExternalResult::Enum{{{1*/
+int DoubleMatExternalResult::Enum(void){
+
+	return DoubleMatExternalResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION DoubleMatExternalResult::copy{{{1*/
+Object* DoubleMatExternalResult::copy() {
+	
+	return new DoubleMatExternalResult(this->id,this->enum_type,this->values,this->M,this->N,this->step,this->time);
+
+}
+/*}}}*/
+
+/*DoubleMatExternalResult management: */
 /*FUNCTION DoubleMatExternalResult::WriteData(FILE* fid) {{{1*/
 void   DoubleMatExternalResult::WriteData(FILE* fid){
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.h	(revision 4248)
@@ -39,21 +39,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*DoubleMatExternalResult constructors, destructors: {{{1*/
 		DoubleMatExternalResult();
 		DoubleMatExternalResult(int id,int enum_type,double* values,int M,int N,int step, double time);
 		~DoubleMatExternalResult();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*ExternalResult methods: {{{1*/
+		/*ExternalResult managemnet: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  WriteData(FILE* fid);
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*DoubleVecExternalResult constructors and destructor*/
 /*FUNCTION DoubleVecExternalResult::DoubleVecExternalResult(){{{1*/
 DoubleVecExternalResult::DoubleVecExternalResult(){
@@ -50,9 +50,13 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION DoubleVecExternalResult::copy{{{1*/
-Object* DoubleVecExternalResult::copy() {
-	
-	return new DoubleVecExternalResult(this->id,this->enum_type,this->values,this->M,this->step,this->time);
+/*Object virtual functions definitions:*/
+/*FUNCTION DoubleVecExternalResult::Echo {{{1*/
+void DoubleVecExternalResult::Echo(void){
+
+	printf("DoubleVecExternalResult:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	printf("   vector size: %i\n",this->M);
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
 
 }
@@ -74,50 +78,12 @@
 }
 /*}}}*/
-/*FUNCTION DoubleVecExternalResult::Demarshall{{{1*/
-void  DoubleVecExternalResult::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	
-	/*data: */
-	memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
-	values=(double*)xmalloc(M*sizeof(double));
-	memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
-	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION DoubleVecExternalResult::Echo {{{1*/
-void DoubleVecExternalResult::Echo(void){
-
-	printf("DoubleVecExternalResult:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
-	printf("   vector size: %i\n",this->M);
-	printf("   step: %i\n",this->step);
-	printf("   time: %g\n",this->time);
-
-}
-/*}}}*/
-/*FUNCTION DoubleVecExternalResult::Enum{{{1*/
-int DoubleVecExternalResult::Enum(void){
-
-	return DoubleVecExternalResultEnum;
-
-}
-/*}}}*/
 /*FUNCTION DoubleVecExternalResult::Id{{{1*/
 int    DoubleVecExternalResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION DoubleVecExternalResult::MyRank{{{1*/
+int    DoubleVecExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION DoubleVecExternalResult::Marshall{{{1*/
@@ -159,12 +125,46 @@
 }
 /*}}}*/
-/*FUNCTION DoubleVecExternalResult::MyRank{{{1*/
-int    DoubleVecExternalResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*Numerics: */
+/*FUNCTION DoubleVecExternalResult::Demarshall{{{1*/
+void  DoubleVecExternalResult::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*data: */
+	memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
+	values=(double*)xmalloc(M*sizeof(double));
+	memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
+	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
+	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION DoubleVecExternalResult::Enum{{{1*/
+int DoubleVecExternalResult::Enum(void){
+
+	return DoubleVecExternalResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION DoubleVecExternalResult::copy{{{1*/
+Object* DoubleVecExternalResult::copy() {
+	
+	return new DoubleVecExternalResult(this->id,this->enum_type,this->values,this->M,this->step,this->time);
+
+}
+/*}}}*/
+
+/*DoubleVecExternalResult management: */
 /*FUNCTION DoubleVecExternalResult::WriteData(FILE* fid) {{{1*/
 void   DoubleVecExternalResult::WriteData(FILE* fid){
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.h	(revision 4248)
@@ -38,21 +38,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*DoubleVecExternalResult constructors, destructors: {{{1*/
 		DoubleVecExternalResult();
 		DoubleVecExternalResult(int id,int enum_type,double* values,int M,int step, double time);
 		~DoubleVecExternalResult();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*ExternalResult methods: {{{1*/
+		/*ExternalResult management: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  WriteData(FILE* fid);
Index: /issm/trunk/src/c/objects/ExternalResults/ExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/ExternalResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/ExternalResult.h	(revision 4248)
@@ -29,6 +29,5 @@
 		
 		virtual        ~ExternalResult(){};
-
-		/*methods:{{{1*/
+		/*Virtual functions:{{{1*/
 		virtual int   EnumType()=0;
 		virtual void  WriteData(FILE* fid)=0;
Index: /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*IntExternalResult constructors and destructor*/
 /*FUNCTION IntExternalResult::IntExternalResult(){{{1*/
 IntExternalResult::IntExternalResult(){
@@ -42,10 +42,17 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION IntExternalResult::copy{{{1*/
-Object* IntExternalResult::copy() {
-	
-	return new IntExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
-
+/*Object virtual functions definitions:*/
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
+/*FUNCTION IntExternalResult::Echo {{{1*/
+void IntExternalResult::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -59,4 +66,49 @@
 	printf("   step: %i\n",this->step);
 	printf("   time: %g\n",this->time);
+}
+/*}}}*/
+/*FUNCTION IntExternalResult::Id{{{1*/
+int    IntExternalResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION IntExternalResult::MyRank{{{1*/
+int    IntExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION IntExternalResult::Marshall{{{1*/
+void  IntExternalResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of IntExternalResult: */
+	enum_value=IntExternalResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall IntExternalResult data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
+	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
+	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION IntExternalResult::MarshallSize{{{1*/
+int   IntExternalResult::MarshallSize(){
+	
+	return sizeof(value)+
+		+sizeof(id)
+		+sizeof(enum_type)
+		+sizeof(step)
+		+sizeof(time)
+		+sizeof(int); //sizeof(int) for enum value
 }
 /*}}}*/
@@ -83,9 +135,4 @@
 }
 /*}}}*/
-/*FUNCTION IntExternalResult::Echo {{{1*/
-void IntExternalResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION IntExternalResult::Enum{{{1*/
 int IntExternalResult::Enum(void){
@@ -95,51 +142,13 @@
 }
 /*}}}*/
-/*FUNCTION IntExternalResult::Id{{{1*/
-int    IntExternalResult::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION IntExternalResult::Marshall{{{1*/
-void  IntExternalResult::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of IntExternalResult: */
-	enum_value=IntExternalResultEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall IntExternalResult data: */
-	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION IntExternalResult::MarshallSize{{{1*/
-int   IntExternalResult::MarshallSize(){
-	
-	return sizeof(value)+
-		+sizeof(id)
-		+sizeof(enum_type)
-		+sizeof(step)
-		+sizeof(time)
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION IntExternalResult::MyRank{{{1*/
-int    IntExternalResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*Numerics: */
+/*FUNCTION IntExternalResult::copy{{{1*/
+Object* IntExternalResult::copy() {
+	
+	return new IntExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+
+/*IntExternalResult management: */
 /*FUNCTION IntExternalResult::WriteData(FILE* fid) {{{1*/
 void   IntExternalResult::WriteData(FILE* fid){
Index: /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.h	(revision 4248)
@@ -38,5 +38,5 @@
 
 
-		/*constructors, destructors: {{{1*/
+		/*IntExternalResult constructors, destructors: {{{1*/
 		IntExternalResult();
 		IntExternalResult(int id,int enum_type,int value,int step,double time);
@@ -44,16 +44,16 @@
 
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*ExternalResult methods: {{{1*/
+		/*ExternalResult managemnet: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  WriteData(FILE* fid);
Index: /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*PetscVecExternalResult constructors and destructor*/
 /*FUNCTION PetscVecExternalResult::PetscVecExternalResult(){{{1*/
 PetscVecExternalResult::PetscVecExternalResult(){
@@ -50,9 +50,10 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION PetscVecExternalResult::copy{{{1*/
-Object* PetscVecExternalResult::copy() {
-	
-	return new PetscVecExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+/*Object virtual functions definitions:*/
+/*FUNCTION PetscVecExternalResult::Echo {{{1*/
+void PetscVecExternalResult::Echo(void){
+
+	printf("PetscVecExternalResult:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
 
 }
@@ -70,69 +71,12 @@
 }
 /*}}}*/
-/*FUNCTION PetscVecExternalResult::Demarshall{{{1*/
-void  PetscVecExternalResult::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-	int   M;
-	double* serial_vec=NULL;
-	int*    idxm=NULL;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	
-	/*data: */
-	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-	
-	memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
-	if(M){
-		serial_vec=(double*)xmalloc(M*sizeof(double));
-		memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
-
-		value=NewVec(M);
-		idxm=(int*)xmalloc(M*sizeof(int));
-		for(i=0;i<M;i++)idxm[i]=i;
-		VecSetValues(value,M,idxm,serial_vec,INSERT_VALUES);
-
-		VecAssemblyBegin(value);
-		VecAssemblyEnd(value);
-
-		
-	}
-	else{
-		value=NULL;
-	}
-
-	/*Free ressources:*/
-	xfree((void**)&serial_vec);
-	xfree((void**)&idxm);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION PetscVecExternalResult::Echo {{{1*/
-void PetscVecExternalResult::Echo(void){
-
-	printf("PetscVecExternalResult:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
-
-}
-/*}}}*/
-/*FUNCTION PetscVecExternalResult::Enum{{{1*/
-int PetscVecExternalResult::Enum(void){
-
-	return PetscVecExternalResultEnum;
-
-}
-/*}}}*/
 /*FUNCTION PetscVecExternalResult::Id{{{1*/
 int    PetscVecExternalResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION PetscVecExternalResult::MyRank{{{1*/
+int    PetscVecExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION PetscVecExternalResult::Marshall{{{1*/
@@ -190,12 +134,68 @@
 }
 /*}}}*/
-/*FUNCTION PetscVecExternalResult::MyRank{{{1*/
-int    PetscVecExternalResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*Numerics: */
+/*FUNCTION PetscVecExternalResult::Demarshall{{{1*/
+void  PetscVecExternalResult::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+	int   M;
+	double* serial_vec=NULL;
+	int*    idxm=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*data: */
+	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
+	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
+	
+	memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
+	if(M){
+		serial_vec=(double*)xmalloc(M*sizeof(double));
+		memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
+
+		value=NewVec(M);
+		idxm=(int*)xmalloc(M*sizeof(int));
+		for(i=0;i<M;i++)idxm[i]=i;
+		VecSetValues(value,M,idxm,serial_vec,INSERT_VALUES);
+
+		VecAssemblyBegin(value);
+		VecAssemblyEnd(value);
+
+		
+	}
+	else{
+		value=NULL;
+	}
+
+	/*Free ressources:*/
+	xfree((void**)&serial_vec);
+	xfree((void**)&idxm);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION PetscVecExternalResult::Enum{{{1*/
+int PetscVecExternalResult::Enum(void){
+
+	return PetscVecExternalResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION PetscVecExternalResult::copy{{{1*/
+Object* PetscVecExternalResult::copy() {
+	
+	return new PetscVecExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+
+/*PetscVecExternalResult management: */
 /*FUNCTION PetscVecExternalResult::WriteData(FILE* fid) {{{1*/
 void   PetscVecExternalResult::WriteData(FILE* fid){
Index: /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.h	(revision 4248)
@@ -38,21 +38,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*PetscVecExternalResult constructors, destructors: {{{1*/
 		PetscVecExternalResult();
 		PetscVecExternalResult(int id,int enum_type,Vec value, int step, double time);
 		~PetscVecExternalResult();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*ExternalResult methods: {{{1*/
+		/*ExternalResult management: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  WriteData(FILE* fid);
Index: /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*StringExternalResult constructors and destructor*/
 /*FUNCTION StringExternalResult::StringExternalResult(){{{1*/
 StringExternalResult::StringExternalResult(){
@@ -44,10 +44,8 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION StringExternalResult::copy{{{1*/
-Object* StringExternalResult::copy() {
-	
-	return new StringExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION StringExternalResult::Echo {{{1*/
+void StringExternalResult::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -63,45 +61,12 @@
 }
 /*}}}*/
-/*FUNCTION StringExternalResult::Demarshall{{{1*/
-void  StringExternalResult::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-	int   stringsize;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
-	memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
-	
-	this->value=(char*)xmalloc(stringsize*sizeof(char));
-	memcpy(value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION StringExternalResult::Echo {{{1*/
-void StringExternalResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION StringExternalResult::Enum{{{1*/
-int StringExternalResult::Enum(void){
-
-	return StringExternalResultEnum;
-
-}
-/*}}}*/
 /*FUNCTION StringExternalResult::Id{{{1*/
 int    StringExternalResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION StringExternalResult::MyRank{{{1*/
+int    StringExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION StringExternalResult::Marshall{{{1*/
@@ -149,12 +114,47 @@
 }
 /*}}}*/
-/*FUNCTION StringExternalResult::MyRank{{{1*/
-int    StringExternalResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*Numerics: */
+/*FUNCTION StringExternalResult::Demarshall{{{1*/
+void  StringExternalResult::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+	int   stringsize;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+
+	memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
+	
+	this->value=(char*)xmalloc(stringsize*sizeof(char));
+	memcpy(value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
+	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION StringExternalResult::Enum{{{1*/
+int StringExternalResult::Enum(void){
+
+	return StringExternalResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION StringExternalResult::copy{{{1*/
+Object* StringExternalResult::copy() {
+	
+	return new StringExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+
+/*StringExternalResult management: */
 /*FUNCTION StringExternalResult::WriteData(FILE* fid) {{{1*/
 void   StringExternalResult::WriteData(FILE* fid){
Index: /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.h	(revision 4247)
+++ /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.h	(revision 4248)
@@ -38,21 +38,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*StringExternalResult constructors, destructors: {{{1*/
 		StringExternalResult();
 		StringExternalResult(int id,int enum_type,char* value,int step, double time);
 		~StringExternalResult();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*ExternalResult methods: {{{1*/
+		/*ExternalResult management: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  WriteData(FILE* fid);
Index: /issm/trunk/src/c/objects/Hook.cpp
===================================================================
--- /issm/trunk/src/c/objects/Hook.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Hook.cpp	(revision 4248)
@@ -104,32 +104,4 @@
 }
 /*}}}*/
-/*FUNCTION Hook::copy(Hook* input) {{{1*/
-void Hook::copy(Hook* input){
-
-	int i;
-	Object** input_objects=NULL;
-	int*     input_ids=NULL;
-	int*     input_offsets=NULL;
-
-	/*get internals of input: */
-	this->num=input->GetNum();
-	input_objects=input->GetObjects();
-	input_ids=input->Ids();
-	input_offsets=input->GetOffsets();
-
-	if(this->num){
-		this->objects=(Object**)xmalloc(this->num*sizeof(Object*));
-		this->ids=(int*)xmalloc(this->num*sizeof(int));
-		this->offsets=(int*)xmalloc(this->num*sizeof(int));
-	}
-	
-
-	for(i=0;i<this->num;i++){
-		this->objects[i]=input_objects[i];
-		this->offsets[i]=input_offsets[i];
-		this->ids[i]=input_ids[i];
-	}
-}
-/*}}}*/
 /*FUNCTION Hook::~Hook(){{{1*/
 Hook::~Hook(){
@@ -142,5 +114,59 @@
 /*}}}*/
 
-/*Object marshalling*/
+/*Some of the Object functionality: */
+/*FUNCTION Hook::Echo{{{1*/
+void Hook::Echo(void){
+
+	int i;
+	if (num){
+		printf("   Hook: \n");
+		printf("      num=%i\n",this->num);
+		printf("      ids: ");
+		for (i=0;i<this->num;i++){
+			printf("%i ",this->ids[i]);
+		}
+		printf("\n");
+		printf("      offsets: ");
+		for (i=0;i<this->num;i++){
+			printf("%i ",this->offsets[i]);
+		}
+		printf("\n");
+	}
+	else{
+		printf("   Hook: num=0 \n");
+	}
+}
+/*}}}*/
+/*FUNCTION Hook::DeepEcho{{{1*/
+void Hook::DeepEcho(void){
+
+	int i;
+	if (num){
+		printf("   Hook: \n");
+		printf("      num=%i\n",this->num);
+		printf("      ids: ");
+		for (i=0;i<this->num;i++){
+			printf("%i ",this->ids[i]);
+		}
+		printf("\n");
+		printf("      offsets: ");
+		for (i=0;i<this->num;i++){
+			printf("%i ",this->offsets[i]);
+		}
+		printf("\n");
+		if (!objects) printf("      warning: object not hooked yet\n");
+		else{
+			printf("      objects:\n   ");
+			for (i=0;i<this->num;i++){
+				printf("         object %i\n",i);
+				objects[i]->DeepEcho();
+			}
+		}
+	}
+	else{
+		printf("   Hook: num=0 \n");
+	}
+}
+/*}}}*/
 /*FUNCTION Hook::Marshall{{{1*/
 void Hook::Marshall(char** pmarshalled_dataset){
@@ -226,6 +252,34 @@
 }
 /*}}}*/
-
-/*Object processing: */
+/*FUNCTION Hook::copy(Hook* input) {{{1*/
+void Hook::copy(Hook* input){
+
+	int i;
+	Object** input_objects=NULL;
+	int*     input_ids=NULL;
+	int*     input_offsets=NULL;
+
+	/*get internals of input: */
+	this->num=input->GetNum();
+	input_objects=input->GetObjects();
+	input_ids=input->Ids();
+	input_offsets=input->GetOffsets();
+
+	if(this->num){
+		this->objects=(Object**)xmalloc(this->num*sizeof(Object*));
+		this->ids=(int*)xmalloc(this->num*sizeof(int));
+		this->offsets=(int*)xmalloc(this->num*sizeof(int));
+	}
+	
+
+	for(i=0;i<this->num;i++){
+		this->objects[i]=input_objects[i];
+		this->offsets[i]=input_offsets[i];
+		this->ids[i]=input_ids[i];
+	}
+}
+/*}}}*/
+
+/*Hook management: */
 /*FUNCTION Hook::configure{{{1*/
 void Hook::configure(DataSet* dataset){
@@ -270,60 +324,4 @@
 }
 /*}}}*/
-/*FUNCTION Hook::Echo{{{1*/
-void Hook::Echo(void){
-
-	int i;
-	if (num){
-		printf("   Hook: \n");
-		printf("      num=%i\n",this->num);
-		printf("      ids: ");
-		for (i=0;i<this->num;i++){
-			printf("%i ",this->ids[i]);
-		}
-		printf("\n");
-		printf("      offsets: ");
-		for (i=0;i<this->num;i++){
-			printf("%i ",this->offsets[i]);
-		}
-		printf("\n");
-	}
-	else{
-		printf("   Hook: num=0 \n");
-	}
-}
-/*}}}*/
-/*FUNCTION Hook::DeepEcho{{{1*/
-void Hook::DeepEcho(void){
-
-	int i;
-	if (num){
-		printf("   Hook: \n");
-		printf("      num=%i\n",this->num);
-		printf("      ids: ");
-		for (i=0;i<this->num;i++){
-			printf("%i ",this->ids[i]);
-		}
-		printf("\n");
-		printf("      offsets: ");
-		for (i=0;i<this->num;i++){
-			printf("%i ",this->offsets[i]);
-		}
-		printf("\n");
-		if (!objects) printf("      warning: object not hooked yet\n");
-		else{
-			printf("      objects:\n   ");
-			for (i=0;i<this->num;i++){
-				printf("         object %i\n",i);
-				objects[i]->DeepEcho();
-			}
-		}
-	}
-	else{
-		printf("   Hook: num=0 \n");
-	}
-}
-/*}}}*/
-
-/*Object functions*/
 /*FUNCTION Hook::delivers{{{1*/
 Object* Hook::delivers(void){
Index: /issm/trunk/src/c/objects/Hook.h
===================================================================
--- /issm/trunk/src/c/objects/Hook.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Hook.h	(revision 4248)
@@ -26,4 +26,5 @@
 	public:
 
+		/*Hook constructors, destructors: {{{*/
 		Hook();
 		Hook(int* ids, int num);
@@ -31,14 +32,18 @@
 		Hook(Object** objects, int* ids, int* offsets,int num);
 		Hook(Hook* hook);
-		void copy(Hook* hook);
 		~Hook();
+		/*}}}*/
+		/*Object like functionality:{{{1*/
+		void       Echo(void);
+		void       DeepEcho(void);
 		void       Marshall(char** pmarshalled_dataset);
 		int        MarshallSize();
 		void       Demarshall(char** pmarshalled_dataset);
+		void       copy(Hook* hook);
+		/*}}}*/
+		/*Hook management: {{{1*/
 		Object*    delivers(void); //single object deliver
 		Object**   deliverp(void); //deliver all objects
 		void       configure(DataSet* dataset);
-		void       Echo(void);
-		void       DeepEcho(void);
 		Hook*      Spawn(int* indices, int numindices);
 		Object**   GetObjects(void);
@@ -46,6 +51,5 @@
 		int*       GetOffsets(void);
 		int        GetNum(void);
-
-
+		/*}}}*/
 };
 
Index: /issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*BeamVertexInput constructors and destructor*/
 /*FUNCTION BeamVertexInput::BeamVertexInput(){{{1*/
 BeamVertexInput::BeamVertexInput(){
@@ -37,10 +37,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION BeamVertexInput::copy{{{1*/
-Object* BeamVertexInput::copy() {
-	
-	return new BeamVertexInput(this->enum_type,this->values);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION BeamVertexInput::Echo {{{1*/
+void BeamVertexInput::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -51,4 +49,43 @@
 	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
 	printf("   values: [%g %g]\n",this->values[0],this->values[1]);
+}
+/*}}}*/
+/*FUNCTION BeamVertexInput::Id{{{1*/
+int    BeamVertexInput::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION BeamVertexInput::MyRank{{{1*/
+int    BeamVertexInput::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION BeamVertexInput::Marshall{{{1*/
+void  BeamVertexInput::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of BeamVertexInput: */
+	enum_value=BeamVertexInputEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall BeamVertexInput data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION BeamVertexInput::MarshallSize{{{1*/
+int   BeamVertexInput::MarshallSize(){
+	
+	return sizeof(values)+
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum_value
 }
 /*}}}*/
@@ -72,9 +109,4 @@
 }
 /*}}}*/
-/*FUNCTION BeamVertexInput::Echo {{{1*/
-void BeamVertexInput::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION BeamVertexInput::Enum{{{1*/
 int BeamVertexInput::Enum(void){
@@ -84,4 +116,13 @@
 }
 /*}}}*/
+/*FUNCTION BeamVertexInput::copy{{{1*/
+Object* BeamVertexInput::copy() {
+	
+	return new BeamVertexInput(this->enum_type,this->values);
+
+}
+/*}}}*/
+	
+/*BeamVertexInput management*/
 /*FUNCTION BeamVertexInput::EnumType{{{1*/
 int BeamVertexInput::EnumType(void){
@@ -89,43 +130,4 @@
 	return this->enum_type;
 
-}
-/*}}}*/
-/*FUNCTION BeamVertexInput::Id{{{1*/
-int    BeamVertexInput::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION BeamVertexInput::Marshall{{{1*/
-void  BeamVertexInput::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of BeamVertexInput: */
-	enum_value=BeamVertexInputEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall BeamVertexInput data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION BeamVertexInput::MarshallSize{{{1*/
-int   BeamVertexInput::MarshallSize(){
-	
-	return sizeof(values)+
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum_value
-}
-/*}}}*/
-/*FUNCTION BeamVertexInput::MyRank{{{1*/
-int    BeamVertexInput::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/BeamVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BeamVertexInput.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/BeamVertexInput.h	(revision 4248)
@@ -20,26 +20,26 @@
 		double values[2];
 
-		/*constructors, destructors: {{{1*/
+		/*BeamVertexInput constructors, destructors: {{{1*/
 		BeamVertexInput();
 		BeamVertexInput(int enum_type,double* values);
 		~BeamVertexInput();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
+		/*}}}*/
+		/*BeamVertexInput management: {{{1*/
 		int   EnumType();
-
 		Input* SpawnSingInput(int  index);
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
 		ElementResult* SpawnResult(int step, double time);
-
 		/*}}}*/
 		/*numerics: {{{1*/
Index: /issm/trunk/src/c/objects/Inputs/BoolInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BoolInput.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/BoolInput.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*BoolInput constructors and destructor*/
 /*FUNCTION BoolInput::BoolInput(){{{1*/
 BoolInput::BoolInput(){
@@ -36,10 +36,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION BoolInput::copy{{{1*/
-Object* BoolInput::copy() {
-	
-	return new BoolInput(this->enum_type,this->value);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION BoolInput::Echo {{{1*/
+void BoolInput::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -50,4 +48,43 @@
 	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
 	printf("   value: %s\n",value?"true":"false");
+}
+/*}}}*/
+/*FUNCTION BoolInput::Id{{{1*/
+int    BoolInput::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION BoolInput::MyRank{{{1*/
+int    BoolInput::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION BoolInput::Marshall{{{1*/
+void  BoolInput::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of BoolInput: */
+	enum_value=BoolInputEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall BoolInput data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION BoolInput::MarshallSize{{{1*/
+int   BoolInput::MarshallSize(){
+	
+	return sizeof(value)+
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum value
 }
 /*}}}*/
@@ -71,9 +108,4 @@
 }
 /*}}}*/
-/*FUNCTION BoolInput::Echo {{{1*/
-void BoolInput::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION BoolInput::Enum{{{1*/
 int BoolInput::Enum(void){
@@ -83,4 +115,13 @@
 }
 /*}}}*/
+/*FUNCTION BoolInput::copy{{{1*/
+Object* BoolInput::copy() {
+	
+	return new BoolInput(this->enum_type,this->value);
+
+}
+/*}}}*/
+	
+/*BoolInput management*/
 /*FUNCTION BoolInput::EnumType{{{1*/
 int BoolInput::EnumType(void){
@@ -88,43 +129,4 @@
 	return this->enum_type;
 
-}
-/*}}}*/
-/*FUNCTION BoolInput::Id{{{1*/
-int    BoolInput::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION BoolInput::Marshall{{{1*/
-void  BoolInput::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of BoolInput: */
-	enum_value=BoolInputEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall BoolInput data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION BoolInput::MarshallSize{{{1*/
-int   BoolInput::MarshallSize(){
-	
-	return sizeof(value)+
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION BoolInput::MyRank{{{1*/
-int    BoolInput::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/BoolInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BoolInput.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/BoolInput.h	(revision 4248)
@@ -20,26 +20,26 @@
 		IssmBool value;
 
-		/*constructors, destructors: {{{1*/
+		/*BoolInput constructors, destructors: {{{1*/
 		BoolInput();
 		BoolInput(int enum_type,IssmBool value);
 		~BoolInput();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
+		/*}}}*/
+		/*BoolInput management: {{{1*/
 		int   EnumType();
-
 		Input* SpawnSingInput(int  index);
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
 		ElementResult* SpawnResult(int step, double time);
-
 		/*}}}*/
 		/*numerics: {{{1*/
Index: /issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/DoubleInput.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/DoubleInput.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*DoubleInput constructors and destructor*/
 /*FUNCTION DoubleInput::DoubleInput(){{{1*/
 DoubleInput::DoubleInput(){
@@ -36,10 +36,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION DoubleInput::copy{{{1*/
-Object* DoubleInput::copy() {
-	
-	return new DoubleInput(this->enum_type,this->value);
-
+/*Object virtual functions definitions:*/
+		/*FUNCTION DoubleInput::Echo {{{1*/
+void DoubleInput::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -50,4 +48,43 @@
 	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
 	printf("   value: %g\n",this->value);
+}
+/*}}}*/
+/*FUNCTION DoubleInput::Id{{{1*/
+int    DoubleInput::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION DoubleInput::MyRank{{{1*/
+int    DoubleInput::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION DoubleInput::Marshall{{{1*/
+void  DoubleInput::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of DoubleInput: */
+	enum_value=DoubleInputEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall DoubleInput data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION DoubleInput::MarshallSize{{{1*/
+int   DoubleInput::MarshallSize(){
+	
+	return sizeof(value)+
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum value
 }
 /*}}}*/
@@ -71,9 +108,4 @@
 }
 /*}}}*/
-/*FUNCTION DoubleInput::Echo {{{1*/
-void DoubleInput::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION DoubleInput::Enum{{{1*/
 int DoubleInput::Enum(void){
@@ -83,4 +115,13 @@
 }
 /*}}}*/
+/*FUNCTION DoubleInput::copy{{{1*/
+Object* DoubleInput::copy() {
+	
+	return new DoubleInput(this->enum_type,this->value);
+
+}
+/*}}}*/
+	
+/*DoubleInput management*/
 /*FUNCTION DoubleInput::EnumType{{{1*/
 int DoubleInput::EnumType(void){
@@ -88,43 +129,4 @@
 	return this->enum_type;
 
-}
-/*}}}*/
-/*FUNCTION DoubleInput::Id{{{1*/
-int    DoubleInput::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION DoubleInput::Marshall{{{1*/
-void  DoubleInput::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of DoubleInput: */
-	enum_value=DoubleInputEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall DoubleInput data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleInput::MarshallSize{{{1*/
-int   DoubleInput::MarshallSize(){
-	
-	return sizeof(value)+
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION DoubleInput::MyRank{{{1*/
-int    DoubleInput::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/DoubleInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/DoubleInput.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/DoubleInput.h	(revision 4248)
@@ -19,26 +19,26 @@
 		double value;
 
-		/*constructors, destructors: {{{1*/
+		/*DoubleInput constructors, destructors: {{{1*/
 		DoubleInput();
 		DoubleInput(int enum_type,IssmDouble value);
 		~DoubleInput();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
+		/*}}}*/
+		/*DoubleInput management: {{{1*/
 		int   EnumType();
-
 		Input* SpawnSingInput(int  index);
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
 		ElementResult* SpawnResult(int step, double time);
-
 		/*}}}*/
 		/*numerics: {{{1*/
Index: /issm/trunk/src/c/objects/Inputs/Input.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/Input.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/Input.h	(revision 4248)
@@ -20,8 +20,6 @@
 		
 		virtual        ~Input(){};
-		virtual int    Enum()=0; //object Enum
-		virtual int    EnumType()=0; //type of input (vx,vy?)
-
-		/*methods:{{{1*/
+		/*Virtual functions:{{{1*/
+		virtual int  EnumType()=0; 
 		virtual void GetParameterValue(bool* pvalue)=0;
 		virtual void GetParameterValue(int* pvalue)=0;
Index: /issm/trunk/src/c/objects/Inputs/IntInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/IntInput.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/IntInput.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*IntInput constructors and destructor*/
 /*FUNCTION IntInput::IntInput(){{{1*/
 IntInput::IntInput(){
@@ -36,12 +36,5 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION IntInput::copy{{{1*/
-Object* IntInput::copy() {
-	
-	return new IntInput(this->enum_type,this->value);
-
-}
-/*}}}*/
+/*Object virtual functions definitions:*/
 /*FUNCTION IntInput::DeepEcho{{{1*/
 void IntInput::DeepEcho(void){
@@ -50,4 +43,43 @@
 	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
 	printf("   value: %i\n",this->value);
+}
+/*}}}*/
+/*FUNCTION IntInput::Id{{{1*/
+int    IntInput::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION IntInput::MyRank{{{1*/
+int    IntInput::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION IntInput::Marshall{{{1*/
+void  IntInput::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of IntInput: */
+	enum_value=IntInputEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall IntInput data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION IntInput::MarshallSize{{{1*/
+int   IntInput::MarshallSize(){
+	
+	return sizeof(value)+
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum value
 }
 /*}}}*/
@@ -71,4 +103,20 @@
 }
 /*}}}*/
+/*FUNCTION IntInput::Enum{{{1*/
+int IntInput::Enum(void){
+
+	return IntInputEnum;
+
+}
+/*}}}*/
+/*FUNCTION IntInput::copy{{{1*/
+Object* IntInput::copy() {
+	
+	return new IntInput(this->enum_type,this->value);
+
+}
+/*}}}*/
+
+/*IntInput management*/
 /*FUNCTION IntInput::Echo {{{1*/
 void IntInput::Echo(void){
@@ -76,11 +124,4 @@
 }
 /*}}}*/
-/*FUNCTION IntInput::Enum{{{1*/
-int IntInput::Enum(void){
-
-	return IntInputEnum;
-
-}
-/*}}}*/
 /*FUNCTION IntInput::EnumType{{{1*/
 int IntInput::EnumType(void){
@@ -88,43 +129,4 @@
 	return this->enum_type;
 
-}
-/*}}}*/
-/*FUNCTION IntInput::Id{{{1*/
-int    IntInput::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION IntInput::Marshall{{{1*/
-void  IntInput::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of IntInput: */
-	enum_value=IntInputEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall IntInput data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION IntInput::MarshallSize{{{1*/
-int   IntInput::MarshallSize(){
-	
-	return sizeof(value)+
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION IntInput::MyRank{{{1*/
-int    IntInput::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/IntInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/IntInput.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/IntInput.h	(revision 4248)
@@ -20,26 +20,26 @@
 		IssmInt value;
 
-		/*constructors, destructors: {{{1*/
+		/*IntInput constructors, destructors: {{{1*/
 		IntInput();
 		IntInput(int enum_type,IssmInt value);
 		~IntInput();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
+		/*}}}*/
+		/*IntInput management: {{{1*/
 		int   EnumType();
-
 		Input* SpawnSingInput(int  index);
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
 		ElementResult* SpawnResult(int step, double time);
-
 		/*}}}*/
 		/*numerics: {{{1*/
Index: /issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*PentaVertexInput constructors and destructor*/
 /*FUNCTION PentaVertexInput::PentaVertexInput(){{{1*/
 PentaVertexInput::PentaVertexInput(){
@@ -41,10 +41,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION PentaVertexInput::copy{{{1*/
-Object* PentaVertexInput::copy() {
-	
-	return new PentaVertexInput(this->enum_type,this->values);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION PentaVertexInput::Echo {{{1*/
+void PentaVertexInput::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -57,44 +55,12 @@
 }
 /*}}}*/
-/*FUNCTION PentaVertexInput::Demarshall{{{1*/
-void  PentaVertexInput::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::Echo {{{1*/
-void PentaVertexInput::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::Enum{{{1*/
-int PentaVertexInput::Enum(void){
-
-	return PentaVertexInputEnum;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::EnumType{{{1*/
-int PentaVertexInput::EnumType(void){
-
-	return this->enum_type;
-
-}
-/*}}}*/
 /*FUNCTION PentaVertexInput::Id{{{1*/
 int    PentaVertexInput::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION PentaVertexInput::MyRank{{{1*/
+int    PentaVertexInput::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION PentaVertexInput::Marshall{{{1*/
@@ -128,8 +94,44 @@
 }
 /*}}}*/
-/*FUNCTION PentaVertexInput::MyRank{{{1*/
-int    PentaVertexInput::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
+/*FUNCTION PentaVertexInput::Demarshall{{{1*/
+void  PentaVertexInput::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION PentaVertexInput::Enum{{{1*/
+int PentaVertexInput::Enum(void){
+
+	return PentaVertexInputEnum;
+
+}
+/*}}}*/
+	
+/*PentaVertexInput management*/
+/*FUNCTION PentaVertexInput::copy{{{1*/
+Object* PentaVertexInput::copy() {
+	
+	return new PentaVertexInput(this->enum_type,this->values);
+
+}
+/*}}}*/
+/*FUNCTION PentaVertexInput::EnumType{{{1*/
+int PentaVertexInput::EnumType(void){
+
+	return this->enum_type;
+
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/PentaVertexInput.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/PentaVertexInput.h	(revision 4248)
@@ -19,26 +19,26 @@
 		double values[6];
 
-		/*constructors, destructors: {{{1*/
+		/*PentaVertexInput constructors, destructors: {{{1*/
 		PentaVertexInput();
 		PentaVertexInput(int enum_type,double* values);
 		~PentaVertexInput();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
+		/*}}}*/
+		/*PentaVertexInput management: {{{1*/
 		int   EnumType();
-
 		Input* SpawnSingInput(int  index);
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
 		ElementResult* SpawnResult(int step, double time);
-
 		/*}}}*/
 		/*numerics: {{{1*/
Index: /issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*SingVertexInput constructors and destructor*/
 /*FUNCTION SingVertexInput::SingVertexInput(){{{1*/
 SingVertexInput::SingVertexInput(){
@@ -36,10 +36,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION SingVertexInput::copy{{{1*/
-Object* SingVertexInput::copy() {
-	
-	return new SingVertexInput(this->enum_type,this->value);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION SingVertexInput::Echo {{{1*/
+void SingVertexInput::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -50,4 +48,43 @@
 	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
 	printf("   value: %g\n",this->value);
+}
+/*}}}*/
+/*FUNCTION SingVertexInput::Id{{{1*/
+int    SingVertexInput::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION SingVertexInput::MyRank{{{1*/
+int    SingVertexInput::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION SingVertexInput::Marshall{{{1*/
+void  SingVertexInput::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of SingVertexInput: */
+	enum_value=SingVertexInputEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall SingVertexInput data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION SingVertexInput::MarshallSize{{{1*/
+int   SingVertexInput::MarshallSize(){
+	
+	return sizeof(value)+
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum value
 }
 /*}}}*/
@@ -71,9 +108,4 @@
 }
 /*}}}*/
-/*FUNCTION SingVertexInput::Echo {{{1*/
-void SingVertexInput::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION SingVertexInput::Enum{{{1*/
 int SingVertexInput::Enum(void){
@@ -83,4 +115,13 @@
 }
 /*}}}*/
+/*FUNCTION SingVertexInput::copy{{{1*/
+Object* SingVertexInput::copy() {
+	
+	return new SingVertexInput(this->enum_type,this->value);
+
+}
+/*}}}*/
+
+/*SingVertexInput management*/
 /*FUNCTION SingVertexInput::EnumType{{{1*/
 int SingVertexInput::EnumType(void){
@@ -88,43 +129,4 @@
 	return this->enum_type;
 
-}
-/*}}}*/
-/*FUNCTION SingVertexInput::Id{{{1*/
-int    SingVertexInput::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION SingVertexInput::Marshall{{{1*/
-void  SingVertexInput::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of SingVertexInput: */
-	enum_value=SingVertexInputEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall SingVertexInput data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION SingVertexInput::MarshallSize{{{1*/
-int   SingVertexInput::MarshallSize(){
-	
-	return sizeof(value)+
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION SingVertexInput::MyRank{{{1*/
-int    SingVertexInput::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/SingVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/SingVertexInput.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/SingVertexInput.h	(revision 4248)
@@ -19,26 +19,26 @@
 		double value;
 
-		/*constructors, destructors: {{{1*/
+		/*SingVertexInput constructors, destructors: {{{1*/
 		SingVertexInput();
 		SingVertexInput(int enum_type,double value);
 		~SingVertexInput();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
+		/*}}}*/
+		/*SingVertexInput management: {{{1*/
 		int   EnumType();
-
 		Input* SpawnSingInput(int  index);
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
 		ElementResult* SpawnResult(int step, double time);
-
 		/*}}}*/
 		/*numerics: {{{1*/
Index: /issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*TriaVertexInput constructors and destructor*/
 /*FUNCTION TriaVertexInput::TriaVertexInput(){{{1*/
 TriaVertexInput::TriaVertexInput(){
@@ -38,10 +38,8 @@
 /*}}}*/
 
-/*Object management*/
-/*FUNCTION TriaVertexInput::copy{{{1*/
-Object* TriaVertexInput::copy() {
-	
-	return new TriaVertexInput(this->enum_type,this->values);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION TriaVertexInput::Echo {{{1*/
+void TriaVertexInput::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -52,4 +50,43 @@
 	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
 	printf("   values: [%g %g %g]\n",this->values[0],this->values[1],this->values[2]);
+}
+/*}}}*/
+/*FUNCTION TriaVertexInput::Id{{{1*/
+int    TriaVertexInput::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION TriaVertexInput::MyRank{{{1*/
+int    TriaVertexInput::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION TriaVertexInput::Marshall{{{1*/
+void  TriaVertexInput::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of TriaVertexInput: */
+	enum_value=TriaVertexInputEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall TriaVertexInput data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION TriaVertexInput::MarshallSize{{{1*/
+int   TriaVertexInput::MarshallSize(){
+	
+	return sizeof(values)+
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum value
 }
 /*}}}*/
@@ -73,9 +110,4 @@
 }
 /*}}}*/
-/*FUNCTION TriaVertexInput::Echo {{{1*/
-void TriaVertexInput::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION TriaVertexInput::Enum{{{1*/
 int TriaVertexInput::Enum(void){
@@ -85,4 +117,13 @@
 }
 /*}}}*/
+/*FUNCTION TriaVertexInput::copy{{{1*/
+Object* TriaVertexInput::copy() {
+	
+	return new TriaVertexInput(this->enum_type,this->values);
+
+}
+/*}}}*/
+	
+/*TriaVertexInput management*/
 /*FUNCTION TriaVertexInput::EnumType{{{1*/
 int TriaVertexInput::EnumType(void){
@@ -90,43 +131,4 @@
 	return this->enum_type;
 
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::Id{{{1*/
-int    TriaVertexInput::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION TriaVertexInput::Marshall{{{1*/
-void  TriaVertexInput::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of TriaVertexInput: */
-	enum_value=TriaVertexInputEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall TriaVertexInput data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::MarshallSize{{{1*/
-int   TriaVertexInput::MarshallSize(){
-	
-	return sizeof(values)+
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::MyRank{{{1*/
-int    TriaVertexInput::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
 }
 /*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/TriaVertexInput.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Inputs/TriaVertexInput.h	(revision 4248)
@@ -20,26 +20,26 @@
 		double values[3];
 
-		/*constructors, destructors: {{{1*/
+		/*TriaVertexInput constructors, destructors: {{{1*/
 		TriaVertexInput();
 		TriaVertexInput(int enum_type,double* values);
 		~TriaVertexInput();
 		/*}}}*/
-		/*object management: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Echo();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   MyRank();
 		Object* copy();
+		/*}}}*/
+		/*TriaVertexInput management: {{{1*/
 		int   EnumType();
-
 		Input* SpawnSingInput(int  index);
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
 		ElementResult* SpawnResult(int step, double time);
-
 		/*}}}*/
 		/*numerics: {{{1*/
Index: /issm/trunk/src/c/objects/Loads/Icefront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Icefront.cpp	(revision 4248)
@@ -19,5 +19,5 @@
 /*}}}*/	
 
-/*Object constructors and destructor*/
+/*Icefront constructors and destructor*/
 /*FUNCTION Icefront::Icefront() {{{1*/
 Icefront::Icefront(){
@@ -99,32 +99,4 @@
 
 /*}}}*/
-/*FUNCTION Icefront::copy {{{1*/
-Object* Icefront::copy() {
-	
-	Icefront* icefront=NULL;
-
-	icefront=new Icefront();
-
-	/*copy fields: */
-	icefront->id=this->id;
-	icefront->analysis_type=this->analysis_type;
-	if(this->inputs){
-		icefront->inputs=(Inputs*)this->inputs->Copy();
-	}
-	else{
-		icefront->inputs=new Inputs();
-	}
-	/*point parameters: */
-	icefront->parameters=this->parameters;
-
-	/*now deal with hooks and objects: */
-	icefront->hnodes.copy(&this->hnodes);
-	icefront->helement.copy(&this->helement);
-	icefront->hmatpar.copy(&this->hmatpar);
-
-	return icefront;
-
-}
-/*}}}*/
 /*FUNCTION Icefront::~Icefront() {{{1*/
 Icefront::~Icefront(){
@@ -134,63 +106,5 @@
 /*}}}*/
 
-/*Object marshall*/
-/*FUNCTION Icefront::Configure {{{1*/
-void  Icefront::Configure(Elements* elementsin,Loads* loadsin,DataSet* 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: */
-	hnodes.configure(nodesin);
-	helement.configure(elementsin);
-	hmatpar.configure(materialsin);
-
-	/*point parameters to real dataset: */
-	this->parameters=parametersin;
-}
-/*}}}*/
-/*FUNCTION Icefront::DeepEcho{{{1*/
-void Icefront::DeepEcho(void){
-
-	printf("Icefront:\n");
-	printf("   id: %i\n",id);
-	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
-	hnodes.DeepEcho();
-	helement.DeepEcho();
-	hmatpar.DeepEcho();
-	printf("   parameters\n");
-	parameters->DeepEcho();
-	printf("   inputs\n");
-	inputs->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION Icefront::Demarshall {{{1*/
-void  Icefront::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
-	/*demarshall hooks: */
-	hnodes.Demarshall(&marshalled_dataset);
-	helement.Demarshall(&marshalled_dataset);
-	hmatpar.Demarshall(&marshalled_dataset);
-	
-	/*demarshall inputs: */
-	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
-
-	/*parameters: may not exist even yet, so let Configure handle it: */
-	this->parameters=NULL;
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
+/*Object virtual functions definitions:*/
 /*FUNCTION Icefront::Echo {{{1*/
 void Icefront::Echo(void){
@@ -207,13 +121,27 @@
 }
 /*}}}*/
-/*FUNCTION Icefront::Enum {{{1*/
-int Icefront::Enum(void){
-
-	return IcefrontEnum;
-
+/*FUNCTION Icefront::DeepEcho{{{1*/
+void Icefront::DeepEcho(void){
+
+	printf("Icefront:\n");
+	printf("   id: %i\n",id);
+	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
+	hnodes.DeepEcho();
+	helement.DeepEcho();
+	hmatpar.DeepEcho();
+	printf("   parameters\n");
+	parameters->DeepEcho();
+	printf("   inputs\n");
+	inputs->DeepEcho();
 }
 /*}}}*/
 /*FUNCTION Icefront::Id {{{1*/
 int    Icefront::Id(void){ return id; }
+/*}}}*/
+/*FUNCTION Icefront::MyRank {{{1*/
+int    Icefront::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION Icefront::Marshall {{{1*/
@@ -268,12 +196,84 @@
 }
 /*}}}*/
-/*FUNCTION Icefront::MyRank {{{1*/
-int    Icefront::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*Object functions*/
+/*FUNCTION Icefront::Demarshall {{{1*/
+void  Icefront::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
+
+	/*demarshall hooks: */
+	hnodes.Demarshall(&marshalled_dataset);
+	helement.Demarshall(&marshalled_dataset);
+	hmatpar.Demarshall(&marshalled_dataset);
+	
+	/*demarshall inputs: */
+	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
+
+	/*parameters: may not exist even yet, so let Configure handle it: */
+	this->parameters=NULL;
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION Icefront::Enum {{{1*/
+int Icefront::Enum(void){
+
+	return IcefrontEnum;
+
+}
+/*}}}*/
+/*FUNCTION Icefront::copy {{{1*/
+Object* Icefront::copy() {
+	
+	Icefront* icefront=NULL;
+
+	icefront=new Icefront();
+
+	/*copy fields: */
+	icefront->id=this->id;
+	icefront->analysis_type=this->analysis_type;
+	if(this->inputs){
+		icefront->inputs=(Inputs*)this->inputs->Copy();
+	}
+	else{
+		icefront->inputs=new Inputs();
+	}
+	/*point parameters: */
+	icefront->parameters=this->parameters;
+
+	/*now deal with hooks and objects: */
+	icefront->hnodes.copy(&this->hnodes);
+	icefront->helement.copy(&this->helement);
+	icefront->hmatpar.copy(&this->hmatpar);
+
+	return icefront;
+
+}
+/*}}}*/
+
+/*Load virtual functions definitions:*/
+/*FUNCTION Icefront::Configure {{{1*/
+void  Icefront::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: */
+	hnodes.configure(nodesin);
+	helement.configure(elementsin);
+	hmatpar.configure(materialsin);
+
+	/*point parameters to real dataset: */
+	this->parameters=parametersin;
+}
+/*}}}*/
 /*FUNCTION Icefront::CreateKMatrix {{{1*/
 void  Icefront::CreateKMatrix(Mat Kgg){
@@ -307,4 +307,59 @@
 }
 /*}}}*/
+/*FUNCTION Icefront::PenaltyCreateKMatrix {{{1*/
+void  Icefront::PenaltyCreateKMatrix(Mat Kgg,double kmax){
+	/*do nothing: */
+}
+/*}}}*/
+/*FUNCTION Icefront::PenaltyCreatePVector{{{1*/
+void  Icefront::PenaltyCreatePVector(Vec pg,double kmax){
+	/*do nothing: */
+}
+/*}}}*/
+/*FUNCTION Icefront::InAnalysis(int analysis_type){{{1*/
+bool Icefront::InAnalysis(int in_analysis_type){
+	if (in_analysis_type==this->analysis_type)return true;
+	else return false;
+}
+/*}}}*/
+
+/*Update virtual functions definitions:*/
+/*FUNCTION Icefront::InputUpdateFromVector(double* vector, int name, int type) {{{1*/
+void  Icefront::InputUpdateFromVector(double* vector, int name, int type){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Icefront::InputUpdateFromVector(int* vector, int name, int type) {{{1*/
+void  Icefront::InputUpdateFromVector(int* vector, int name, int type){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Icefront::InputUpdateFromVector(bool* vector, int name, int type) {{{1*/
+void  Icefront::InputUpdateFromVector(bool* vector, int name, int type){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Icefront::InputUpdateFromConstant(double constant, int name) {{{1*/
+void  Icefront::InputUpdateFromConstant(double constant, int name){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Icefront::InputUpdateFromConstant(int constant, int name) {{{1*/
+void  Icefront::InputUpdateFromConstant(int constant, int name){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Icefront::InputUpdateFromConstant(bool constant, int name) {{{1*/
+void  Icefront::InputUpdateFromConstant(bool constant, int name){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Icefront::InputUpdateFromSolution(double* solution) {{{1*/
+void  Icefront::InputUpdateFromSolution(double* solution){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+
+/*Icefront numerics: */
 /*FUNCTION Icefront::CreatePVectorDiagnosticHoriz {{{1*/
 void Icefront::CreatePVectorDiagnosticHoriz( Vec pg){
@@ -725,14 +780,4 @@
 	*pnumberofdofspernode=numberofdofspernode;
 
-}
-/*}}}*/
-/*FUNCTION Icefront::PenaltyCreateKMatrix {{{1*/
-void  Icefront::PenaltyCreateKMatrix(Mat Kgg,double kmax){
-	/*do nothing: */
-}
-/*}}}*/
-/*FUNCTION Icefront::PenaltyCreatePVector{{{1*/
-void  Icefront::PenaltyCreatePVector(Vec pg,double kmax){
-	/*do nothing: */
 }
 /*}}}*/
@@ -1332,44 +1377,2 @@
 }
 /*}}}*/
-/*FUNCTION Icefront::InputUpdateFromVector(double* vector, int name, int type) {{{1*/
-void  Icefront::InputUpdateFromVector(double* vector, int name, int type){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Icefront::InputUpdateFromVector(int* vector, int name, int type) {{{1*/
-void  Icefront::InputUpdateFromVector(int* vector, int name, int type){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Icefront::InputUpdateFromVector(bool* vector, int name, int type) {{{1*/
-void  Icefront::InputUpdateFromVector(bool* vector, int name, int type){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Icefront::InputUpdateFromConstant(double constant, int name) {{{1*/
-void  Icefront::InputUpdateFromConstant(double constant, int name){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Icefront::InputUpdateFromConstant(int constant, int name) {{{1*/
-void  Icefront::InputUpdateFromConstant(int constant, int name){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Icefront::InputUpdateFromConstant(bool constant, int name) {{{1*/
-void  Icefront::InputUpdateFromConstant(bool constant, int name){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Icefront::InputUpdateFromSolution(double* solution) {{{1*/
-void  Icefront::InputUpdateFromSolution(double* solution){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Icefront::InAnalysis(int analysis_type){{{1*/
-bool Icefront::InAnalysis(int in_analysis_type){
-	if (in_analysis_type==this->analysis_type)return true;
-	else return false;
-}
-/*}}}*/
-
Index: /issm/trunk/src/c/objects/Loads/Icefront.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Icefront.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Icefront.h	(revision 4248)
@@ -33,22 +33,21 @@
 		Parameters* parameters;
 
-		/*constructors: {{{1*/
+		/*Icefront constructors, destructors: {{{1*/
 		Icefront();
 		Icefront(int icefront_id,int i, IoModel* iomodel,int analysis_type);
 		~Icefront();
+		/*}}}*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
 		Object* copy();
 		/*}}}*/
-		/*Object virtual functions resolution: {{{1*/
-		void  Configure(Elements* elementsin,Loads* loadsin,DataSet* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
-		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id(); 
-		void  Marshall(char** pmarshalled_dataset);
-		int   MarshallSize();
-		int   MyRank();
-		/*}}}*/
-		/*Update virtual functions resolution: {{{1*/
+		/*Update virtual functions definitions: {{{1*/
 		void  InputUpdateFromVector(double* vector, int name, int type);
 		void  InputUpdateFromVector(int* vector, int name, int type);
@@ -58,9 +57,14 @@
 		void  InputUpdateFromConstant(bool constant, int name);
 		void  InputUpdateFromSolution(double* solution);
+		/*}}}*/
+		/*Load virtual functions definitions: {{{1*/
+		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+		void  CreateKMatrix(Mat Kgg);
+		void  CreatePVector(Vec pg);
+		void  PenaltyCreateKMatrix(Mat Kgg,double kmax);
+		void  PenaltyCreatePVector(Vec pg,double kmax);
 		bool  InAnalysis(int analysis_type);
 		/*}}}*/
-		/*numerics: {{{1*/
-		void  CreateKMatrix(Mat Kgg);
-		void  CreatePVector(Vec pg);
+		/*Load management: {{{1*/
 		void  CreatePVectorDiagnosticHoriz( Vec pg);
 		void  CreatePVectorDiagnosticHorizSegment( Vec pg);
@@ -73,6 +77,4 @@
 		void  QuadPressureLoadStokes(double* pe_g,double rho_water,double rho_ice,double gravity, double* thickness_list, double* bed_list, 
 		                              double* normal1,double* normal2,double* normal3,double* normal4,double* xyz_list);
-		void  PenaltyCreateKMatrix(Mat Kgg,double kmax);
-		void  PenaltyCreatePVector(Vec pg,double kmax);
 		/*}}}*/
 };
Index: /issm/trunk/src/c/objects/Loads/Load.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Load.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Load.h	(revision 4248)
@@ -21,13 +21,8 @@
 
 	public: 
+
 		virtual       ~Load(){};
-		virtual void  Echo()=0;
-		virtual void  DeepEcho()=0;
-		virtual int   Id()=0;
-		virtual int   MyRank()=0;
-		virtual void  Marshall(char** pmarshalled_dataset)=0;
-		virtual int   MarshallSize()=0;
-		virtual void  Demarshall(char** pmarshalled_dataset)=0;
-		virtual void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
+		/*Virtual functions: {{{1*/
+		virtual void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
 		virtual void  CreateKMatrix(Mat Kgg)=0;
 		virtual void  CreatePVector(Vec pg)=0;
@@ -35,4 +30,5 @@
 		virtual void  PenaltyCreatePVector(Vec pg,double kmax)=0;
 		virtual bool  InAnalysis(int analysis_type)=0;
+		/*}}}*/
 };
 #endif
Index: /issm/trunk/src/c/objects/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Numericalflux.cpp	(revision 4248)
@@ -18,5 +18,5 @@
 extern int my_rank;
 
-/*Object constructors and destructor*/
+/*Numericalflux constructors and destructor*/
 /*FUNCTION Numericalflux::Numericalflux(){{{1*/
 Numericalflux::Numericalflux(){
@@ -120,31 +120,4 @@
 }
 /*}}}*/
-/*FUNCTION Numericalflux::copy {{{1*/
-Object* Numericalflux::copy() {
-	
-	Numericalflux* numericalflux=NULL;
-
-	numericalflux=new Numericalflux();
-
-	/*copy fields: */
-	numericalflux->id=this->id;
-	numericalflux->analysis_type=this->analysis_type;
-	if(this->inputs){
-		numericalflux->inputs=(Inputs*)this->inputs->Copy();
-	}
-	else{
-		numericalflux->inputs=new Inputs();
-	}
-	/*point parameters: */
-	numericalflux->parameters=this->parameters;
-
-	/*now deal with hooks and objects: */
-	numericalflux->hnodes.copy(&this->hnodes);
-	numericalflux->helements.copy(&this->helements);
-
-	return numericalflux;
-
-}
-/*}}}*/
 /*FUNCTION Numericalflux::~Numericalflux(){{{1*/
 Numericalflux::~Numericalflux(){
@@ -154,16 +127,8 @@
 /*}}}*/
 
-/*Object marshall*/
-/*FUNCTION Numericalflux::Configure {{{1*/
-void  Numericalflux::Configure(Elements* elementsin,Loads* loadsin,DataSet* 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: */
-	hnodes.configure(nodesin);
-	helements.configure(elementsin);
-
-	/*point parameters to real dataset: */
-	this->parameters=parametersin;
-
+/*Object virtual functions definitions:*/
+/*FUNCTION Numericalflux::Echo {{{1*/
+void Numericalflux::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -183,4 +148,65 @@
 }		
 /*}}}*/
+/*FUNCTION Numericalflux::Id {{{1*/
+int    Numericalflux::Id(void){
+	return id;
+}
+/*}}}*/
+/*FUNCTION Numericalflux::MyRank {{{1*/
+int    Numericalflux::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION Numericalflux::Marshall {{{1*/
+void  Numericalflux::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+	char* marshalled_inputs=NULL;
+	int   marshalled_inputs_size;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Numericalflux: */
+	enum_type=NumericalfluxEnum;
+
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+
+	/*marshall Numericalflux data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
+
+	/*Marshall hooks: */
+	hnodes.Marshall(&marshalled_dataset);
+	helements.Marshall(&marshalled_dataset);
+
+	/*Marshall inputs: */
+	marshalled_inputs_size=inputs->MarshallSize();
+	marshalled_inputs=inputs->Marshall();
+	memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
+	marshalled_dataset+=marshalled_inputs_size;
+
+	/*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
+
+	xfree((void**)&marshalled_inputs);
+
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION Numericalflux::MarshallSize{{{1*/
+int   Numericalflux::MarshallSize(){
+
+	return sizeof(id)
+		+sizeof(analysis_type)
+		+hnodes.MarshallSize()
+		+helements.MarshallSize()
+		+inputs->MarshallSize()
+		+sizeof(int); //sizeof(int) for enum type
+}
+/*}}}*/
 /*FUNCTION Numericalflux::Demarshall {{{1*/
 void  Numericalflux::Demarshall(char** pmarshalled_dataset){
@@ -212,9 +238,4 @@
 }
 /*}}}*/
-/*FUNCTION Numericalflux::Echo {{{1*/
-void Numericalflux::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
 /*FUNCTION Numericalflux::Enum {{{1*/
 int Numericalflux::Enum(void){
@@ -224,62 +245,46 @@
 }
 /*}}}*/
-/*FUNCTION Numericalflux::Marshall {{{1*/
-void  Numericalflux::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_type=0;
-	char* marshalled_inputs=NULL;
-	int   marshalled_inputs_size;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum type of Numericalflux: */
-	enum_type=NumericalfluxEnum;
-
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
-	/*marshall Numericalflux data: */
-	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
-	/*Marshall hooks: */
-	hnodes.Marshall(&marshalled_dataset);
-	helements.Marshall(&marshalled_dataset);
-
-	/*Marshall inputs: */
-	marshalled_inputs_size=inputs->MarshallSize();
-	marshalled_inputs=inputs->Marshall();
-	memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
-	marshalled_dataset+=marshalled_inputs_size;
-
-	/*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
-
-	xfree((void**)&marshalled_inputs);
-
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION Numericalflux::MarshallSize{{{1*/
-int   Numericalflux::MarshallSize(){
-
-	return sizeof(id)
-		+sizeof(analysis_type)
-		+hnodes.MarshallSize()
-		+helements.MarshallSize()
-		+inputs->MarshallSize()
-		+sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Numericalflux::MyRank {{{1*/
-int    Numericalflux::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-
-/*Object functions*/
+/*FUNCTION Numericalflux::copy {{{1*/
+Object* Numericalflux::copy() {
+	
+	Numericalflux* numericalflux=NULL;
+
+	numericalflux=new Numericalflux();
+
+	/*copy fields: */
+	numericalflux->id=this->id;
+	numericalflux->analysis_type=this->analysis_type;
+	if(this->inputs){
+		numericalflux->inputs=(Inputs*)this->inputs->Copy();
+	}
+	else{
+		numericalflux->inputs=new Inputs();
+	}
+	/*point parameters: */
+	numericalflux->parameters=this->parameters;
+
+	/*now deal with hooks and objects: */
+	numericalflux->hnodes.copy(&this->hnodes);
+	numericalflux->helements.copy(&this->helements);
+
+	return numericalflux;
+
+}
+/*}}}*/
+
+/*Load virtual functions definitions:*/
+/*FUNCTION Numericalflux::Configure {{{1*/
+void  Numericalflux::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: */
+	hnodes.configure(nodesin);
+	helements.configure(elementsin);
+
+	/*point parameters to real dataset: */
+	this->parameters=parametersin;
+
+}
+/*}}}*/
 /*FUNCTION Numericalflux::CreateKMatrix {{{1*/
 void  Numericalflux::CreateKMatrix(Mat Kgg){
@@ -300,4 +305,46 @@
 }
 /*}}}*/
+/*FUNCTION Numericalflux::CreatePVector {{{1*/
+void  Numericalflux::CreatePVector(Vec pg){
+
+	int type;
+
+	/*recover type: */
+	inputs->GetParameterValue(&type,TypeEnum);
+
+	if (type==InternalEnum){
+		CreatePVectorInternal(pg);
+	}
+	else if (type==BoundaryEnum){
+		CreatePVectorBoundary(pg);
+	}
+	else ISSMERROR("type not supported yet");
+
+}
+/*}}}*/
+/*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{1*/
+void  Numericalflux::PenaltyCreateKMatrix(Mat Kgg,double kmax){
+
+	/*No stiffness loads applied, do nothing: */
+	return;
+
+}
+/*}}}*/
+/*FUNCTION Numericalflux::PenaltyCreatePVector{{{1*/
+void  Numericalflux::PenaltyCreatePVector(Vec pg,double kmax){
+
+	/*No penalty loads applied, do nothing: */
+	return;
+
+}
+/*}}}*/
+/*FUNCTION Numericalflux::InAnalysis(int analysis_type){{{1*/
+bool Numericalflux::InAnalysis(int in_analysis_type){
+	if (in_analysis_type==this->analysis_type) return true;
+	else return false;
+}
+/*}}}*/
+
+/*Numericalflux management*/
 /*FUNCTION Numericalflux::CreateKMatrixInternal {{{1*/
 void  Numericalflux::CreateKMatrixInternal(Mat Kgg){
@@ -541,22 +588,4 @@
 }
 /*}}}*/
-/*FUNCTION Numericalflux::CreatePVector {{{1*/
-void  Numericalflux::CreatePVector(Vec pg){
-
-	int type;
-
-	/*recover type: */
-	inputs->GetParameterValue(&type,TypeEnum);
-
-	if (type==InternalEnum){
-		CreatePVectorInternal(pg);
-	}
-	else if (type==BoundaryEnum){
-		CreatePVectorBoundary(pg);
-	}
-	else ISSMERROR("type not supported yet");
-
-}
-/*}}}*/
 /*FUNCTION Numericalflux::CreatePVectorInternal{{{1*/
 void  Numericalflux::CreatePVectorInternal(Vec pg){
@@ -684,5 +713,4 @@
 }
 /*}}}*/
-/*}}}*/
 /*FUNCTION Numericalflux::GetB {{{1*/
 void Numericalflux::GetB(double* B, double gauss_coord){
@@ -741,9 +769,4 @@
 }
 /*}}}*/
-/*FUNCTION Numericalflux::Id {{{1*/
-int    Numericalflux::Id(void){
-	return id;
-}
-/*}}}*/
 /*FUNCTION Numericalflux::GetJacobianDeterminant{{{1*/
 void Numericalflux::GetJacobianDeterminant(double* pJdet,double xyz_list[4][3], double gauss_coord){
@@ -831,24 +854,2 @@
 }
 /*}}}*/
-/*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{1*/
-void  Numericalflux::PenaltyCreateKMatrix(Mat Kgg,double kmax){
-
-	/*No stiffness loads applied, do nothing: */
-	return;
-
-}
-/*}}}*/
-/*FUNCTION Numericalflux::PenaltyCreatePVector{{{1*/
-void  Numericalflux::PenaltyCreatePVector(Vec pg,double kmax){
-
-	/*No penalty loads applied, do nothing: */
-	return;
-
-}
-/*}}}*/
-/*FUNCTION Numericalflux::InAnalysis(int analysis_type){{{1*/
-bool Numericalflux::InAnalysis(int in_analysis_type){
-	if (in_analysis_type==this->analysis_type) return true;
-	else return false;
-}
-/*}}}*/
Index: /issm/trunk/src/c/objects/Loads/Numericalflux.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Numericalflux.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Numericalflux.h	(revision 4248)
@@ -28,20 +28,19 @@
 
 
-		/*Constructors {{{1*/
+		/*Numericalflux constructors,destructors {{{1*/
 		Numericalflux();
 		Numericalflux(int numericalflux_id,int i, IoModel* iomodel,int analysis_type);
 		~Numericalflux();
-		Object* copy();
 		/*}}}*/
-		/*Object virtual functions resolution: {{{1*/
-		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
 		/*Update virtual functions resolution: {{{1*/
@@ -54,6 +53,13 @@
 		void    InputUpdateFromSolution(double* solution){ISSMERROR("Not implemented yet!");}
 		/*}}}*/
-		/*Numerics: {{{1*/
+		/*Load virtual functions definitions: {{{1*/
+		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+		void  CreateKMatrix(Mat Kgg);
+		void  CreatePVector(Vec pg);
+		void  PenaltyCreateKMatrix(Mat Kgg,double kmax);
+		void  PenaltyCreatePVector(Vec pg,double kmax);
 		bool  InAnalysis(int analysis_type);
+		/*}}}*/
+		/*Numericalflux management:{{{1*/
 		void  GetJacobianDeterminant(double* pJdet,double xyz_list[4][3], double gauss_coord);
 		void  GetNodalFunctions(double* l1l4, double gauss_coord);
@@ -63,13 +69,8 @@
 		void  GetNormal(double* normal,double xyz_list[4][3]);
 		void  GetParameterValue(double* pp, double* plist, double gauss_coord);
-		
-		void  CreateKMatrix(Mat Kgg);
 		void  CreateKMatrixInternal(Mat Kgg);
 		void  CreateKMatrixBoundary(Mat Kgg);
-		void  CreatePVector(Vec pg);
 		void  CreatePVectorInternal(Vec pg);
 		void  CreatePVectorBoundary(Vec pg);
-		void  PenaltyCreateKMatrix(Mat Kgg,double kmax);
-		void  PenaltyCreatePVector(Vec pg,double kmax);
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 4248)
@@ -18,5 +18,5 @@
 #include "../../Container/Container.h"
 	
-/*Object constructors and destructor*/
+/*Pengrid constructors and destructor*/
 /*FUNCTION Pengrid::constructor {{{1*/
 Pengrid::Pengrid(){
@@ -67,36 +67,4 @@
 }
 /*}}}*/
-/*FUNCTION Icefront::copy {{{1*/
-Object* Pengrid::copy() {
-	
-	Pengrid* pengrid=NULL;
-
-	pengrid=new Pengrid();
-
-	/*copy fields: */
-	pengrid->id=this->id;
-	pengrid->analysis_type=this->analysis_type;
-	if(this->inputs){
-		pengrid->inputs=(Inputs*)this->inputs->Copy();
-	}
-	else{
-		pengrid->inputs=new Inputs();
-	}
-	/*point parameters: */
-	pengrid->parameters=this->parameters;
-
-	/*now deal with hooks and objects: */
-	pengrid->hnode.copy(&this->hnode);
-	pengrid->helement.copy(&this->helement);
-	pengrid->hmatpar.copy(&this->hmatpar);
-
-	//let's not forget internals
-	pengrid->active=this->active=0;
-	pengrid->zigzag_counter=this->zigzag_counter=0;
-
-	return pengrid;
-
-}
-/*}}}*/
 /*FUNCTION Pengrid::destructor {{{1*/
 Pengrid::~Pengrid(){
@@ -104,17 +72,9 @@
 }
 /*}}}1*/
-		
-/*Object management*/
-/*FUNCTION Pengrid::Configure {{{1*/
-void  Pengrid::Configure(Elements* elementsin,Loads* loadsin,DataSet* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
-
-	/*Take care of hooking up all objects for this load, ie links the objects in the hooks to their respective 
-	 * datasets, using internal ids and offsets hidden in hooks: */
-	hnode.configure(nodesin);
-	helement.configure(elementsin);
-	hmatpar.configure(materialsin);
-
-	/*point parameters to real dataset: */
-	this->parameters=parametersin;
+			
+/*Object virtual functions definitions:*/
+/*FUNCTION Pengrid::Echo {{{1*/
+void Pengrid::Echo(void){
+	this->DeepEcho();
 }
 /*}}}1*/
@@ -136,50 +96,12 @@
 }
 /*}}}*/
-/*FUNCTION Pengrid::Demarshall {{{1*/
-void  Pengrid::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-	memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active);
-	memcpy(&zigzag_counter,marshalled_dataset,sizeof(zigzag_counter));marshalled_dataset+=sizeof(zigzag_counter);
-
-	/*demarshall hooks: */
-	hnode.Demarshall(&marshalled_dataset);
-	helement.Demarshall(&marshalled_dataset);
-	hmatpar.Demarshall(&marshalled_dataset);
-	
-	/*demarshall inputs: */
-	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
-
-	/*parameters: may not exist even yet, so let Configure handle it: */
-	this->parameters=NULL;
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION Pengrid::Echo {{{1*/
-void Pengrid::Echo(void){
-	this->DeepEcho();
-}
-/*}}}1*/
-/*FUNCTION Pengrid::Enum {{{1*/
-int Pengrid::Enum(void){
-
-	return PengridEnum;
-}
-/*}}}1*/
 /*FUNCTION Pengrid::Id {{{1*/
 int    Pengrid::Id(void){ return id; }
+/*}}}1*/
+/*FUNCTION Pengrid::MyRank {{{1*/
+int    Pengrid::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}1*/
 /*FUNCTION Pengrid::Marshall {{{1*/
@@ -239,12 +161,90 @@
 }
 /*}}}*/
-/*FUNCTION Pengrid::MyRank {{{1*/
-int    Pengrid::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}1*/
-
-/*Object functions*/
+/*FUNCTION Pengrid::Demarshall {{{1*/
+void  Pengrid::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
+	memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active);
+	memcpy(&zigzag_counter,marshalled_dataset,sizeof(zigzag_counter));marshalled_dataset+=sizeof(zigzag_counter);
+
+	/*demarshall hooks: */
+	hnode.Demarshall(&marshalled_dataset);
+	helement.Demarshall(&marshalled_dataset);
+	hmatpar.Demarshall(&marshalled_dataset);
+	
+	/*demarshall inputs: */
+	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
+
+	/*parameters: may not exist even yet, so let Configure handle it: */
+	this->parameters=NULL;
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION Pengrid::Enum {{{1*/
+int Pengrid::Enum(void){
+
+	return PengridEnum;
+}
+/*}}}1*/
+/*FUNCTION Icefront::copy {{{1*/
+Object* Pengrid::copy() {
+	
+	Pengrid* pengrid=NULL;
+
+	pengrid=new Pengrid();
+
+	/*copy fields: */
+	pengrid->id=this->id;
+	pengrid->analysis_type=this->analysis_type;
+	if(this->inputs){
+		pengrid->inputs=(Inputs*)this->inputs->Copy();
+	}
+	else{
+		pengrid->inputs=new Inputs();
+	}
+	/*point parameters: */
+	pengrid->parameters=this->parameters;
+
+	/*now deal with hooks and objects: */
+	pengrid->hnode.copy(&this->hnode);
+	pengrid->helement.copy(&this->helement);
+	pengrid->hmatpar.copy(&this->hmatpar);
+
+	//let's not forget internals
+	pengrid->active=this->active=0;
+	pengrid->zigzag_counter=this->zigzag_counter=0;
+
+	return pengrid;
+
+}
+/*}}}*/
+
+/*Load virtual functions definitions:*/
+/*FUNCTION Pengrid::Configure {{{1*/
+void  Pengrid::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
+
+	/*Take care of hooking up all objects for this load, ie links the objects in the hooks to their respective 
+	 * datasets, using internal ids and offsets hidden in hooks: */
+	hnode.configure(nodesin);
+	helement.configure(elementsin);
+	hmatpar.configure(materialsin);
+
+	/*point parameters to real dataset: */
+	this->parameters=parametersin;
+}
+/*}}}1*/
 /*FUNCTION Pengrid::CreateKMatrix {{{1*/
 void  Pengrid::CreateKMatrix(Mat Kgg){
@@ -263,4 +263,111 @@
 }
 /*}}}1*/
+/*FUNCTION Pengrid::PenaltyCreateMatrix {{{1*/
+void  Pengrid::PenaltyCreateKMatrix(Mat Kgg,double kmax){
+
+	int analysis_type;
+
+	/*Retrieve parameters: */
+	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+
+	if (analysis_type==DiagnosticStokesAnalysisEnum){
+		PenaltyCreateKMatrixDiagnosticStokes( Kgg,kmax);
+	}
+	else if (analysis_type==ThermalAnalysisEnum){
+		PenaltyCreateKMatrixThermal( Kgg,kmax);
+	}
+	else if (analysis_type==MeltingAnalysisEnum){
+		PenaltyCreateKMatrixMelting( Kgg,kmax);
+	}
+	else{
+		ISSMERROR("analysis %i (%s) not supported yet",analysis_type,EnumAsString(analysis_type));
+	}
+
+}
+/*}}}1*/
+/*FUNCTION Pengrid::PenaltyCreatePVector {{{1*/
+void  Pengrid::PenaltyCreatePVector(Vec pg,double kmax){
+
+	int analysis_type;
+
+	/*Retrieve parameters: */
+	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+
+	if (analysis_type==ThermalAnalysisEnum){
+		PenaltyCreatePVectorThermal( pg,kmax);
+	}
+	else if (analysis_type==MeltingAnalysisEnum){
+		PenaltyCreatePVectorMelting( pg,kmax);
+	}
+	else if (analysis_type==DiagnosticStokesAnalysisEnum){
+
+		/*No loads applied, do nothing: */
+		return;
+
+	}
+	else{
+		ISSMERROR("analysis %i (%s) not supported yet",analysis_type,EnumAsString(analysis_type));
+	}
+
+}
+/*}}}1*/
+/*FUNCTION Pengrid::InAnalysis(int analysis_type){{{1*/
+bool Pengrid::InAnalysis(int in_analysis_type){
+	if (in_analysis_type==this->analysis_type)return true;
+	else return false;
+}
+/*}}}*/
+
+/*Update virtual functions definitions:*/
+/*FUNCTION Pengrid::InputUpdateFromVector(double* vector, int name, int type) {{{1*/
+void  Pengrid::InputUpdateFromVector(double* vector, int name, int type){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Pengrid::InputUpdateFromVector(int* vector, int name, int type) {{{1*/
+void  Pengrid::InputUpdateFromVector(int* vector, int name, int type){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Pengrid::InputUpdateFromVector(bool* vector, int name, int type) {{{1*/
+void  Pengrid::InputUpdateFromVector(bool* vector, int name, int type){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Pengrid::InputUpdateFromConstant(double constant, int name) {{{1*/
+void  Pengrid::InputUpdateFromConstant(double constant, int name){
+	switch(name){
+
+		case MeltingOffsetEnum:
+			inputs->AddInput(new DoubleInput(name,constant));
+			return;
+
+	}
+}
+/*}}}*/
+/*FUNCTION Pengrid::InputUpdateFromConstant(int constant, int name) {{{1*/
+void  Pengrid::InputUpdateFromConstant(int constant, int name){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Pengrid::InputUpdateFromConstant(bool constant, int name) {{{1*/
+void  Pengrid::InputUpdateFromConstant(bool constant, int name){
+
+	switch(name){
+
+		case ResetPenaltiesEnum:
+			if (constant) zigzag_counter=0;
+			return;
+
+	}
+}
+/*}}}*/
+/*FUNCTION Pengrid::InputUpdateFromSolution(double* solution) {{{1*/
+void  Pengrid::InputUpdateFromSolution(double* solution){
+	/*Nothing updated yet*/
+}
+/*}}}*/		
+
+/*Pengrid management:*/
 /*FUNCTION Pengrid::GetDofList {{{1*/
 void  Pengrid::GetDofList(int* doflist,int* pnumberofdofspernode){
@@ -402,27 +509,4 @@
 }
 /*}}}1*/
-/*FUNCTION Pengrid::PenaltyCreateMatrix {{{1*/
-void  Pengrid::PenaltyCreateKMatrix(Mat Kgg,double kmax){
-
-	int analysis_type;
-
-	/*Retrieve parameters: */
-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
-
-	if (analysis_type==DiagnosticStokesAnalysisEnum){
-		PenaltyCreateKMatrixDiagnosticStokes( Kgg,kmax);
-	}
-	else if (analysis_type==ThermalAnalysisEnum){
-		PenaltyCreateKMatrixThermal( Kgg,kmax);
-	}
-	else if (analysis_type==MeltingAnalysisEnum){
-		PenaltyCreateKMatrixMelting( Kgg,kmax);
-	}
-	else{
-		ISSMERROR("analysis %i (%s) not supported yet",analysis_type,EnumAsString(analysis_type));
-	}
-
-}
-/*}}}1*/
 /*FUNCTION Pengrid::PenaltyCreateKMatrixDiagnosticStokes {{{1*/
 void  Pengrid::PenaltyCreateKMatrixDiagnosticStokes(Mat Kgg,double kmax){
@@ -552,30 +636,4 @@
 	/*Add Ke to global matrix Kgg: */
 	MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke,ADD_VALUES);
-}
-/*}}}1*/
-/*FUNCTION Pengrid::PenaltyCreatePVector {{{1*/
-void  Pengrid::PenaltyCreatePVector(Vec pg,double kmax){
-
-	int analysis_type;
-
-	/*Retrieve parameters: */
-	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
-
-	if (analysis_type==ThermalAnalysisEnum){
-		PenaltyCreatePVectorThermal( pg,kmax);
-	}
-	else if (analysis_type==MeltingAnalysisEnum){
-		PenaltyCreatePVectorMelting( pg,kmax);
-	}
-	else if (analysis_type==DiagnosticStokesAnalysisEnum){
-
-		/*No loads applied, do nothing: */
-		return;
-
-	}
-	else{
-		ISSMERROR("analysis %i (%s) not supported yet",analysis_type,EnumAsString(analysis_type));
-	}
-
 }
 /*}}}1*/
@@ -709,6 +767,4 @@
 }
 /*}}}1*/
-
-/*Updates: */
 /*FUNCTION Pengrid::UpdateFromDakota {{{1*/
 void  Pengrid::UpdateFromDakota(void* inputs){
@@ -721,56 +777,2 @@
 }
 /*}}}1*/
-/*FUNCTION Pengrid::InputUpdateFromVector(double* vector, int name, int type) {{{1*/
-void  Pengrid::InputUpdateFromVector(double* vector, int name, int type){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Pengrid::InputUpdateFromVector(int* vector, int name, int type) {{{1*/
-void  Pengrid::InputUpdateFromVector(int* vector, int name, int type){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Pengrid::InputUpdateFromVector(bool* vector, int name, int type) {{{1*/
-void  Pengrid::InputUpdateFromVector(bool* vector, int name, int type){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Pengrid::InputUpdateFromConstant(double constant, int name) {{{1*/
-void  Pengrid::InputUpdateFromConstant(double constant, int name){
-	switch(name){
-
-		case MeltingOffsetEnum:
-			inputs->AddInput(new DoubleInput(name,constant));
-			return;
-
-	}
-}
-/*}}}*/
-/*FUNCTION Pengrid::InputUpdateFromConstant(int constant, int name) {{{1*/
-void  Pengrid::InputUpdateFromConstant(int constant, int name){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Pengrid::InputUpdateFromConstant(bool constant, int name) {{{1*/
-void  Pengrid::InputUpdateFromConstant(bool constant, int name){
-
-	switch(name){
-
-		case ResetPenaltiesEnum:
-			if (constant) zigzag_counter=0;
-			return;
-
-	}
-}
-/*}}}*/
-/*FUNCTION Pengrid::InputUpdateFromSolution(double* solution) {{{1*/
-void  Pengrid::InputUpdateFromSolution(double* solution){
-	/*Nothing updated yet*/
-}
-/*}}}*/
-/*FUNCTION Pengrid::InAnalysis(int analysis_type){{{1*/
-bool Pengrid::InAnalysis(int in_analysis_type){
-	if (in_analysis_type==this->analysis_type)return true;
-	else return false;
-}
-/*}}}*/
Index: /issm/trunk/src/c/objects/Loads/Pengrid.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Pengrid.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Pengrid.h	(revision 4248)
@@ -34,20 +34,19 @@
 	public:
 
-		/*FUNCTION constructors, destructors {{{1*/
+		/*Pengrid constructors, destructors {{{1*/
 		Pengrid();
 		Pengrid(int index, int id, IoModel* iomodel,int analysis_type);
 		~Pengrid();
-		Object* copy();
 		/*}}}*/
-		/*Object virtual functions resolution: {{{1*/
-		void  Configure(Elements* elementsin,Loads* loadsin,DataSet* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
 		/*Update virtual functions resolution: {{{1*/
@@ -60,10 +59,13 @@
 		void  InputUpdateFromSolution(double* solution);
 		/*}}}*/
-		/*FUNCTION element numerical routines {{{1*/
-		bool  InAnalysis(int analysis_type);
+		/*Load virtual functions definitions: {{{1*/
+		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  CreateKMatrix(Mat Kgg);
 		void  CreatePVector(Vec pg);
 		void  PenaltyCreateKMatrix(Mat Kgg,double kmax);
 		void  PenaltyCreatePVector(Vec pg,double kmax);
+		bool  InAnalysis(int analysis_type);
+		/*}}}*/
+		/*Pengrid management {{{1*/
 		void  PenaltyCreateKMatrixDiagnosticStokes(Mat Kgg,double kmax);
 		void  GetDofList(int* doflist,int* pnumberofdofspernode);
@@ -74,6 +76,4 @@
 		void  PenaltyConstrain(int* punstable);
 		void  PenaltyConstrainThermal(int* punstable);
-		
-		/*updates:*/
 		void  UpdateFromDakota(void* inputs);
 		void  UpdateInputs(double* solution);
Index: /issm/trunk/src/c/objects/Loads/Penpair.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Penpair.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Penpair.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../shared/shared.h"
 		
-/*Object constructors and destructor*/
+/*Penpair constructors and destructor*/
 /*FUNCTION Penpair::constructor {{{1*/
 Penpair::Penpair(){
@@ -47,22 +47,4 @@
 }
 /*}}}1*/
-/*FUNCTION Penpair::copy {{{1*/
-Object* Penpair::copy() {
-	
-	Penpair* penpair=NULL;
-
-	penpair=new Penpair();
-
-	/*copy fields: */
-	penpair->id=this->id;
-	penpair->analysis_type=this->analysis_type;
-
-	/*now deal with hooks and objects: */
-	penpair->hnodes.copy(&this->hnodes);
-
-	return penpair;
-
-}
-/*}}}*/
 /*FUNCTION Penpair::destructor {{{1*/
 Penpair::~Penpair(){
@@ -70,13 +52,17 @@
 }
 /*}}}1*/
-		
-/*Object marshall*/
-/*FUNCTION Penpair::Configure {{{1*/
-void  Penpair::Configure(Elements* elementsin,Loads* loadsin,DataSet* 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: */
-	hnodes.configure(nodesin);
-
+
+/*Object virtual functions definitions:*/
+/*FUNCTION Penpair::Echo {{{1*/
+void Penpair::Echo(void){
+
+	int i;
+
+	printf("Penpair:\n");
+	printf("   id: %i\n",id);
+	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
+	hnodes.Echo();
+	
+	return;
 }
 /*}}}1*/
@@ -92,4 +78,48 @@
 }		
 /*}}}1*/
+/*FUNCTION Penpair::Id {{{1*/
+int    Penpair::Id(void){ return id; }
+/*}}}1*/
+/*FUNCTION Penpair::MyRank {{{1*/
+int    Penpair::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}1*/
+/*FUNCTION Penpair::Marshall {{{1*/
+void  Penpair::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_type=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum type of Penpair: */
+	enum_type=PenpairEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*marshall Penpair data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
+
+	/*Marshall hooks*/
+	hnodes.Marshall(&marshalled_dataset);
+
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}1*/
+/*FUNCTION Penpair::MarshallSize {{{1*/
+int   Penpair::MarshallSize(){
+
+	return sizeof(id)+
+		+sizeof(analysis_type)
+		+hnodes.MarshallSize()
+		+sizeof(int); //sizeof(int) for enum type
+}
+/*}}}1*/
 /*FUNCTION Penpair::Demarshall {{{1*/
 void  Penpair::Demarshall(char** pmarshalled_dataset){
@@ -114,17 +144,4 @@
 }
 /*}}}1*/
-/*FUNCTION Penpair::Echo {{{1*/
-void Penpair::Echo(void){
-
-	int i;
-
-	printf("Penpair:\n");
-	printf("   id: %i\n",id);
-	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
-	hnodes.Echo();
-	
-	return;
-}
-/*}}}1*/
 /*FUNCTION Penpair::Enum {{{1*/
 int Penpair::Enum(void){
@@ -133,50 +150,33 @@
 }
 /*}}}1*/
-/*FUNCTION Penpair::Id {{{1*/
-int    Penpair::Id(void){ return id; }
-/*}}}1*/
-/*FUNCTION Penpair::Marshall {{{1*/
-void  Penpair::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_type=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum type of Penpair: */
-	enum_type=PenpairEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	
-	/*marshall Penpair data: */
-	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
-	/*Marshall hooks*/
-	hnodes.Marshall(&marshalled_dataset);
-
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}1*/
-/*FUNCTION Penpair::MarshallSize {{{1*/
-int   Penpair::MarshallSize(){
-
-	return sizeof(id)+
-		+sizeof(analysis_type)
-		+hnodes.MarshallSize()
-		+sizeof(int); //sizeof(int) for enum type
-}
-/*}}}1*/
-/*FUNCTION Penpair::MyRank {{{1*/
-int    Penpair::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}1*/
-
-/*Object functions*/
+/*FUNCTION Penpair::copy {{{1*/
+Object* Penpair::copy() {
+	
+	Penpair* penpair=NULL;
+
+	penpair=new Penpair();
+
+	/*copy fields: */
+	penpair->id=this->id;
+	penpair->analysis_type=this->analysis_type;
+
+	/*now deal with hooks and objects: */
+	penpair->hnodes.copy(&this->hnodes);
+
+	return penpair;
+
+}
+/*}}}*/
+		
+/*Load virtual functions definitions:*/
+/*FUNCTION Penpair::Configure {{{1*/
+void  Penpair::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: */
+	hnodes.configure(nodesin);
+
+}
+/*}}}1*/
 /*FUNCTION Penpair::CreateKMatrix {{{1*/
 void  Penpair::CreateKMatrix(Mat Kgg){
Index: /issm/trunk/src/c/objects/Loads/Penpair.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Penpair.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Penpair.h	(revision 4248)
@@ -24,21 +24,20 @@
 	public:
 
-		/*constructors: {{{1*/
+		/*Penpair constructors, destructors: {{{1*/
 		Penpair();
 		Penpair(int penpair_id,int* penpair_node_ids,int analysis_type);
 		Penpair(int penpair_id,Hook* penpair_hnodes,int analysis_type);
 		~Penpair();
-		Object* copy();
 		/*}}}*/
-		/*Object virtual functions resolution: {{{1*/
-		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
 		/*Update virtual functions resolution: {{{1*/
@@ -51,10 +50,11 @@
 		void  InputUpdateFromSolution(double* solution){ISSMERROR("Not implemented yet!");}
 		/*}}}*/
-		/*numerics: {{{1*/
-		bool  InAnalysis(int analysis_type);
+			/*Load virtual functions definitions: {{{1*/
+		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  CreateKMatrix(Mat Kgg);
 		void  CreatePVector(Vec pg);
 		void  PenaltyCreateKMatrix(Mat Kgg,double kmax);
 		void  PenaltyCreatePVector(Vec pg,double kmax);
+		bool  InAnalysis(int analysis_type);
 		/*}}}*/
 };
Index: /issm/trunk/src/c/objects/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Riftfront.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Riftfront.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*Riftfront constructors and destructor*/
 /*FUNCTION Riftfront::Riftfront(){{{1*/
 Riftfront::Riftfront(){
@@ -94,32 +94,4 @@
 }
 /*}}}1*/
-/*FUNCTION Riftfront::copy {{{1*/
-Object* Riftfront::copy() {
-	
-	Riftfront* riftfront=NULL;
-
-	riftfront=new Riftfront();
-
-	/*copy fields: */
-	riftfront->id=this->id;
-	riftfront->analysis_type=this->analysis_type;
-	if(this->inputs){
-		riftfront->inputs=(Inputs*)this->inputs->Copy();
-	}
-	else{
-		riftfront->inputs=new Inputs();
-	}
-	/*point parameters: */
-	riftfront->parameters=this->parameters;
-
-	/*now deal with hooks and objects: */
-	riftfront->hnodes.copy(&this->hnodes);
-	riftfront->helements.copy(&this->helements);
-	riftfront->hmatpar.copy(&this->hmatpar);
-
-	return riftfront;
-
-}
-/*}}}*/
 /*FUNCTION Riftfront::~Riftfront(){{{1*/
 Riftfront::~Riftfront(){
@@ -129,18 +101,10 @@
 /*}}}*/
 
-/*Object marshall*/
-/*FUNCTION Riftfront::Configure {{{1*/
-void  Riftfront::Configure(Elements* elementsin,Loads* loadsin,DataSet* 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: */
-	hnodes.configure(nodesin);
-	hmatpar.configure(materialsin);
-
-	/*point parameters to real dataset: */
-	this->parameters=parametersin;
-
-}
-/*}}}*/
+/*Object virtual functions definitions:*/
+/*FUNCTION Riftfront::Echo {{{1*/
+void Riftfront::Echo(void){
+	this->DeepEcho();
+}
+/*}}}1*/
 /*FUNCTION Riftfront::DeepEcho{{{1*/
 void Riftfront::DeepEcho(void){
@@ -157,57 +121,12 @@
 }
 /*}}}*/
-/*FUNCTION Riftfront::Demarshall {{{1*/
-void  Riftfront::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
-	memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active);
-	memcpy(&normal,marshalled_dataset,sizeof(normal));marshalled_dataset+=sizeof(normal);
-	memcpy(&length,marshalled_dataset,sizeof(length));marshalled_dataset+=sizeof(length);
-	memcpy(&fraction,marshalled_dataset,sizeof(fraction));marshalled_dataset+=sizeof(fraction);
-	memcpy(&frozen,marshalled_dataset,sizeof(frozen));marshalled_dataset+=sizeof(frozen);
-	memcpy(&counter,marshalled_dataset,sizeof(counter));marshalled_dataset+=sizeof(counter);
-	memcpy(&prestable,marshalled_dataset,sizeof(prestable));marshalled_dataset+=sizeof(prestable);
-	memcpy(&penalty_lock,marshalled_dataset,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock);
-	memcpy(&material_converged,marshalled_dataset,sizeof(material_converged));marshalled_dataset+=sizeof(material_converged);
-
-	/*demarshall hooks: */
-	hnodes.Demarshall(&marshalled_dataset);
-	hmatpar.Demarshall(&marshalled_dataset);
-	
-	/*demarshall inputs: */
-	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
-
-	/*parameters: may not exist even yet, so let Configure handle it: */
-	this->parameters=NULL;
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION Riftfront::Echo {{{1*/
-void Riftfront::Echo(void){
-	this->DeepEcho();
-}
-/*}}}1*/
-/*FUNCTION Riftfront::Enum {{{1*/
-int Riftfront::Enum(void){
-
-	return RiftfrontEnum;
-
-}
-/*}}}1*/
 /*FUNCTION Riftfront::Id {{{1*/
 int    Riftfront::Id(void){ return id; }
+/*}}}1*/
+/*FUNCTION Riftfront::MyRank {{{1*/
+int    Riftfront::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}1*/
 /*FUNCTION Riftfront::Marshall {{{1*/
@@ -279,98 +198,93 @@
 }
 /*}}}*/
-/*FUNCTION Riftfront::MyRank {{{1*/
-int    Riftfront::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}1*/
-
-/*Object functions*/
-/*FUNCTION Riftfront::Constrain {{{1*/
-#define _ZIGZAGCOUNTER_
-
-int   Riftfront::Constrain(int* punstable){
-
-	const int   numgrids        = 2;
-	double      max_penetration;
-	double      penetration;
-	int         activate;
-	int         found;
-	int         unstable;
-	double      vx1;
-	double      vy1;
-	double      vx2;
-	double      vy2;
-	double      fractionincrement;
-
-
-	/*Objects: */
-	Element   **elements        = NULL;
-	Node      **nodes           = NULL;
-	Tria       *tria1           = NULL;
-	Tria       *tria2           = NULL;
-
-	/*Recover hook objects: */
-	elements=(Element**)helements.deliverp();
-	nodes=(Node**)hnodes.deliverp();
-
-	/*enum of element? */
-	if(elements[0]->Enum()!=TriaEnum)ISSMERROR(" only Tria element allowed for Riftfront load!");
-
-	/*recover elements on both side of rift: */
-	tria1=(Tria*)elements[0];
-	tria2=(Tria*)elements[1];
-
-	/*Is this constraint frozen? In which case we don't touch: */
-	if (this->frozen){
-		*punstable=0;
-		return 1;
-	}
-
-	/*recover parameters: */
-	this->inputs->GetParameterValue(&fractionincrement,FractionIncrementEnum);
-
-	/*First recover velocity: */
-	tria1->inputs->GetParameterValue(&vx1,nodes[0],VxEnum);
-	tria2->inputs->GetParameterValue(&vx2,nodes[1],VxEnum);
-	tria1->inputs->GetParameterValue(&vy1,nodes[0],VyEnum);
-	tria2->inputs->GetParameterValue(&vy2,nodes[1],VyEnum);
-
-	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
-	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
-
-	/*activation: */
-	if(penetration<0)activate=1;
-	else  activate=0;
-
-	/*Here, we try to avoid zigzaging. When a penalty activates and deactivates for more than penalty_lock times, 
-	 * we increase the fraction of melange:*/
-	if(this->counter>this->penalty_lock){
-		/*reset counter: */
-		this->counter=0;
-		/*increase melange fraction: */
-		this->fraction+=fractionincrement;
-		if (this->fraction>1)this->fraction=(double)1.0;
-		//printf("riftfront %i fraction: %g\n",this->Id(),this->fraction);
-	}
-
-	//Figure out stability of this penalty
-	if(this->active==activate){
-		unstable=0;
+/*FUNCTION Riftfront::Demarshall {{{1*/
+void  Riftfront::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
+
+	memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active);
+	memcpy(&normal,marshalled_dataset,sizeof(normal));marshalled_dataset+=sizeof(normal);
+	memcpy(&length,marshalled_dataset,sizeof(length));marshalled_dataset+=sizeof(length);
+	memcpy(&fraction,marshalled_dataset,sizeof(fraction));marshalled_dataset+=sizeof(fraction);
+	memcpy(&frozen,marshalled_dataset,sizeof(frozen));marshalled_dataset+=sizeof(frozen);
+	memcpy(&counter,marshalled_dataset,sizeof(counter));marshalled_dataset+=sizeof(counter);
+	memcpy(&prestable,marshalled_dataset,sizeof(prestable));marshalled_dataset+=sizeof(prestable);
+	memcpy(&penalty_lock,marshalled_dataset,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock);
+	memcpy(&material_converged,marshalled_dataset,sizeof(material_converged));marshalled_dataset+=sizeof(material_converged);
+
+	/*demarshall hooks: */
+	hnodes.Demarshall(&marshalled_dataset);
+	hmatpar.Demarshall(&marshalled_dataset);
+	
+	/*demarshall inputs: */
+	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
+
+	/*parameters: may not exist even yet, so let Configure handle it: */
+	this->parameters=NULL;
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION Riftfront::Enum {{{1*/
+int Riftfront::Enum(void){
+
+	return RiftfrontEnum;
+
+}
+/*}}}1*/
+/*FUNCTION Riftfront::copy {{{1*/
+Object* Riftfront::copy() {
+	
+	Riftfront* riftfront=NULL;
+
+	riftfront=new Riftfront();
+
+	/*copy fields: */
+	riftfront->id=this->id;
+	riftfront->analysis_type=this->analysis_type;
+	if(this->inputs){
+		riftfront->inputs=(Inputs*)this->inputs->Copy();
 	}
 	else{
-		unstable=1;
-		this->counter++;
-	}
-
-	//Set penalty flag
-	this->active=activate;
-
-	//if ((penetration>0) & (this->active==1))printf("Riftfront %i wants to be released\n",Id());
-
-	/*assign output pointer: */
-	*punstable=unstable;
-}
-/*}}}1*/
+		riftfront->inputs=new Inputs();
+	}
+	/*point parameters: */
+	riftfront->parameters=this->parameters;
+
+	/*now deal with hooks and objects: */
+	riftfront->hnodes.copy(&this->hnodes);
+	riftfront->helements.copy(&this->helements);
+	riftfront->hmatpar.copy(&this->hmatpar);
+
+	return riftfront;
+
+}
+/*}}}*/
+
+/*Load virtual functions definitions:*/
+/*FUNCTION Riftfront::Configure {{{1*/
+void  Riftfront::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: */
+	hnodes.configure(nodesin);
+	hmatpar.configure(materialsin);
+
+	/*point parameters to real dataset: */
+	this->parameters=parametersin;
+
+}
+/*}}}*/
 /*FUNCTION Riftfront::CreateKMatrix {{{1*/
 void  Riftfront::CreateKMatrix(Mat Kgg){
@@ -381,126 +295,4 @@
 void  Riftfront::CreatePVector(Vec pg){
 	/*do nothing: */
-}
-/*}}}1*/
-/*FUNCTION Riftfront::FreezeConstraints{{{1*/
-void   Riftfront::FreezeConstraints(void){
-
-	/*Just set frozen flag to 1: */
-	this->frozen=1;
-
-}
-/*}}}1*/
-/*FUNCTION Riftfront::GetDofList {{{1*/
-
-void  Riftfront::GetDofList(int* doflist,int* pnumberofdofspernode){
-
-	int i,j;
-	int doflist_per_node[MAXDOFSPERNODE];
-	int numberofdofspernode;
-	Node      **nodes           = NULL;
-	
-	nodes=(Node**)hnodes.deliverp();
-
-	for(i=0;i<MAX_RIFTFRONT_GRIDS;i++){
-		nodes[i]->GetDofList(&doflist_per_node[0],&numberofdofspernode);
-		for(j=0;j<numberofdofspernode;j++){
-			doflist[i*numberofdofspernode+j]=doflist_per_node[j];
-		}
-	}
-
-	/*Assign output pointers:*/
-	*pnumberofdofspernode=numberofdofspernode;
-}
-/*}}}1*/
-/*FUNCTION Riftfront::IsFrozen{{{1*/
-bool   Riftfront::IsFrozen(void){
-
-	/*Just set frozen flag to 1: */
-	if(this->frozen)return 1;
-	else return 0;
-}
-/*}}}1*/
-/*FUNCTION Riftfront::IsMaterialStable {{{1*/
-int   Riftfront::IsMaterialStable(void){
-
-	int found=0;
-	double converged=0;
-
-	this->inputs->GetParameterValue(&converged,ConvergedEnum);
-
-	if(converged){
-		/*ok, material non-linearity has converged. If that was already the case, we keep 
-		 * constraining the rift front. If it was not, and this is the first time the material 
-		 * has converged, we start constraining now!: */
-		this->material_converged=1;
-	}
-
-	return this->material_converged;
-}
-/*}}}1*/
-/*FUNCTION Riftfront::MaxPenetration {{{1*/
-int   Riftfront::MaxPenetration(double* ppenetration){
-
-	const int     numgrids=2;
-	double        max_penetration;
-	double        penetration=0;
-	int           found;
-	double      vx1;
-	double      vy1;
-	double      vx2;
-	double      vy2;
-
-	/*Objects: */
-	Element   **elements        = NULL;
-	Node      **nodes           = NULL;
-	Tria       *tria1           = NULL;
-	Tria       *tria2           = NULL;
-
-	/*Recover hook objects: */
-	elements=(Element**)helements.deliverp();
-	nodes=(Node**)hnodes.deliverp();
-
-	/*enum of element? */
-	if(elements[0]->Enum()!=TriaEnum)ISSMERROR(" only Tria element allowed for Riftfront load!");
-
-	/*recover elements on both side of rift: */
-	tria1=(Tria*)elements[0];
-	tria2=(Tria*)elements[1];
-
-	//initialize: 
-	penetration=-1;
-
-	/*recover velocity: */
-	tria1->inputs->GetParameterValue(&vx1,nodes[0],VxEnum);
-	tria2->inputs->GetParameterValue(&vx2,nodes[1],VxEnum);
-	tria1->inputs->GetParameterValue(&vy1,nodes[0],VyEnum);
-	tria2->inputs->GetParameterValue(&vy2,nodes[1],VyEnum);
-
-	/*Grid 1 faces grid2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
-	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
-
-	/*Now, we return penetration only if we are active!: */
-	if(this->active==0)penetration=-1;
-
-	/*If we are zigzag locked, same thing: */
-	if(this->counter>this->penalty_lock)penetration=-1;
-	
-	/*assign output pointer: */
-	*ppenetration=penetration;
-
-}
-/*}}}1*/
-/*FUNCTION Riftfront::OutputProperties {{{1*/
-void  Riftfront::OutputProperties(Vec riftproperties){
-
-	int row_id=0;
-	double value;
-
-	/*recover id of penalty: */
-	row_id=this->Id()-1; //c indexing, ids were matlab indexed
-	value=(double)this->fraction;
-
-	/*Plug id and fraction  into riftproperties matrix: */
-	VecSetValues(riftproperties,1,&row_id,&value,INSERT_VALUES);
 }
 /*}}}1*/
@@ -744,4 +536,220 @@
 }
 /*}}}1*/
+/*FUNCTION Riftfront::InAnalysis(int analysis_type){{{1*/
+bool Riftfront::InAnalysis(int in_analysis_type){
+	if (in_analysis_type==this->analysis_type) return true;
+	else return false;
+}
+/*}}}*/
+
+/*Riftfront numerics*/
+/*FUNCTION Riftfront::Constrain {{{1*/
+#define _ZIGZAGCOUNTER_
+
+int   Riftfront::Constrain(int* punstable){
+
+	const int   numgrids        = 2;
+	double      max_penetration;
+	double      penetration;
+	int         activate;
+	int         found;
+	int         unstable;
+	double      vx1;
+	double      vy1;
+	double      vx2;
+	double      vy2;
+	double      fractionincrement;
+
+
+	/*Objects: */
+	Element   **elements        = NULL;
+	Node      **nodes           = NULL;
+	Tria       *tria1           = NULL;
+	Tria       *tria2           = NULL;
+
+	/*Recover hook objects: */
+	elements=(Element**)helements.deliverp();
+	nodes=(Node**)hnodes.deliverp();
+
+	/*enum of element? */
+	if(elements[0]->Enum()!=TriaEnum)ISSMERROR(" only Tria element allowed for Riftfront load!");
+
+	/*recover elements on both side of rift: */
+	tria1=(Tria*)elements[0];
+	tria2=(Tria*)elements[1];
+
+	/*Is this constraint frozen? In which case we don't touch: */
+	if (this->frozen){
+		*punstable=0;
+		return 1;
+	}
+
+	/*recover parameters: */
+	this->inputs->GetParameterValue(&fractionincrement,FractionIncrementEnum);
+
+	/*First recover velocity: */
+	tria1->inputs->GetParameterValue(&vx1,nodes[0],VxEnum);
+	tria2->inputs->GetParameterValue(&vx2,nodes[1],VxEnum);
+	tria1->inputs->GetParameterValue(&vy1,nodes[0],VyEnum);
+	tria2->inputs->GetParameterValue(&vy2,nodes[1],VyEnum);
+
+	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
+	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
+
+	/*activation: */
+	if(penetration<0)activate=1;
+	else  activate=0;
+
+	/*Here, we try to avoid zigzaging. When a penalty activates and deactivates for more than penalty_lock times, 
+	 * we increase the fraction of melange:*/
+	if(this->counter>this->penalty_lock){
+		/*reset counter: */
+		this->counter=0;
+		/*increase melange fraction: */
+		this->fraction+=fractionincrement;
+		if (this->fraction>1)this->fraction=(double)1.0;
+		//printf("riftfront %i fraction: %g\n",this->Id(),this->fraction);
+	}
+
+	//Figure out stability of this penalty
+	if(this->active==activate){
+		unstable=0;
+	}
+	else{
+		unstable=1;
+		this->counter++;
+	}
+
+	//Set penalty flag
+	this->active=activate;
+
+	//if ((penetration>0) & (this->active==1))printf("Riftfront %i wants to be released\n",Id());
+
+	/*assign output pointer: */
+	*punstable=unstable;
+}
+/*}}}1*/
+/*FUNCTION Riftfront::FreezeConstraints{{{1*/
+void   Riftfront::FreezeConstraints(void){
+
+	/*Just set frozen flag to 1: */
+	this->frozen=1;
+
+}
+/*}}}1*/
+/*FUNCTION Riftfront::GetDofList {{{1*/
+
+void  Riftfront::GetDofList(int* doflist,int* pnumberofdofspernode){
+
+	int i,j;
+	int doflist_per_node[MAXDOFSPERNODE];
+	int numberofdofspernode;
+	Node      **nodes           = NULL;
+	
+	nodes=(Node**)hnodes.deliverp();
+
+	for(i=0;i<MAX_RIFTFRONT_GRIDS;i++){
+		nodes[i]->GetDofList(&doflist_per_node[0],&numberofdofspernode);
+		for(j=0;j<numberofdofspernode;j++){
+			doflist[i*numberofdofspernode+j]=doflist_per_node[j];
+		}
+	}
+
+	/*Assign output pointers:*/
+	*pnumberofdofspernode=numberofdofspernode;
+}
+/*}}}1*/
+/*FUNCTION Riftfront::IsFrozen{{{1*/
+bool   Riftfront::IsFrozen(void){
+
+	/*Just set frozen flag to 1: */
+	if(this->frozen)return 1;
+	else return 0;
+}
+/*}}}1*/
+/*FUNCTION Riftfront::IsMaterialStable {{{1*/
+int   Riftfront::IsMaterialStable(void){
+
+	int found=0;
+	double converged=0;
+
+	this->inputs->GetParameterValue(&converged,ConvergedEnum);
+
+	if(converged){
+		/*ok, material non-linearity has converged. If that was already the case, we keep 
+		 * constraining the rift front. If it was not, and this is the first time the material 
+		 * has converged, we start constraining now!: */
+		this->material_converged=1;
+	}
+
+	return this->material_converged;
+}
+/*}}}1*/
+/*FUNCTION Riftfront::MaxPenetration {{{1*/
+int   Riftfront::MaxPenetration(double* ppenetration){
+
+	const int     numgrids=2;
+	double        max_penetration;
+	double        penetration=0;
+	int           found;
+	double      vx1;
+	double      vy1;
+	double      vx2;
+	double      vy2;
+
+	/*Objects: */
+	Element   **elements        = NULL;
+	Node      **nodes           = NULL;
+	Tria       *tria1           = NULL;
+	Tria       *tria2           = NULL;
+
+	/*Recover hook objects: */
+	elements=(Element**)helements.deliverp();
+	nodes=(Node**)hnodes.deliverp();
+
+	/*enum of element? */
+	if(elements[0]->Enum()!=TriaEnum)ISSMERROR(" only Tria element allowed for Riftfront load!");
+
+	/*recover elements on both side of rift: */
+	tria1=(Tria*)elements[0];
+	tria2=(Tria*)elements[1];
+
+	//initialize: 
+	penetration=-1;
+
+	/*recover velocity: */
+	tria1->inputs->GetParameterValue(&vx1,nodes[0],VxEnum);
+	tria2->inputs->GetParameterValue(&vx2,nodes[1],VxEnum);
+	tria1->inputs->GetParameterValue(&vy1,nodes[0],VyEnum);
+	tria2->inputs->GetParameterValue(&vy2,nodes[1],VyEnum);
+
+	/*Grid 1 faces grid2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
+	penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1];
+
+	/*Now, we return penetration only if we are active!: */
+	if(this->active==0)penetration=-1;
+
+	/*If we are zigzag locked, same thing: */
+	if(this->counter>this->penalty_lock)penetration=-1;
+	
+	/*assign output pointer: */
+	*ppenetration=penetration;
+
+}
+/*}}}1*/
+/*FUNCTION Riftfront::OutputProperties {{{1*/
+void  Riftfront::OutputProperties(Vec riftproperties){
+
+	int row_id=0;
+	double value;
+
+	/*recover id of penalty: */
+	row_id=this->Id()-1; //c indexing, ids were matlab indexed
+	value=(double)this->fraction;
+
+	/*Plug id and fraction  into riftproperties matrix: */
+	VecSetValues(riftproperties,1,&row_id,&value,INSERT_VALUES);
+}
+/*}}}1*/
 /*FUNCTION Riftfront::Penetration {{{1*/
 int   Riftfront::Penetration(double* ppenetration){
@@ -929,9 +937,2 @@
 }
 /*}}}1*/
-/*FUNCTION Riftfront::InAnalysis(int analysis_type){{{1*/
-bool Riftfront::InAnalysis(int in_analysis_type){
-	if (in_analysis_type==this->analysis_type) return true;
-	else return false;
-}
-/*}}}*/
-
Index: /issm/trunk/src/c/objects/Loads/Riftfront.h
===================================================================
--- /issm/trunk/src/c/objects/Loads/Riftfront.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Loads/Riftfront.h	(revision 4248)
@@ -43,20 +43,19 @@
 
 
-		/*constructors,destructors: {{{1*/
+		/*Riftfrontconstructors,destructors: {{{1*/
 		Riftfront();
 		Riftfront(int riftfront_id,int i, IoModel* iomodel,int analysis_type);
 		~Riftfront();
 		/*}}}*/
-		/*Object virtual functions resolution: {{{1*/
-		void  Configure(Elements* elements,Loads* loads,DataSet* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
 		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
 		/*Update virtual functions resolution: {{{1*/
@@ -69,11 +68,14 @@
 		void    InputUpdateFromSolution(double* solution){ISSMERROR("Not implemented yet!");}
 		/*}}}*/
-		/*numerics: {{{1*/
-		bool  InAnalysis(int analysis_type);
-		void  GetDofList(int* doflist,int* pnumberofdofs);
+		/*Load virtual functions definitions: {{{1*/
+		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  CreateKMatrix(Mat Kgg);
 		void  CreatePVector(Vec pg);
 		void  PenaltyCreateKMatrix(Mat Kgg,double kmax);
 		void  PenaltyCreatePVector(Vec pg,double kmax);
+		bool  InAnalysis(int analysis_type);
+		/*}}}*/
+		/*Riftfront management: {{{1*/
+		void  GetDofList(int* doflist,int* pnumberofdofs);
 		bool  PreStable();
 		void  SetPreStable();
Index: /issm/trunk/src/c/objects/Materials/Material.h
===================================================================
--- /issm/trunk/src/c/objects/Materials/Material.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Materials/Material.h	(revision 4248)
@@ -18,11 +18,4 @@
 	public: 
 		virtual       ~Material(){};
-		virtual void  Echo()=0;
-		virtual void  DeepEcho()=0;
-		virtual int   Id()=0;
-		virtual int   MyRank()=0;
-		virtual void  Marshall(char** pmarshalled_dataset)=0;
-		virtual int   MarshallSize()=0;
-		virtual void  Demarshall(char** pmarshalled_dataset)=0;
 };
 #endif
Index: /issm/trunk/src/c/objects/Materials/Matice.cpp
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Materials/Matice.cpp	(revision 4248)
@@ -16,5 +16,5 @@
 #include "../../include/include.h"
 		
-/*Object constructors and destructor*/
+/*Matice constructors and destructor*/
 /*FUNCTION Matice::Matice(){{{1*/
 Matice::Matice(){
@@ -79,5 +79,34 @@
 /*}}}*/
 
-/*Object marshall*/
+/*Object virtual functions definitions:*/
+/*FUNCTION Matice::Echo {{{1*/
+void Matice::Echo(void){
+
+	printf("Matice:\n");
+	printf("   mid: %i\n",mid);
+	printf("   B: %g\n",B);
+	printf("   n: %g\n",n);
+	return;
+}
+/*}}}*/
+/*FUNCTION Matice::DeepEcho {{{1*/
+void Matice::DeepEcho(void){
+
+	printf("Matice:\n");
+	printf("   mid: %i\n",mid);
+	printf("   B: %g\n",B);
+	printf("   n: %g\n",n);
+	return;
+}		
+/*}}}*/
+/*FUNCTION Matice::Id {{{1*/
+int    Matice::Id(void){ return mid; }
+/*}}}*/
+/*FUNCTION Matice::MyRank {{{1*/
+int    Matice::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
 /*FUNCTION Matice::Marshall {{{1*/
 void  Matice::Marshall(char** pmarshalled_dataset){
@@ -130,6 +159,11 @@
 }
 /*}}}*/
-
-/*Object functions*/
+/*FUNCTION Matice::Enum {{{1*/
+int Matice::Enum(void){
+
+	return MaticeEnum;
+
+}
+/*}}}*/
 /*FUNCTION Matice::copy {{{1*/
 Object* Matice::copy() {
@@ -137,38 +171,10 @@
 }
 /*}}}*/
-/*FUNCTION Matice::DeepEcho {{{1*/
-void Matice::DeepEcho(void){
-
-	printf("Matice:\n");
-	printf("   mid: %i\n",mid);
-	printf("   B: %g\n",B);
-	printf("   n: %g\n",n);
-	return;
-}		
-/*}}}*/
-/*FUNCTION Matice::Echo {{{1*/
-void Matice::Echo(void){
-
-	printf("Matice:\n");
-	printf("   mid: %i\n",mid);
-	printf("   B: %g\n",B);
-	printf("   n: %g\n",n);
-	return;
-}
-/*}}}*/
-/*FUNCTION Matice::Enum {{{1*/
-int Matice::Enum(void){
-
-	return MaticeEnum;
-
-}
-/*}}}*/
+
+/*Matice management*/
 /*FUNCTION Matice::GetB {{{1*/
 double Matice::GetB(){
 	return B;
 }
-/*}}}*/
-/*FUNCTION Matice::Id {{{1*/
-int    Matice::Id(void){ return mid; }
 /*}}}*/
 /*FUNCTION Matice::GetN {{{1*/
@@ -430,10 +436,4 @@
 }
 /*}}}*/
-/*FUNCTION Matice::MyRank {{{1*/
-int    Matice::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
 /*FUNCTION Matice::SetB {{{1*/
 void  Matice::SetB(double B_param){
Index: /issm/trunk/src/c/objects/Materials/Matice.h
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matice.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Materials/Matice.h	(revision 4248)
@@ -21,4 +21,5 @@
 	public:
 
+		/*Matice constructors, destructors: {{{1*/
 		Matice();
 		Matice(int mid,double B,double n);
@@ -26,17 +27,17 @@
 		void Init(int mid,double B,double n);
 		~Matice();
-
-		/*Object virtual functions resolution: {{{1*/
+		/*}}}*/
+		/*Object virtual functions definitions:{{{1 */
 		void  Echo();
-		Object* copy();
 		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   Id(); 
-		int   MyRank();
+		Object* copy();
 		/*}}}*/
-		/*Update virtual functions resolution: {{{1*/
+		/*Update virtual functions definitions: {{{1*/
 		void  InputUpdateFromVector(double* vector, int name, int type);
 		void  InputUpdateFromVector(int* vector, int name, int type);
@@ -47,5 +48,5 @@
 		void  InputUpdateFromSolution(double* solution);
 		/*}}}*/
-		/*Numerics: {{{1*/
+		/*Matice Numerics: {{{1*/
 		void   SetB(double B_param);
 		void   GetViscosity2d(double* pviscosity, double* pepsilon);
Index: /issm/trunk/src/c/objects/Materials/Matpar.cpp
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matpar.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Materials/Matpar.cpp	(revision 4248)
@@ -18,5 +18,5 @@
 
 		
-/*Object constructors and destructor*/
+/*Matpar constructors and destructor*/
 /*FUNCTION Matpar::Matpar() {{{1*/
 Matpar::Matpar(){
@@ -84,31 +84,48 @@
 /*}}}1*/
 
-/*Object marshall*/
-/*FUNCTION Matpar::Demarshall {{{1*/
-void  Matpar::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*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);
-	memcpy(&rho_ice,marshalled_dataset,sizeof(rho_ice));marshalled_dataset+=sizeof(rho_ice);
-	memcpy(&rho_water,marshalled_dataset,sizeof(rho_water));marshalled_dataset+=sizeof(rho_water);
-	memcpy(&heatcapacity,marshalled_dataset,sizeof(heatcapacity));marshalled_dataset+=sizeof(heatcapacity);
-	memcpy(&thermalconductivity,marshalled_dataset,sizeof(thermalconductivity));marshalled_dataset+=sizeof(thermalconductivity);
-	memcpy(&latentheat,marshalled_dataset,sizeof(latentheat));marshalled_dataset+=sizeof(latentheat);
-	memcpy(&beta,marshalled_dataset,sizeof(beta));marshalled_dataset+=sizeof(beta);
-	memcpy(&meltingpoint,marshalled_dataset,sizeof(meltingpoint));marshalled_dataset+=sizeof(meltingpoint);
-	memcpy(&mixed_layer_capacity,marshalled_dataset,sizeof(mixed_layer_capacity));marshalled_dataset+=sizeof(mixed_layer_capacity);
-	memcpy(&thermal_exchange_velocity,marshalled_dataset,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
-	memcpy(&g,marshalled_dataset,sizeof(g));marshalled_dataset+=sizeof(g);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
+/*Object virtual functions definitions:*/
+/*FUNCTION Matpar::Echo {{{1*/
+void Matpar::Echo(void){
+
+	printf("Matpar:\n");
+	printf("   mid: %i\n",mid);
+	printf("   rho_ice: %g\n",rho_ice);
+	printf("   rho_water: %g\n",rho_water);
+	printf("   heatcapacity: %g\n",heatcapacity);
+	printf("   thermalconductivity: %g\n",thermalconductivity);
+	printf("   latentheat: %g\n",latentheat);
+	printf("   beta: %g\n",beta);
+	printf("   meltingpoint: %g\n",meltingpoint);
+	printf("   mixed_layer_capacity: %g\n",mixed_layer_capacity);
+	printf("   thermal_exchange_velocity: %g\n",thermal_exchange_velocity);
+	printf("   g: %g\n",g);
+	return;
+}
+/*}}}1*/
+/*FUNCTION Matpar::DeepEcho {{{1*/
+void Matpar::DeepEcho(void){
+
+	printf("Matpar:\n");
+	printf("   mid: %i\n",mid);
+	printf("   rho_ice: %g\n",rho_ice);
+	printf("   rho_water: %g\n",rho_water);
+	printf("   heatcapacity: %g\n",heatcapacity);
+	printf("   thermalconductivity: %g\n",thermalconductivity);
+	printf("   latentheat: %g\n",latentheat);
+	printf("   beta: %g\n",beta);
+	printf("   meltingpoint: %g\n",meltingpoint);
+	printf("   mixed_layer_capacity: %g\n",mixed_layer_capacity);
+	printf("   thermal_exchange_velocity: %g\n",thermal_exchange_velocity);
+	printf("   g: %g\n",g);
+	return;
+}		
+/*}}}1*/
+/*FUNCTION Matpar::Id {{{1*/
+int    Matpar::Id(void){ return mid; }
+/*}}}1*/
+/*FUNCTION Matpar::MyRank {{{1*/
+int    Matpar::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
 }
 /*}}}1*/
@@ -162,6 +179,39 @@
 }
 /*}}}1*/
-
-/*Object functions*/
+/*FUNCTION Matpar::Demarshall {{{1*/
+void  Matpar::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*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);
+	memcpy(&rho_ice,marshalled_dataset,sizeof(rho_ice));marshalled_dataset+=sizeof(rho_ice);
+	memcpy(&rho_water,marshalled_dataset,sizeof(rho_water));marshalled_dataset+=sizeof(rho_water);
+	memcpy(&heatcapacity,marshalled_dataset,sizeof(heatcapacity));marshalled_dataset+=sizeof(heatcapacity);
+	memcpy(&thermalconductivity,marshalled_dataset,sizeof(thermalconductivity));marshalled_dataset+=sizeof(thermalconductivity);
+	memcpy(&latentheat,marshalled_dataset,sizeof(latentheat));marshalled_dataset+=sizeof(latentheat);
+	memcpy(&beta,marshalled_dataset,sizeof(beta));marshalled_dataset+=sizeof(beta);
+	memcpy(&meltingpoint,marshalled_dataset,sizeof(meltingpoint));marshalled_dataset+=sizeof(meltingpoint);
+	memcpy(&mixed_layer_capacity,marshalled_dataset,sizeof(mixed_layer_capacity));marshalled_dataset+=sizeof(mixed_layer_capacity);
+	memcpy(&thermal_exchange_velocity,marshalled_dataset,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
+	memcpy(&g,marshalled_dataset,sizeof(g));marshalled_dataset+=sizeof(g);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}1*/
+/*FUNCTION Matpar::Enum {{{1*/
+int Matpar::Enum(void){
+
+	return MatparEnum;
+
+}
+/*}}}1*/
 /*FUNCTION Matpar::copy {{{1*/
 Object* Matpar::copy() {
@@ -169,47 +219,6 @@
 }
 /*}}}1*/
-/*FUNCTION Matpar::DeepEcho {{{1*/
-void Matpar::DeepEcho(void){
-
-	printf("Matpar:\n");
-	printf("   mid: %i\n",mid);
-	printf("   rho_ice: %g\n",rho_ice);
-	printf("   rho_water: %g\n",rho_water);
-	printf("   heatcapacity: %g\n",heatcapacity);
-	printf("   thermalconductivity: %g\n",thermalconductivity);
-	printf("   latentheat: %g\n",latentheat);
-	printf("   beta: %g\n",beta);
-	printf("   meltingpoint: %g\n",meltingpoint);
-	printf("   mixed_layer_capacity: %g\n",mixed_layer_capacity);
-	printf("   thermal_exchange_velocity: %g\n",thermal_exchange_velocity);
-	printf("   g: %g\n",g);
-	return;
-}		
-/*}}}1*/
-/*FUNCTION Matpar::Echo {{{1*/
-void Matpar::Echo(void){
-
-	printf("Matpar:\n");
-	printf("   mid: %i\n",mid);
-	printf("   rho_ice: %g\n",rho_ice);
-	printf("   rho_water: %g\n",rho_water);
-	printf("   heatcapacity: %g\n",heatcapacity);
-	printf("   thermalconductivity: %g\n",thermalconductivity);
-	printf("   latentheat: %g\n",latentheat);
-	printf("   beta: %g\n",beta);
-	printf("   meltingpoint: %g\n",meltingpoint);
-	printf("   mixed_layer_capacity: %g\n",mixed_layer_capacity);
-	printf("   thermal_exchange_velocity: %g\n",thermal_exchange_velocity);
-	printf("   g: %g\n",g);
-	return;
-}
-/*}}}1*/
-/*FUNCTION Matpar::Enum {{{1*/
-int Matpar::Enum(void){
-
-	return MatparEnum;
-
-}
-/*}}}1*/
+
+/*Matpar management: */
 /*FUNCTION Matpar::GetBeta {{{1*/
 double Matpar::GetBeta(){
@@ -226,7 +235,4 @@
 	return heatcapacity;
 }
-/*}}}1*/
-/*FUNCTION Matpar::Id {{{1*/
-int    Matpar::Id(void){ return mid; }
 /*}}}1*/
 /*FUNCTION Matpar::GetLatentHeat {{{1*/
@@ -266,10 +272,4 @@
 }
 /*}}}1*/
-/*FUNCTION Matpar::MyRank {{{1*/
-int    Matpar::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}1*/
 /*FUNCTION Matpar::InputUpdateFromVector(double* vector, int name, int type) {{{1*/
 void   Matpar::InputUpdateFromVector(double* vector, int name, int type){
Index: /issm/trunk/src/c/objects/Materials/Matpar.h
===================================================================
--- /issm/trunk/src/c/objects/Materials/Matpar.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Materials/Matpar.h	(revision 4248)
@@ -36,14 +36,14 @@
 		~Matpar();
 
-		/*Object virtual functions resolution: {{{1*/
+		/*Object virtual functions definitions:{{{1 */
 		void  Echo();
 		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
 		void  Demarshall(char** pmarshalled_dataset);
 		int   Enum();
-		int   Id(); 
 		Object* copy();
-		int   MyRank();
 		/*}}}*/
 		/*Update virtual functions resolution: {{{1*/
Index: /issm/trunk/src/c/objects/Node.cpp
===================================================================
--- /issm/trunk/src/c/objects/Node.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Node.cpp	(revision 4248)
@@ -18,6 +18,5 @@
 #include "../include/include.h"
 /*}}}*/
-
-/*Object constructors and destructors: {{{1*/
+/*Node constructors and destructors: {{{1*/
 /*FUNCTION Node::Node() default constructor {{{2*/
 Node::Node(){
@@ -176,23 +175,19 @@
 /*}}}*/
 /*}}}*/
-/*Object management: {{{1*/
-/*FUNCTION Node::Configure {{{2*/
-void  Node::Configure(DataSet* nodesin,Vertices* verticesin){
-
-	int i;
-
-	/*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: */
-	hvertex.configure(verticesin);
-	hupper_node.configure(nodesin);
-
-}
-/*FUNCTION Node::copy {{{2*/
-Object* Node::copy() {
-		
-	return new Node(this->id,this->sid,&this->indexing, &this->hvertex,&this->hupper_node,this->inputs,this->analysis_type);
-
-}
-
+/*Object virtual functions definitions: {{{1*/
+/*FUNCTION Node::Echo{{{2*/
+void Node::Echo(void){
+
+	printf("Node:\n");
+	printf("   id: %i\n",id);
+	printf("   sid: %i\n",sid);
+	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
+	indexing.Echo();
+	printf("   hvertex:     not displayed\n");
+	printf("   hupper_node: not displayed\n");
+	printf("   inputs:      %p\n",inputs);
+
+
+}
 /*}}}*/
 /*FUNCTION Node::DeepEcho{{{2*/
@@ -214,104 +209,12 @@
 }
 /*}}}*/
-/*FUNCTION Node::Demarshall{{{2*/
-void  Node::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
-	memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-	
-	/*demarshall objects: */
-	indexing.Demarshall(&marshalled_dataset);
-	hvertex.Demarshall(&marshalled_dataset);
-	hupper_node.Demarshall(&marshalled_dataset);
-
-	/*demarshall inputs: */
-	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION Node::Echo{{{2*/
-void Node::Echo(void){
-
-	printf("Node:\n");
-	printf("   id: %i\n",id);
-	printf("   sid: %i\n",sid);
-	printf("   analysis_type: %s\n",EnumAsString(analysis_type));
-	indexing.Echo();
-	printf("   hvertex:     not displayed\n");
-	printf("   hupper_node: not displayed\n");
-	printf("   inputs:      %p\n",inputs);
-
-
-}
-/*}}}*/
-/*FUNCTION Node::Enum{{{2*/
-int Node::Enum(void){
-
-	return NodeEnum;
-
-}
-/*}}}*/
-/*FUNCTION Node::GetDof {{{2*/
-int   Node::GetDof(int dofindex){
-
-	return indexing.doflist[dofindex];
-
-}
-/*}}}*/
-/*FUNCTION Node::GetDofList1{{{2*/
-int  Node::GetDofList1(void){
-
-	Vertex* vertex=NULL;
-
-	vertex=(Vertex*)this->hvertex.delivers();
-
-	return vertex->dof;
-}
-/*}}}*/
-/*FUNCTION Node::GetDofList{{{2*/
-void  Node::GetDofList(int* outdoflist,int* pnumberofdofspernode){
-
-	int i;
-	for(i=0;i<this->indexing.numberofdofs;i++){
-		outdoflist[i]=indexing.doflist[i];
-	}
-	/*Assign output pointers:*/
-	*pnumberofdofspernode=this->indexing.numberofdofs;
-}
-/*}}}*/
 /*FUNCTION Node::Id{{{2*/
 int    Node::Id(void){ return id; }
 /*}}}*/
-/*FUNCTION Node::Sid{{{2*/
-int    Node::Sid(void){ return sid; }
-/*}}}*/
-/*FUNCTION Node::GetVertexId {{{2*/
-int   Node::GetVertexId(void){
-
-	Vertex*  vertex=NULL;
-
-	vertex=(Vertex*)hvertex.delivers();
-	return vertex->id;
-}
-/*}}}*/
-/*FUNCTION Node::GetVertexDof {{{2*/
-int   Node::GetVertexDof(void){
-
-	Vertex*  vertex=NULL;
-
-	vertex=(Vertex*)hvertex.delivers();
-	return vertex->dof;
+/*FUNCTION Node::MyRank{{{2*/
+int    Node::MyRank(void){ 
+	extern int my_rank;
+
+	return my_rank; 
 }
 /*}}}*/
@@ -369,4 +272,109 @@
 }
 /*}}}*/
+/*FUNCTION Node::Demarshall{{{2*/
+void  Node::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
+	memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
+	
+	/*demarshall objects: */
+	indexing.Demarshall(&marshalled_dataset);
+	hvertex.Demarshall(&marshalled_dataset);
+	hupper_node.Demarshall(&marshalled_dataset);
+
+	/*demarshall inputs: */
+	inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION Node::Enum{{{2*/
+int Node::Enum(void){
+
+	return NodeEnum;
+
+}
+/*}}}*/
+/*FUNCTION Node::copy {{{2*/
+Object* Node::copy() {
+		
+	return new Node(this->id,this->sid,&this->indexing, &this->hvertex,&this->hupper_node,this->inputs,this->analysis_type);
+
+}
+
+/*}}}*/
+/*}}}*/
+/*Node management: {{{1*/
+/*FUNCTION Node::Configure {{{2*/
+void  Node::Configure(DataSet* nodesin,Vertices* verticesin){
+
+	int i;
+
+	/*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: */
+	hvertex.configure(verticesin);
+	hupper_node.configure(nodesin);
+
+}
+/*FUNCTION Node::GetDof {{{2*/
+int   Node::GetDof(int dofindex){
+
+	return indexing.doflist[dofindex];
+
+}
+/*}}}*/
+/*FUNCTION Node::GetDofList1{{{2*/
+int  Node::GetDofList1(void){
+
+	Vertex* vertex=NULL;
+
+	vertex=(Vertex*)this->hvertex.delivers();
+
+	return vertex->dof;
+}
+/*}}}*/
+/*FUNCTION Node::GetDofList{{{2*/
+void  Node::GetDofList(int* outdoflist,int* pnumberofdofspernode){
+
+	int i;
+	for(i=0;i<this->indexing.numberofdofs;i++){
+		outdoflist[i]=indexing.doflist[i];
+	}
+	/*Assign output pointers:*/
+	*pnumberofdofspernode=this->indexing.numberofdofs;
+}
+/*}}}*/
+/*FUNCTION Node::Sid{{{2*/
+int    Node::Sid(void){ return sid; }
+/*}}}*/
+/*FUNCTION Node::GetVertexId {{{2*/
+int   Node::GetVertexId(void){
+
+	Vertex*  vertex=NULL;
+
+	vertex=(Vertex*)hvertex.delivers();
+	return vertex->id;
+}
+/*}}}*/
+/*FUNCTION Node::GetVertexDof {{{2*/
+int   Node::GetVertexDof(void){
+
+	Vertex*  vertex=NULL;
+
+	vertex=(Vertex*)hvertex.delivers();
+	return vertex->dof;
+}
+/*}}}*/
 /*FUNCTION Node::SetVertexDof {{{2*/
 void   Node::SetVertexDof(int in_dof){
@@ -386,5 +394,5 @@
 /*}}}*/
 /*}}}*/
-/*Object numerics: {{{1*/
+/*Node numerics: {{{1*/
 /*FUNCTION Node::ApplyConstraints{{{2*/
 void  Node::ApplyConstraint(Vec yg,int dof,double value){
@@ -783,11 +791,4 @@
 }
 /*}}}*/
-/*FUNCTION Node::MyRank{{{2*/
-int    Node::MyRank(void){ 
-	extern int my_rank;
-
-	return my_rank; 
-}
-/*}}}*/
 /*FUNCTION Node::InputUpdateFromVector(double* vector, int name, int type){{{2*/
 void  Node::InputUpdateFromVector(double* vector, int name, int type){
Index: /issm/trunk/src/c/objects/Node.h
===================================================================
--- /issm/trunk/src/c/objects/Node.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Node.h	(revision 4248)
@@ -34,5 +34,5 @@
 	public:
 
-		/*FUNCTION constructors, destructors {{{1*/
+		/*Node constructors, destructors {{{1*/
 		Node();
 		Node(int id,int sid, int vertex_id, int upper_node_id, int numberofdofs);
@@ -41,17 +41,16 @@
 		~Node();
 		/*}}}*/
-		/*Object virtual functions resolution: {{{1*/
-		void  Configure(DataSet* nodes,Vertices* vertices);
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id(void); 
-		int   Sid(void); 
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank(void);
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*Update virtual functions resolution: {{{1*/
+		/*Update virtual functions definitions: {{{1*/
 		void  InputUpdateFromVector(double* vector, int name, int type);
 		void  InputUpdateFromVector(int* vector, int name, int type);
@@ -62,5 +61,7 @@
 		void  InputUpdateFromSolution(double* solution){ISSMERROR("Not implemented yet!");}
 		/*}}}*/
-		/*FUNCTION numerical routines {{{1*/
+		/*Node numerical routines {{{1*/
+		void  Configure(DataSet* nodes,Vertices* vertices);
+		int   Sid(void); 
 		int   GetVertexDof(void);
 		int   GetVertexId(void);
@@ -82,5 +83,4 @@
 		double GetZ();
 		double GetSigma();
-		Object* copy();
 		Node* GetUpperNode();
 		int   IsOnBed();
@@ -93,5 +93,5 @@
 		void  VecExtrude(Vec vector,double* vector_serial);
 		/*}}}*/
-		/*FUNCTION DofObject routines {{{1*/
+		/*Dof Object routines {{{1*/
 		void  DistributeDofs(int* pdofcount);
 		void  OffsetDofs(int dofcount);
Index: /issm/trunk/src/c/objects/Object.h
===================================================================
--- /issm/trunk/src/c/objects/Object.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Object.h	(revision 4248)
@@ -15,4 +15,5 @@
 
 	public: 
+
 		virtual       ~Object() {};
 		virtual void  Echo()=0;
@@ -25,4 +26,5 @@
 		virtual int   Enum()=0;
 		virtual Object* copy()=0;
+
 };
 #endif
Index: /issm/trunk/src/c/objects/Params/BoolParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/BoolParam.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/BoolParam.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*BoolParam constructors and destructor*/
 /*FUNCTION BoolParam::BoolParam(){{{1*/
 BoolParam::BoolParam(){
@@ -39,10 +39,8 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION BoolParam::copy{{{1*/
-Object* BoolParam::copy() {
-	
-	return new BoolParam(this->enum_type,this->value);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION BoolParam::Echo {{{1*/
+void BoolParam::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -55,37 +53,12 @@
 }
 /*}}}*/
-/*FUNCTION BoolParam::Demarshall{{{1*/
-void  BoolParam::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION BoolParam::Echo {{{1*/
-void BoolParam::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION BoolParam::Enum{{{1*/
-int BoolParam::Enum(void){
-
-	return BoolParamEnum;
-
-}
-/*}}}*/
 /*FUNCTION BoolParam::Id{{{1*/
 int    BoolParam::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION BoolParam::MyRank{{{1*/
+int    BoolParam::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION BoolParam::Marshall{{{1*/
@@ -119,10 +92,39 @@
 }
 /*}}}*/
-/*FUNCTION BoolParam::MyRank{{{1*/
-int    BoolParam::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
+/*FUNCTION BoolParam::Demarshall{{{1*/
+void  BoolParam::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
 }
 /*}}}*/
+/*FUNCTION BoolParam::Enum{{{1*/
+int BoolParam::Enum(void){
+
+	return BoolParamEnum;
+
+}
+/*}}}*/
+/*FUNCTION BoolParam::copy{{{1*/
+Object* BoolParam::copy() {
+	
+	return new BoolParam(this->enum_type,this->value);
+
+}
+/*}}}*/
+
+/*BoolParam virtual functions definitions: */
 /*FUNCTION BoolParam::GetParameterName(void); {{{1*/
 char* BoolParam::GetParameterName(void){
Index: /issm/trunk/src/c/objects/Params/BoolParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/BoolParam.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/BoolParam.h	(revision 4248)
@@ -35,21 +35,21 @@
 		IssmBool value;
 
-		/*constructors, destructors: {{{1*/
+		/*BoolParam constructors, destructors: {{{1*/
 		BoolParam();
 		BoolParam(int enum_type,IssmBool value);
 		~BoolParam();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*Param methods: {{{1*/
+		/*Param vritual function definitions: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  GetParameterValue(bool* pbool){*pbool=value;}
Index: /issm/trunk/src/c/objects/Params/DoubleMatParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleMatParam.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/DoubleMatParam.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*DoubleMatParam constructors and destructor*/
 /*FUNCTION DoubleMatParam::DoubleMatParam(){{{1*/
 DoubleMatParam::DoubleMatParam(){
@@ -44,9 +44,11 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION DoubleMatParam::copy{{{1*/
-Object* DoubleMatParam::copy() {
-	
-	return new DoubleMatParam(this->enum_type,this->value,this->M,this->N);
+/*Object virtual functions definitions:*/
+/*FUNCTION DoubleMatParam::Echo {{{1*/
+void DoubleMatParam::Echo(void){
+
+	printf("DoubleMatParam:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	printf("   matrix size: %ix%i\n",this->M,this->N);
 
 }
@@ -67,4 +69,47 @@
 }
 /*}}}*/
+/*FUNCTION DoubleMatParam::Id{{{1*/
+int    DoubleMatParam::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION DoubleMatParam::MyRank{{{1*/
+int    DoubleMatParam::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION DoubleMatParam::Marshall{{{1*/
+void  DoubleMatParam::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of DoubleMatParam: */
+	enum_value=DoubleMatParamEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall DoubleMatParam data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+	memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
+	memcpy(marshalled_dataset,value,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION DoubleMatParam::MarshallSize{{{1*/
+int   DoubleMatParam::MarshallSize(){
+	
+	return sizeof(M)
+		+sizeof(N)
+		+M*N*sizeof(double)
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
 /*FUNCTION DoubleMatParam::Demarshall{{{1*/
 void  DoubleMatParam::Demarshall(char** pmarshalled_dataset){
@@ -91,13 +136,4 @@
 }
 /*}}}*/
-/*FUNCTION DoubleMatParam::Echo {{{1*/
-void DoubleMatParam::Echo(void){
-
-	printf("DoubleMatParam:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
-	printf("   matrix size: %ix%i\n",this->M,this->N);
-
-}
-/*}}}*/
 /*FUNCTION DoubleMatParam::Enum{{{1*/
 int DoubleMatParam::Enum(void){
@@ -107,47 +143,13 @@
 }
 /*}}}*/
-/*FUNCTION DoubleMatParam::Id{{{1*/
-int    DoubleMatParam::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION DoubleMatParam::Marshall{{{1*/
-void  DoubleMatParam::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of DoubleMatParam: */
-	enum_value=DoubleMatParamEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall DoubleMatParam data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
-	memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
-	memcpy(marshalled_dataset,value,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleMatParam::MarshallSize{{{1*/
-int   DoubleMatParam::MarshallSize(){
-	
-	return sizeof(M)
-		+sizeof(N)
-		+M*N*sizeof(double)
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION DoubleMatParam::MyRank{{{1*/
-int    DoubleMatParam::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
+/*FUNCTION DoubleMatParam::copy{{{1*/
+Object* DoubleMatParam::copy() {
+	
+	return new DoubleMatParam(this->enum_type,this->value,this->M,this->N);
+
+}
+/*}}}*/
+
+/*DoubleMatParam virtual functions definitions: */
 /*FUNCTION DoubleMatParam::GetParameterValue(double** pdoublearray,int* pM,int* pN){{{1*/
 void  DoubleMatParam::GetParameterValue(double** pdoublearray,int* pM,int* pN){
Index: /issm/trunk/src/c/objects/Params/DoubleMatParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleMatParam.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/DoubleMatParam.h	(revision 4248)
@@ -38,21 +38,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*DoubleMatParam constructors, destructors: {{{1*/
 		DoubleMatParam();
 		DoubleMatParam(int enum_type,IssmDouble* value,int M,int N);
 		~DoubleMatParam();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*Param methods: {{{1*/
+		/*Param vritual function definitions: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  GetParameterValue(bool* pbool){ISSMERROR("DoubleMat param of enum %i (%s) cannot return a bool",enum_type,EnumAsString(enum_type));}
Index: /issm/trunk/src/c/objects/Params/DoubleParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleParam.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/DoubleParam.cpp	(revision 4248)
@@ -17,5 +17,5 @@
 #include "../../include/include.h"
 
-/*Object constructors and destructor*/
+/*DoubleParam constructors and destructor*/
 /*FUNCTION DoubleParam::DoubleParam(){{{1*/
 DoubleParam::DoubleParam(){
@@ -36,10 +36,8 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION DoubleParam::copy{{{1*/
-Object* DoubleParam::copy() {
-	
-	return new DoubleParam(this->enum_type,this->value);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION DoubleParam::Echo {{{1*/
+void DoubleParam::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -52,37 +50,12 @@
 }
 /*}}}*/
-/*FUNCTION DoubleParam::Demarshall{{{1*/
-void  DoubleParam::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION DoubleParam::Echo {{{1*/
-void DoubleParam::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION DoubleParam::Enum{{{1*/
-int DoubleParam::Enum(void){
-
-	return DoubleParamEnum;
-
-}
-/*}}}*/
 /*FUNCTION DoubleParam::Id{{{1*/
 int    DoubleParam::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION DoubleParam::MyRank{{{1*/
+int    DoubleParam::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION DoubleParam::Marshall{{{1*/
@@ -116,10 +89,39 @@
 }
 /*}}}*/
-/*FUNCTION DoubleParam::MyRank{{{1*/
-int    DoubleParam::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
+/*FUNCTION DoubleParam::Demarshall{{{1*/
+void  DoubleParam::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
 }
 /*}}}*/
+/*FUNCTION DoubleParam::Enum{{{1*/
+int DoubleParam::Enum(void){
+
+	return DoubleParamEnum;
+
+}
+/*}}}*/
+/*FUNCTION DoubleParam::copy{{{1*/
+Object* DoubleParam::copy() {
+	
+	return new DoubleParam(this->enum_type,this->value);
+
+}
+/*}}}*/
+
+/*DoubleParam virtual functions definitions: */
 /*FUNCTION DoubleParam::GetParameterName(void); {{{1*/
 char* DoubleParam::GetParameterName(void){
Index: /issm/trunk/src/c/objects/Params/DoubleParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleParam.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/DoubleParam.h	(revision 4248)
@@ -36,21 +36,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*DoubleParam constructors, destructors: {{{1*/
 		DoubleParam();
 		DoubleParam(int enum_type,IssmDouble value);
 		~DoubleParam();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*Param methods: {{{1*/
+		/*Param vritual function definitions: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  GetParameterValue(bool* pbool);
Index: /issm/trunk/src/c/objects/Params/DoubleVecParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleVecParam.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/DoubleVecParam.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*DoubleVecParam constructors and destructor*/
 /*FUNCTION DoubleVecParam::DoubleVecParam(){{{1*/
 DoubleVecParam::DoubleVecParam(){
@@ -43,9 +43,11 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION DoubleVecParam::copy{{{1*/
-Object* DoubleVecParam::copy() {
-	
-	return new DoubleVecParam(this->enum_type,this->values,this->M);
+/*Object virtual functions definitions:*/
+/*FUNCTION DoubleVecParam::Echo {{{1*/
+void DoubleVecParam::Echo(void){
+
+	printf("DoubleVecParam:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	printf("   vector size: %i\n",this->M);
 
 }
@@ -64,4 +66,45 @@
 }
 /*}}}*/
+/*FUNCTION DoubleVecParam::Id{{{1*/
+int    DoubleVecParam::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION DoubleVecParam::MyRank{{{1*/
+int    DoubleVecParam::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION DoubleVecParam::Marshall{{{1*/
+void  DoubleVecParam::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of DoubleVecParam: */
+	enum_value=DoubleVecParamEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall DoubleVecParam data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+	memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION DoubleVecParam::MarshallSize{{{1*/
+int   DoubleVecParam::MarshallSize(){
+	
+	return sizeof(M)
+		+M*sizeof(double)
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
 /*FUNCTION DoubleVecParam::Demarshall{{{1*/
 void  DoubleVecParam::Demarshall(char** pmarshalled_dataset){
@@ -87,13 +130,4 @@
 }
 /*}}}*/
-/*FUNCTION DoubleVecParam::Echo {{{1*/
-void DoubleVecParam::Echo(void){
-
-	printf("DoubleVecParam:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
-	printf("   vector size: %i\n",this->M);
-
-}
-/*}}}*/
 /*FUNCTION DoubleVecParam::Enum{{{1*/
 int DoubleVecParam::Enum(void){
@@ -103,45 +137,13 @@
 }
 /*}}}*/
-/*FUNCTION DoubleVecParam::Id{{{1*/
-int    DoubleVecParam::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION DoubleVecParam::Marshall{{{1*/
-void  DoubleVecParam::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of DoubleVecParam: */
-	enum_value=DoubleVecParamEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall DoubleVecParam data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
-	memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleVecParam::MarshallSize{{{1*/
-int   DoubleVecParam::MarshallSize(){
-	
-	return sizeof(M)
-		+M*sizeof(double)
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION DoubleVecParam::MyRank{{{1*/
-int    DoubleVecParam::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
+/*FUNCTION DoubleVecParam::copy{{{1*/
+Object* DoubleVecParam::copy() {
+	
+	return new DoubleVecParam(this->enum_type,this->values,this->M);
+
+}
+/*}}}*/
+
+/*DoubleVecParam virtual functions definitions: */
 /*FUNCTION DoubleVecParam::GetParameterValue(double** pdoublearray,int* pM){{{1*/
 void  DoubleVecParam::GetParameterValue(double** pdoublearray,int* pM){
Index: /issm/trunk/src/c/objects/Params/DoubleVecParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleVecParam.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/DoubleVecParam.h	(revision 4248)
@@ -36,21 +36,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*DoubleVecParam constructors, destructors: {{{1*/
 		DoubleVecParam();
 		DoubleVecParam(int enum_type,IssmDouble* values,int M);
 		~DoubleVecParam();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*Param methods: {{{1*/
+		/*Param virtual functions definitions: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  GetParameterValue(bool* pbool){ISSMERROR("DoubleVec param of enum %i (%s) cannot return a bool",enum_type,EnumAsString(enum_type));}
@@ -73,10 +73,9 @@
 		void  SetValue(Vec vec){ISSMERROR("DoubleVec param of enum %i (%s) cannot hold a Vec",enum_type,EnumAsString(enum_type));}
 		void  SetValue(Mat mat){ISSMERROR("DoubleVec param of enum %i (%s) cannot hold a Mat",enum_type,EnumAsString(enum_type));}
-
+		
 		char* GetParameterName(void);
 		#ifdef _SERIAL_
 		void  SetMatlabField(mxArray* dataref);
 		#endif
-
 		/*}}}*/
 };
Index: /issm/trunk/src/c/objects/Params/IntParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/IntParam.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/IntParam.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*IntParam constructors and destructor*/
 /*FUNCTION IntParam::IntParam(){{{1*/
 IntParam::IntParam(){
@@ -39,10 +39,8 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION IntParam::copy{{{1*/
-Object* IntParam::copy() {
-	
-	return new IntParam(this->enum_type,this->value);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION IntParam::Echo {{{1*/
+void IntParam::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -55,37 +53,12 @@
 }
 /*}}}*/
-/*FUNCTION IntParam::Demarshall{{{1*/
-void  IntParam::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION IntParam::Echo {{{1*/
-void IntParam::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION IntParam::Enum{{{1*/
-int IntParam::Enum(void){
-
-	return IntParamEnum;
-
-}
-/*}}}*/
 /*FUNCTION IntParam::Id{{{1*/
 int    IntParam::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION IntParam::MyRank{{{1*/
+int    IntParam::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION IntParam::Marshall{{{1*/
@@ -119,10 +92,39 @@
 }
 /*}}}*/
-/*FUNCTION IntParam::MyRank{{{1*/
-int    IntParam::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
+/*FUNCTION IntParam::Demarshall{{{1*/
+void  IntParam::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
 }
 /*}}}*/
+/*FUNCTION IntParam::Enum{{{1*/
+int IntParam::Enum(void){
+
+	return IntParamEnum;
+
+}
+/*}}}*/
+/*FUNCTION IntParam::copy{{{1*/
+Object* IntParam::copy() {
+	
+	return new IntParam(this->enum_type,this->value);
+
+}
+/*}}}*/
+
+/*IntParam virtual functions definitions: */
 /*FUNCTION IntParam::GetParameterName(void); {{{1*/
 char* IntParam::GetParameterName(void){
Index: /issm/trunk/src/c/objects/Params/IntParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/IntParam.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/IntParam.h	(revision 4248)
@@ -35,21 +35,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*IntParam constructors, destructors: {{{1*/
 		IntParam();
 		IntParam(int enum_type,IssmInt value);
 		~IntParam();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*Param methods: {{{1*/
+		/*Param vritual function definitions: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  GetParameterValue(bool* pbool){ISSMERROR("Int param of enum %i (%s) cannot return a bool",enum_type,EnumAsString(enum_type));}
Index: /issm/trunk/src/c/objects/Params/Param.h
===================================================================
--- /issm/trunk/src/c/objects/Params/Param.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/Param.h	(revision 4248)
@@ -30,5 +30,5 @@
 		virtual        ~Param(){};
 
-		/*methods:{{{1*/
+		/*Virtual functions:{{{1*/
 		virtual int   EnumType()=0;
 		virtual void  GetParameterValue(bool* pbool)=0;
@@ -56,5 +56,4 @@
 		virtual void  SetMatlabField(mxArray* dataref)=0;
 		#endif
-
 		/*}}}*/
 
Index: /issm/trunk/src/c/objects/Params/PetscMatParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/PetscMatParam.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/PetscMatParam.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*PetscMatParam constructors and destructor*/
 /*FUNCTION PetscMatParam::PetscMatParam(){{{1*/
 PetscMatParam::PetscMatParam(){
@@ -44,9 +44,10 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION PetscMatParam::copy{{{1*/
-Object* PetscMatParam::copy() {
-	
-	return new PetscMatParam(this->enum_type,this->value);
+/*Object virtual functions definitions:*/
+/*FUNCTION PetscMatParam::Echo {{{1*/
+void PetscMatParam::Echo(void){
+
+	printf("PetscMatParam:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
 
 }
@@ -59,4 +60,67 @@
 	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
 	MatView(value,PETSC_VIEWER_STDOUT_WORLD);
+}
+/*}}}*/
+/*FUNCTION PetscMatParam::Id{{{1*/
+int    PetscMatParam::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION PetscMatParam::MyRank{{{1*/
+int    PetscMatParam::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION PetscMatParam::Marshall{{{1*/
+void  PetscMatParam::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+	int   M,N;
+	double* serial_mat=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of PetscMatParam: */
+	enum_value=PetscMatParamEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall PetscMatParam data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	if(value){
+		MatGetSize(value,&M,&N);
+		MatToSerial(&serial_mat,value);
+		memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+		memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
+		memcpy(marshalled_dataset,serial_mat,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
+	}
+	else{
+		M=0;
+		N=0;
+		memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+		memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
+	}
+	
+	/*Free ressources:*/
+	xfree((void**)&serial_mat);
+
+	/*return:*/
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION PetscMatParam::MarshallSize{{{1*/
+int   PetscMatParam::MarshallSize(){
+
+	int M=0;
+	int N=0;
+	if(value)MatGetSize(value,&M,&N);
+			
+	return sizeof(M)+
+		sizeof(N)+
+		M*N*sizeof(double)+
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum value
 }
 /*}}}*/
@@ -108,12 +172,4 @@
 }
 /*}}}*/
-/*FUNCTION PetscMatParam::Echo {{{1*/
-void PetscMatParam::Echo(void){
-
-	printf("PetscMatParam:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
-
-}
-/*}}}*/
 /*FUNCTION PetscMatParam::Enum{{{1*/
 int PetscMatParam::Enum(void){
@@ -123,67 +179,13 @@
 }
 /*}}}*/
-/*FUNCTION PetscMatParam::Id{{{1*/
-int    PetscMatParam::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION PetscMatParam::Marshall{{{1*/
-void  PetscMatParam::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-	int   M,N;
-	double* serial_mat=NULL;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of PetscMatParam: */
-	enum_value=PetscMatParamEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall PetscMatParam data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	if(value){
-		MatGetSize(value,&M,&N);
-		MatToSerial(&serial_mat,value);
-		memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
-		memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
-		memcpy(marshalled_dataset,serial_mat,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
-	}
-	else{
-		M=0;
-		N=0;
-		memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
-		memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
-	}
-	
-	/*Free ressources:*/
-	xfree((void**)&serial_mat);
-
-	/*return:*/
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION PetscMatParam::MarshallSize{{{1*/
-int   PetscMatParam::MarshallSize(){
-
-	int M=0;
-	int N=0;
-	if(value)MatGetSize(value,&M,&N);
-			
-	return sizeof(M)+
-		sizeof(N)+
-		M*N*sizeof(double)+
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION PetscMatParam::MyRank{{{1*/
-int    PetscMatParam::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
+/*FUNCTION PetscMatParam::copy{{{1*/
+Object* PetscMatParam::copy() {
+	
+	return new PetscMatParam(this->enum_type,this->value);
+
+}
+/*}}}*/
+
+/*PetscMatParam virtual functions definitions: */
 /*FUNCTION PetscMatParam::GetParameterValue(Mat* pvalue){{{1*/
 void  PetscMatParam::GetParameterValue(Mat* poutput){
Index: /issm/trunk/src/c/objects/Params/PetscMatParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/PetscMatParam.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/PetscMatParam.h	(revision 4248)
@@ -36,21 +36,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*PetscMatParam constructors, destructors: {{{1*/
 		PetscMatParam();
 		PetscMatParam(int enum_type,Mat value);
 		~PetscMatParam();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*Param methods: {{{1*/
+		/*Param vritual function definitions: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  GetParameterValue(bool* pbool){ISSMERROR("PetscMat param of enum %i (%s) cannot return a bool",enum_type,EnumAsString(enum_type));}
Index: /issm/trunk/src/c/objects/Params/PetscVecParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/PetscVecParam.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/PetscVecParam.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*PetscVecParam constructors and destructor*/
 /*FUNCTION PetscVecParam::PetscVecParam(){{{1*/
 PetscVecParam::PetscVecParam(){
@@ -45,9 +45,10 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION PetscVecParam::copy{{{1*/
-Object* PetscVecParam::copy() {
-	
-	return new PetscVecParam(this->enum_type,this->value);
+/*Object virtual functions definitions:*/
+/*FUNCTION PetscVecParam::Echo {{{1*/
+void PetscVecParam::Echo(void){
+
+	printf("PetscVecParam:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
 
 }
@@ -62,66 +63,12 @@
 }
 /*}}}*/
-/*FUNCTION PetscVecParam::Demarshall{{{1*/
-void  PetscVecParam::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-	int   M;
-	double* serial_vec=NULL;
-	int*    idxm=NULL;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	
-	/*data: */
-	
-	memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
-	if(M){
-		serial_vec=(double*)xmalloc(M*sizeof(double));
-		memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
-
-		value=NewVec(M);
-		idxm=(int*)xmalloc(M*sizeof(int));
-		for(i=0;i<M;i++)idxm[i]=i;
-		VecSetValues(value,M,idxm,serial_vec,INSERT_VALUES);
-
-		VecAssemblyBegin(value);
-		VecAssemblyEnd(value);
-
-		
-	}
-	else{
-		value=NULL;
-	}
-
-	/*Free ressources:*/
-	xfree((void**)&serial_vec);
-	xfree((void**)&idxm);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION PetscVecParam::Echo {{{1*/
-void PetscVecParam::Echo(void){
-
-	printf("PetscVecParam:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
-
-}
-/*}}}*/
-/*FUNCTION PetscVecParam::Enum{{{1*/
-int PetscVecParam::Enum(void){
-
-	return PetscVecParamEnum;
-
-}
-/*}}}*/
 /*FUNCTION PetscVecParam::Id{{{1*/
 int    PetscVecParam::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION PetscVecParam::MyRank{{{1*/
+int    PetscVecParam::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION PetscVecParam::Marshall{{{1*/
@@ -172,10 +119,65 @@
 }
 /*}}}*/
-/*FUNCTION PetscVecParam::MyRank{{{1*/
-int    PetscVecParam::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
+/*FUNCTION PetscVecParam::Demarshall{{{1*/
+void  PetscVecParam::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+	int   M;
+	double* serial_vec=NULL;
+	int*    idxm=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	
+	/*data: */
+	
+	memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
+	if(M){
+		serial_vec=(double*)xmalloc(M*sizeof(double));
+		memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
+
+		value=NewVec(M);
+		idxm=(int*)xmalloc(M*sizeof(int));
+		for(i=0;i<M;i++)idxm[i]=i;
+		VecSetValues(value,M,idxm,serial_vec,INSERT_VALUES);
+
+		VecAssemblyBegin(value);
+		VecAssemblyEnd(value);
+
+		
+	}
+	else{
+		value=NULL;
+	}
+
+	/*Free ressources:*/
+	xfree((void**)&serial_vec);
+	xfree((void**)&idxm);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION PetscVecParam::Enum{{{1*/
+int PetscVecParam::Enum(void){
+
+	return PetscVecParamEnum;
+
+}
+/*}}}*/
+/*FUNCTION PetscVecParam::copy{{{1*/
+Object* PetscVecParam::copy() {
+	
+	return new PetscVecParam(this->enum_type,this->value);
+
+}
+/*}}}*/
+
+/*PetscVecParam virtual functions definitions: */
 /*FUNCTION PetscVecParam::GetParameterValue(Vec* pvalue){{{1*/
 void  PetscVecParam::GetParameterValue(Vec* poutput){
Index: /issm/trunk/src/c/objects/Params/PetscVecParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/PetscVecParam.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/PetscVecParam.h	(revision 4248)
@@ -36,21 +36,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*PetscVecParam constructors, destructors: {{{1*/
 		PetscVecParam();
 		PetscVecParam(int enum_type,Vec value);
 		~PetscVecParam();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*Param methods: {{{1*/
+		/*Param vritual function definitions: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  GetParameterValue(bool* pbool){ISSMERROR("PetscVec param of enum %i (%s) cannot return a bool",enum_type,EnumAsString(enum_type));}
Index: /issm/trunk/src/c/objects/Params/StringArrayParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/StringArrayParam.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/StringArrayParam.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*StringArrayParam constructors and destructor*/
 /*FUNCTION StringArrayParam::StringArrayParam(){{{1*/
 StringArrayParam::StringArrayParam(){
@@ -60,58 +60,5 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION StringArrayParam::copy{{{1*/
-Object* StringArrayParam::copy() {
-	
-	return new StringArrayParam(this->enum_type,this->value,this->numstrings);
-
-}
-/*}}}*/
-/*FUNCTION StringArrayParam::DeepEcho{{{1*/
-void StringArrayParam::DeepEcho(void){
-
-	int i;
-	char* string=NULL;
-
-	printf("StringArrayParam:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
-	for(i=0;i<this->numstrings;i++){
-		string=this->value[i];
-		printf("   %i: %s\n",i,string);
-	}
-}
-/*}}}*/
-/*FUNCTION StringArrayParam::Demarshall{{{1*/
-void  StringArrayParam::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-	int   stringsize;
-	char* string=NULL;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
-	memcpy(&numstrings,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
-	this->value=(char**)xmalloc(numstrings*sizeof(char*));
-
-	for(i=0;i<numstrings;i++){
-		memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
-	
-		string=(char*)xmalloc(stringsize*sizeof(char));
-		memcpy(string,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-
-		this->value[i]=string;
-	}
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
+/*Object virtual functions definitions:*/
 /*FUNCTION StringArrayParam::Echo {{{1*/
 void StringArrayParam::Echo(void){
@@ -119,68 +66,20 @@
 }
 /*}}}*/
-/*FUNCTION StringArrayParam::Enum{{{1*/
-int StringArrayParam::Enum(void){
-
-	return StringArrayParamEnum;
-
+/*FUNCTION StringArrayParam::DeepEcho{{{1*/
+void StringArrayParam::DeepEcho(void){
+
+	int i;
+	char* string=NULL;
+
+	printf("StringArrayParam:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	for(i=0;i<this->numstrings;i++){
+		string=this->value[i];
+		printf("   %i: %s\n",i,string);
+	}
 }
 /*}}}*/
 /*FUNCTION StringArrayParam::Id{{{1*/
 int    StringArrayParam::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION StringArrayParam::Marshall{{{1*/
-void  StringArrayParam::Marshall(char** pmarshalled_dataset){
-
-	int   i;
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-	int   stringsize;
-	char* string=NULL;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of StringArrayParam: */
-	enum_value=StringArrayParamEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&numstrings,sizeof(numstrings));marshalled_dataset+=sizeof(numstrings);
-	for(i=0;i<numstrings;i++){
-		string=this->value[i];
-		stringsize=strlen(string)+1;
-		
-		memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
-		memcpy(marshalled_dataset,string,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-	}
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION StringArrayParam::MarshallSize{{{1*/
-int   StringArrayParam::MarshallSize(){
-
-	int i;
-	int marshallsize;
-	int stringsize;
-	char* string=NULL;
-
-	marshallsize+=sizeof(numstrings);
-
-	for(i=0;i<numstrings;i++){
-		string=this->value[i];
-		stringsize=strlen(string)+1;
-		marshallsize+=sizeof(stringsize);
-		marshallsize+=stringsize*sizeof(char);
-	}
-	
-	marshallsize+=sizeof(enum_type);
-	marshallsize+=sizeof(int); //sizeof(int) for enum value
-
-	return marshallsize;
-}
 /*}}}*/
 /*FUNCTION StringArrayParam::MyRank{{{1*/
@@ -190,4 +89,107 @@
 }
 /*}}}*/
+/*FUNCTION StringArrayParam::Marshall{{{1*/
+void  StringArrayParam::Marshall(char** pmarshalled_dataset){
+
+	int   i;
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+	int   stringsize;
+	char* string=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of StringArrayParam: */
+	enum_value=StringArrayParamEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&numstrings,sizeof(numstrings));marshalled_dataset+=sizeof(numstrings);
+	for(i=0;i<numstrings;i++){
+		string=this->value[i];
+		stringsize=strlen(string)+1;
+		
+		memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
+		memcpy(marshalled_dataset,string,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+	}
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION StringArrayParam::MarshallSize{{{1*/
+int   StringArrayParam::MarshallSize(){
+
+	int i;
+	int marshallsize;
+	int stringsize;
+	char* string=NULL;
+
+	marshallsize+=sizeof(numstrings);
+
+	for(i=0;i<numstrings;i++){
+		string=this->value[i];
+		stringsize=strlen(string)+1;
+		marshallsize+=sizeof(stringsize);
+		marshallsize+=stringsize*sizeof(char);
+	}
+	
+	marshallsize+=sizeof(enum_type);
+	marshallsize+=sizeof(int); //sizeof(int) for enum value
+
+	return marshallsize;
+}
+/*}}}*/
+/*FUNCTION StringArrayParam::Demarshall{{{1*/
+void  StringArrayParam::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+	int   stringsize;
+	char* string=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+
+	memcpy(&numstrings,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
+	this->value=(char**)xmalloc(numstrings*sizeof(char*));
+
+	for(i=0;i<numstrings;i++){
+		memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
+	
+		string=(char*)xmalloc(stringsize*sizeof(char));
+		memcpy(string,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+
+		this->value[i]=string;
+	}
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION StringArrayParam::Enum{{{1*/
+int StringArrayParam::Enum(void){
+
+	return StringArrayParamEnum;
+
+}
+/*}}}*/
+/*FUNCTION StringArrayParam::copy{{{1*/
+Object* StringArrayParam::copy() {
+	
+	return new StringArrayParam(this->enum_type,this->value,this->numstrings);
+
+}
+/*}}}*/
+
+/*StringArrayParam virtual functions definitions: */
 /*FUNCTION StringArrayParam::GetParameterValue(char*** pstringarray, int* pnumstrings){{{1*/
 void  StringArrayParam::GetParameterValue(char*** pstringarray,int* pM){
Index: /issm/trunk/src/c/objects/Params/StringArrayParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/StringArrayParam.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/StringArrayParam.h	(revision 4248)
@@ -38,21 +38,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*StringArrayParam constructors, destructors: {{{1*/
 		StringArrayParam();
 		StringArrayParam(int enum_type,char** values, int numstrings);
 		~StringArrayParam();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*Param methods: {{{1*/
+		/*Param vritual function definitions: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  GetParameterValue(bool* pbool){ISSMERROR("StringArray param of enum %i (%s) cannot return a bool",enum_type,EnumAsString(enum_type));}
@@ -80,5 +80,4 @@
 		void  SetMatlabField(mxArray* dataref);
 		#endif
-
 		/*}}}*/
 };
Index: /issm/trunk/src/c/objects/Params/StringParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/StringParam.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/StringParam.cpp	(revision 4248)
@@ -20,5 +20,5 @@
 /*}}}*/
 
-/*Object constructors and destructor*/
+/*StringParam constructors and destructor*/
 /*FUNCTION StringParam::StringParam(){{{1*/
 StringParam::StringParam(){
@@ -41,10 +41,8 @@
 /*}}}*/
 
-/*Object methods*/
-/*FUNCTION StringParam::copy{{{1*/
-Object* StringParam::copy() {
-	
-	return new StringParam(this->enum_type,this->value);
-
+/*Object virtual functions definitions:*/
+/*FUNCTION StringParam::Echo {{{1*/
+void StringParam::Echo(void){
+	this->DeepEcho();
 }
 /*}}}*/
@@ -57,42 +55,12 @@
 }
 /*}}}*/
-/*FUNCTION StringParam::Demarshall{{{1*/
-void  StringParam::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-	int   stringsize;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
-	memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
-	
-	this->value=(char*)xmalloc(stringsize*sizeof(char));
-	memcpy(this->value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION StringParam::Echo {{{1*/
-void StringParam::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION StringParam::Enum{{{1*/
-int StringParam::Enum(void){
-
-	return StringParamEnum;
-
-}
-/*}}}*/
 /*FUNCTION StringParam::Id{{{1*/
 int    StringParam::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION StringParam::MyRank{{{1*/
+int    StringParam::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
 /*}}}*/
 /*FUNCTION StringParam::Marshall{{{1*/
@@ -134,10 +102,44 @@
 }
 /*}}}*/
-/*FUNCTION StringParam::MyRank{{{1*/
-int    StringParam::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
+/*FUNCTION StringParam::Demarshall{{{1*/
+void  StringParam::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+	int   stringsize;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+	memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+
+	memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
+	
+	this->value=(char*)xmalloc(stringsize*sizeof(char));
+	memcpy(this->value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
 }
 /*}}}*/
+/*FUNCTION StringParam::Enum{{{1*/
+int StringParam::Enum(void){
+
+	return StringParamEnum;
+
+}
+/*}}}*/
+/*FUNCTION StringParam::copy{{{1*/
+Object* StringParam::copy() {
+	
+	return new StringParam(this->enum_type,this->value);
+
+}
+/*}}}*/
+
+/*StringParam virtual functions definitions: */
 /*FUNCTION StringParam::GetParameterValue(char** pstring){{{1*/
 void  StringParam::GetParameterValue(char** pstring){
Index: /issm/trunk/src/c/objects/Params/StringParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/StringParam.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Params/StringParam.h	(revision 4248)
@@ -36,21 +36,21 @@
 
 	public:
-		/*constructors, destructors: {{{1*/
+		/*StringParam constructors, destructors: {{{1*/
 		StringParam();
 		StringParam(int enum_type,char* value);
 		~StringParam();
 		/*}}}*/
-		/*Object methods: {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id();
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*Param methods: {{{1*/
+		/*Param vritual function definitions: {{{1*/
 		int   EnumType(){return enum_type;}
 		void  GetParameterValue(bool* pbool){ISSMERROR("String param of enum %i (%s) cannot return a bool",enum_type,EnumAsString(enum_type));}
Index: /issm/trunk/src/c/objects/Vertex.cpp
===================================================================
--- /issm/trunk/src/c/objects/Vertex.cpp	(revision 4247)
+++ /issm/trunk/src/c/objects/Vertex.cpp	(revision 4248)
@@ -17,16 +17,16 @@
 /*}}}*/
 
-/*Object constructors and destructor{{{1*/
-/*FUNCTION Vertex::Vertex() {{{2*/
+/*Vertex constructors and destructor:*/
+/*FUNCTION Vertex::Vertex() {{{1*/
 Vertex::Vertex(){
 	return;
 }
 /*}}}*/
-/*FUNCTION Vertex::Vertex(int vertex_id, double vertex_x, double vertex_y, double vertex_z, double vertex_sigma){{{2*/
+/*FUNCTION Vertex::Vertex(int vertex_id, double vertex_x, double vertex_y, double vertex_z, double vertex_sigma){{{1*/
 Vertex::Vertex(int vertex_id, int vertex_sid,double vertex_x, double vertex_y, double vertex_z, double vertex_sigma){
 	this->Init(vertex_id, vertex_sid,vertex_x, vertex_y, vertex_z, vertex_sigma);
 }
 /*}}}*/
-/*FUNCTION Vertex::Init{{{2*/
+/*FUNCTION Vertex::Init{{{1*/
 void Vertex::Init(int vertex_id, int vertex_sid,double vertex_x, double vertex_y, double vertex_z, double vertex_sigma){
 
@@ -43,5 +43,5 @@
 }
 /*}}}*/
-/*FUNCTION Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel) {{{2*/
+/*FUNCTION Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel) {{{1*/
 Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel){
 
@@ -50,52 +50,12 @@
 }
 /*}}}*/
-/*FUNCTION Vertex::~Vertex() {{{2*/
+/*FUNCTION Vertex::~Vertex() {{{1*/
 Vertex::~Vertex(){
 	return;
 }
 /*}}}*/
-/*}}}*/
-/*Object management {{{1*/
-/*FUNCTION copy {{{2*/
-Object* Vertex::copy() {
-
-	return new Vertex(*this); 
-
-}
-/*}}}*/
-/*FUNCTION DeepEcho{{{2*/
-
-void Vertex::DeepEcho(void){
-	this->Echo();
-}
-/*}}}*/
-/*FUNCTION Demarshall {{{2*/
-void  Vertex::Demarshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   i;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
-	 *object data (thanks to DataSet::Demarshall):*/
-
-	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
-	memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
-	memcpy(&x,marshalled_dataset,sizeof(x));marshalled_dataset+=sizeof(x);
-	memcpy(&y,marshalled_dataset,sizeof(y));marshalled_dataset+=sizeof(y);
-	memcpy(&z,marshalled_dataset,sizeof(z));marshalled_dataset+=sizeof(z);
-	memcpy(&sigma,marshalled_dataset,sizeof(sigma));marshalled_dataset+=sizeof(sigma);
-	memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
-	memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-/*FUNCTION Echo{{{2*/
-
+
+/*Object virtual functions definitions:*/
+/*FUNCTION Echo{{{1*/
 void Vertex::Echo(void){
 
@@ -113,18 +73,20 @@
 }
 /*}}}*/
-/*FUNCTION Enum {{{2*/
-int Vertex::Enum(void){
-
-	return VertexEnum;
-
-}
-/*}}}*/
-/*FUNCTION Id{{{2*/
+/*FUNCTION DeepEcho{{{1*/
+
+void Vertex::DeepEcho(void){
+	this->Echo();
+}
+/*}}}*/
+/*FUNCTION Id{{{1*/
 int    Vertex::Id(void){ return id; }
 /*}}}*/
-/*FUNCTION Sid{{{2*/
-int    Vertex::Sid(void){ return sid; }
-/*}}}*/
-/*FUNCTION Marshall {{{2*/
+/*FUNCTION MyRank {{{1*/
+int    Vertex::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+/*FUNCTION Marshall {{{1*/
 void  Vertex::Marshall(char** pmarshalled_dataset){
 
@@ -155,5 +117,5 @@
 }
 /*}}}*/
-/*FUNCTION MarshallSize {{{2*/
+/*FUNCTION MarshallSize {{{1*/
 int   Vertex::MarshallSize(){
 	
@@ -169,28 +131,47 @@
 }
 /*}}}*/
-/*FUNCTION MyRank {{{2*/
-int    Vertex::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-/*FUNCTION UpdateFromDakota {{{2*/
-void  Vertex::UpdateFromDakota(void* vinputs){
-
-	ISSMERROR("not supported yet!");
-	
-}
-/*}}}*/
-/*FUNCTION UpdateVertexPosition {{{2*/
-void  Vertex::UpdatePosition(double* thickness,double* bed){
-
-	/*sigma remains constant. z=bed+sigma*thickness*/
-	this->z=bed[dof]+sigma*thickness[this->dof];
-
-}
-/*}}}*/
-/*}}}*/
-/* DofObject routines: {{{1*/
-/*FUNCTION Vertex DistributeDofs{{{2*/
+/*FUNCTION Demarshall {{{1*/
+void  Vertex::Demarshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   i;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*this time, no need to get enum type, the pointer directly points to the beginning of the 
+	 *object data (thanks to DataSet::Demarshall):*/
+
+	memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
+	memcpy(&x,marshalled_dataset,sizeof(x));marshalled_dataset+=sizeof(x);
+	memcpy(&y,marshalled_dataset,sizeof(y));marshalled_dataset+=sizeof(y);
+	memcpy(&z,marshalled_dataset,sizeof(z));marshalled_dataset+=sizeof(z);
+	memcpy(&sigma,marshalled_dataset,sizeof(sigma));marshalled_dataset+=sizeof(sigma);
+	memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
+	memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+/*FUNCTION Enum {{{1*/
+int Vertex::Enum(void){
+
+	return VertexEnum;
+
+}
+/*}}}*/
+/*FUNCTION copy {{{1*/
+Object* Vertex::copy() {
+
+	return new Vertex(*this); 
+
+}
+/*}}}*/
+
+/* DofObject routines: */
+/*FUNCTION Vertex DistributeDofs{{{1*/
 void  Vertex::DistributeDofs(int* pdofcount){
 
@@ -215,5 +196,5 @@
 }
 /*}}}*/
-/*FUNCTION Vertex OffsetDofs{{{2*/
+/*FUNCTION Vertex OffsetDofs{{{1*/
 void  Vertex::OffsetDofs(int dofcount){
 	
@@ -230,5 +211,5 @@
 }
 /*}}}*/
-/*FUNCTION Vertex ShowTrueDofs{{{2*/
+/*FUNCTION Vertex ShowTrueDofs{{{1*/
 void  Vertex::ShowTrueDofs(int* truedofs){
 
@@ -244,5 +225,5 @@
 }
 /*}}}*/
-/*FUNCTION Vertex UpdateCloneDofs{{{2*/
+/*FUNCTION Vertex UpdateCloneDofs{{{1*/
 void  Vertex::UpdateCloneDofs(int* alltruedofs){
 
@@ -258,5 +239,5 @@
 }
 /*}}}*/
-/*FUNCTION Vertex SetClone {{{2*/
+/*FUNCTION Vertex SetClone {{{1*/
 void  Vertex::SetClone(int* minranks){
 
@@ -274,5 +255,5 @@
 }
 /*}}}*/
-/*FUNCTION Vertex CreatePartition{{{2*/
+/*FUNCTION Vertex CreatePartition{{{1*/
 void  Vertex::CreatePartition(Vec partition){ 
 
@@ -289,3 +270,23 @@
 }
 /*}}}*/
-/*}}}*/
+
+/*Vertex management: */
+/*FUNCTION Sid{{{1*/
+int    Vertex::Sid(void){ return sid; }
+/*}}}*/
+/*FUNCTION UpdateFromDakota {{{1*/
+void  Vertex::UpdateFromDakota(void* vinputs){
+
+	ISSMERROR("not supported yet!");
+	
+}
+/*}}}*/
+/*FUNCTION UpdateVertexPosition {{{1*/
+void  Vertex::UpdatePosition(double* thickness,double* bed){
+
+	/*sigma remains constant. z=bed+sigma*thickness*/
+	this->z=bed[dof]+sigma*thickness[this->dof];
+
+}
+/*}}}*/
+
Index: /issm/trunk/src/c/objects/Vertex.h
===================================================================
--- /issm/trunk/src/c/objects/Vertex.h	(revision 4247)
+++ /issm/trunk/src/c/objects/Vertex.h	(revision 4248)
@@ -32,5 +32,5 @@
 		int    dof; //dof to recover values in a vertex indexed vector
 
-		/*FUNCTION constructors, destructors {{{1*/
+		/*Vertex constructors, destructors {{{1*/
 		Vertex();
 		Vertex(int id, int sid,double x, double y, double z, double sigma); 
@@ -39,19 +39,16 @@
 		~Vertex();
 		/*}}}*/
-		/*FUNCTION object management {{{1*/
-		Object* copy();
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
 		void  DeepEcho();
-		void  Demarshall(char** pmarshalled_dataset);
-		void  Echo();
-		int   Enum();
-		int   Id(void); 
-		int   Sid(void); 
+		int   Id(); 
+		int   MyRank();
 		void  Marshall(char** pmarshalled_dataset);
 		int   MarshallSize();
-		int   MyRank();
-		void  UpdateFromDakota(void* vinputs);
-		void  UpdatePosition(double* thickness,double* bed);
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		Object* copy();
 		/*}}}*/
-		/*FUNCTION DofObject routines {{{1*/
+		/*DofObject routines {{{1*/
 		void  DistributeDofs(int* pdofcount);
 		void  OffsetDofs(int dofcount);
@@ -61,5 +58,9 @@
 		void  CreatePartition(Vec partition);
 		/*}}}*/
-
+		/*Vertex management: {{{1*/
+		int   Sid(void); 
+		void  UpdateFromDakota(void* vinputs);
+		void  UpdatePosition(double* thickness,double* bed);
+		/*}}}*/
 };
 #endif  /* _VERTEX_H */
