Index: /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.cpp	(revision 4050)
@@ -0,0 +1,163 @@
+/*!\file BeamVertexElementResult.c
+ * \brief: implementation of the BeamVertexElementResult object
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "./ElementResultLocal.h"
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+
+/*Object constructors and destructor*/
+/*FUNCTION BeamVertexElementResult::BeamVertexElementResult(){{{1*/
+BeamVertexElementResult::BeamVertexElementResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION BeamVertexElementResult::BeamVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time){{{1*/
+BeamVertexElementResult::BeamVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time):BeamVertexInput(in_enum_type,in_values){
+
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION BeamVertexElementResult::~BeamVertexElementResult(){{{1*/
+BeamVertexElementResult::~BeamVertexElementResult(){
+	return;
+}
+/*}}}*/
+
+/*Object management*/
+/*FUNCTION BeamVertexElementResult::copy{{{1*/
+Object* BeamVertexElementResult::copy() {
+	
+	return new BeamVertexElementResult(this->enum_type,this->values,this->step,this->time);
+
+}
+/*}}}*/
+/*FUNCTION BeamVertexElementResult::DeepEcho{{{1*/
+void BeamVertexElementResult::DeepEcho(void){
+		
+	printf("BeamVertexElementResult:\n");
+	BeamVertexElementResult::DeepEcho();
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+
+}
+/*}}}*/
+/*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::Marshall{{{1*/
+void  BeamVertexElementResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of BeamVertexElementResult: */
+	enum_value=BeamVertexElementResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall BeamVertexElementResult 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 BeamVertexElementResult::MarshallSize{{{1*/
+int   BeamVertexElementResult::MarshallSize(){
+	
+	return sizeof(values)+
+		+sizeof(enum_type)
+		+sizeof(time)
+		+sizeof(step)
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION BeamVertexElementResult::MyRank{{{1*/
+int    BeamVertexElementResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+
+/*ElementResult functions*/
+/*FUNCTION BeamVertexElementResult::ProcessUnits(Parameters* parameters){{{1*/
+void BeamVertexElementResult::ProcessUnits(Parameters* parameters){
+	
+	NodalValuesUnitConversion(this->values,2,this->enum_type,parameters);
+
+}
+/*}}}*/
+/*FUNCTION BeamVertexElementResult::NumberOfNodalValues(void){{{1*/
+int BeamVertexElementResult::NumberOfNodalValues(void){
+	return 2;
+}
+/*}}}*/
+/*FUNCTION BeamVertexElementResult::BeamVertexElementResult::PatchFill(int row, Patch* patch){{{1*/
+void BeamVertexElementResult::PatchFill(int row, Patch* patch){
+	
+	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,2);
+
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/BeamVertexElementResult.h	(revision 4050)
@@ -0,0 +1,59 @@
+/*! \file BeamVertexElementResult.h 
+ *  \brief: header file for triavertexresult object
+ */
+
+
+#ifndef _BEAMVERTEXELEMENTRESULT_H_
+#define _BEAMVERTEXELEMENTRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "../Inputs/Input.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class BeamVertexElementResult: public BeamVertexInput,public ElementResult{
+
+	private: 
+		int    step;
+		double time;
+
+	public:
+
+		/*constructors, destructors: {{{1*/
+		BeamVertexElementResult();
+		BeamVertexElementResult(int enum_type,double* values,int step,double time);
+		~BeamVertexElementResult();
+		/*}}}*/
+		/*object management: {{{1*/
+		void  DeepEcho();
+		void  Echo();
+		int   Id(); 
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   MyRank();
+		Object* copy();
+		int   EnumType();
+		
+		void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
+
+		/*}}}*/
+		/*result virtual functions: {{{1*/
+		ElementResult* SpawnSingElementResult(int  index){ISSMERROR("Not implemented yet!");}
+		ElementResult* SpawnBeamElementResult(int* indices){ISSMERROR("Not implemented yet!");}
+		ElementResult* SpawnTriaElementResult(int* indices){ISSMERROR("Not implemented yet!");}
+		void    ProcessUnits(Parameters* parameters);
+		int     NumberOfNodalValues(void);
+		void    PatchFill(int row, Patch* patch);
+		/*}}}*/
+
+};
+#endif  /* _BEAMVERTEXELEMENTRESULT_H */
Index: /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp	(revision 4050)
@@ -0,0 +1,216 @@
+/*!\file DoubleElementResult.c
+ * \brief: implementation of the DoubleElementResult object
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "./ElementResultLocal.h"
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+
+/*Object constructors and destructor*/
+/*FUNCTION DoubleElementResult::DoubleElementResult(){{{1*/
+DoubleElementResult::DoubleElementResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::DoubleElementResult(int in_enum_type,IssmDouble in_value,int in_step, double in_time){{{1*/
+DoubleElementResult::DoubleElementResult(int in_enum_type,IssmDouble in_value,int in_step, double in_time): DoubleInput(in_enum_type,in_value){
+		
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::~DoubleElementResult(){{{1*/
+DoubleElementResult::~DoubleElementResult(){
+	return;
+}
+/*}}}*/
+
+/*Object management*/
+/*FUNCTION DoubleElementResult::copy{{{1*/
+Object* DoubleElementResult::copy() {
+
+	DoubleElementResult* result=new DoubleElementResult(this->enum_type,this->value,this->step,this->time);
+	return (Object*)result;
+	//return new DoubleElementResult(this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::DeepEcho{{{1*/
+void DoubleElementResult::DeepEcho(void){
+
+	printf("DoubleElementResult:\n");
+	DoubleInput::DeepEcho();
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::Demarshall{{{1*/
+void  DoubleElementResult::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(&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 DoubleElementResult::Echo {{{1*/
+void DoubleElementResult::Echo(void){
+	this->DeepEcho();
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::Enum{{{1*/
+int DoubleElementResult::Enum(void){
+
+	return DoubleElementResultEnum;
+
+}
+/*}}}*/
+/*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::MarshallSize{{{1*/
+int   DoubleElementResult::MarshallSize(){
+	
+	return sizeof(value)+
+		+sizeof(enum_type)
+		+sizeof(time)
+		+sizeof(step)
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::MyRank{{{1*/
+int    DoubleElementResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+
+/*ElementResult functions*/
+/*FUNCTION DoubleElementResult::SpawnSingElementResult{{{1*/
+ElementResult* DoubleElementResult::SpawnSingElementResult(int index){
+
+	/*output*/
+	DoubleElementResult* outresult=new DoubleElementResult();
+
+	/*copy fields: */
+	outresult->enum_type=this->enum_type;
+	outresult->value=this->value;
+	outresult->time=this->time;
+	outresult->step=this->step;
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::SpawnBeamElementResult{{{1*/
+ElementResult* DoubleElementResult::SpawnBeamElementResult(int* indices){
+
+	/*output*/
+	DoubleElementResult* outresult=new DoubleElementResult();
+
+	/*copy fields: */
+	outresult->enum_type=this->enum_type;
+	outresult->value=this->value;
+	outresult->time=this->time;
+	outresult->step=this->step;
+
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::SpawnTriaElementResult{{{1*/
+ElementResult* DoubleElementResult::SpawnTriaElementResult(int* indices){
+
+	/*output*/
+	DoubleElementResult* outresult=new DoubleElementResult();
+
+	/*copy fields: */
+	outresult->enum_type=this->enum_type;
+	outresult->value=this->value;
+	outresult->time=this->time;
+	outresult->step=this->step;
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::ProcessUnits(Parameters* parameters){{{1*/
+void DoubleElementResult::ProcessUnits(Parameters* parameters){
+	
+	NodalValuesUnitConversion(&this->value,1,this->enum_type,parameters);
+
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::NumberOfNodalValues(void){{{1*/
+int DoubleElementResult::NumberOfNodalValues(void){
+	return 1;
+}
+/*}}}*/
+/*FUNCTION DoubleElementResult::DoubleElementResult::PatchFill(int row, Patch* patch){{{1*/
+void DoubleElementResult::PatchFill(int row, Patch* patch){
+	
+	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P0Enum,&this->value,1);
+
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h	(revision 4050)
@@ -0,0 +1,61 @@
+/*! \file DoubleElementResult.h 
+ *  \brief: header file for double result object
+ *  A double result object is just derived from a DoubleInput object, with additional time and step information.
+ */
+
+
+#ifndef _DOUBLEELEMENTRESULT_H_
+#define _DOUBLEELEMENTRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "../Inputs/Input.h"
+#include "../../include/include.h"
+class Parameters;
+/*}}}*/
+
+class DoubleElementResult: public DoubleInput,public ElementResult{
+
+	private: 
+		int    step;
+		double time;
+
+	public:
+
+		/*constructors, destructors: {{{1*/
+		DoubleElementResult();
+		DoubleElementResult(int enum_type,IssmDouble value,int step,double time);
+		~DoubleElementResult();
+		/*}}}*/
+		/*object management: {{{1*/
+		void  DeepEcho();
+		void  Echo();
+		int   Id(); 
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   MyRank();
+		Object* copy();
+		int   EnumType();
+
+		void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
+
+				/*}}}*/
+		/*result virtual functions: {{{1*/
+		ElementResult* SpawnSingElementResult(int  index);
+		ElementResult* SpawnBeamElementResult(int* indices);
+		ElementResult* SpawnTriaElementResult(int* indices);
+		void    ProcessUnits(Parameters* parameters);
+		int     NumberOfNodalValues(void);
+		void    PatchFill(int row, Patch* patch);
+		/*}}}*/
+
+};
+#endif  /* _DOUBLEELEMENTRESULT_H */
Index: /issm/trunk/src/c/objects/ElementResults/ElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/ElementResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/ElementResult.h	(revision 4050)
@@ -0,0 +1,31 @@
+/*!\file:  ElementResult.h
+ * \brief abstract class for ElementResult object
+ */ 
+
+
+#ifndef _ELEMENTRESULT_H_
+#define _ELEMENTRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "../Object.h"
+/*}}}*/
+
+class ElementResult{
+
+	public: 
+		
+		virtual        ~ElementResult(){};
+		
+		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;
+		virtual void    PatchFill(int row, Patch* patch)=0;
+
+};
+
+
+void NodalValuesUnitConversion(double* nodal_values, int num_nodal_values,int enum_type,Parameters* parameters);
+#endif
Index: /issm/trunk/src/c/objects/ElementResults/ElementResultLocal.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/ElementResultLocal.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/ElementResultLocal.h	(revision 4050)
@@ -0,0 +1,13 @@
+/*!\file: ElementResultLocal.h
+ * \brief prototypes for ElementResultLocal.h
+ */ 
+
+#ifndef _ELEMENTRESULTLOCAL_H_
+#define  _ELEMENTRESULTLOCAL_H_
+
+class Parameters;
+
+void NodalValuesUnitConversion(double* patch, int patch_size,int enum_type,Parameters* parameters);
+
+#endif //ifndef _ELEMENTRESULTLOCAL_H_
+
Index: /issm/trunk/src/c/objects/ElementResults/NodalValuesUnitConversion.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/NodalValuesUnitConversion.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/NodalValuesUnitConversion.cpp	(revision 4050)
@@ -0,0 +1,33 @@
+/*!\file:  NodalValuesUnitConversion.cpp
+ * \brief: process nodal_values held in a ElementResult object.
+ * For example, velocities need to be in m/yr, melting rates in m/yr, etc ...
+ * This centralizes all post-processing of results when they are being output.
+ */ 
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "../../DataSet/DataSet.h"
+#include "../../objects/objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+
+void NodalValuesUnitConversion(double* nodal_values, int num_nodal_values,int enum_type,Parameters* parameters){
+
+	int i;
+	double yts;
+
+	/*Gete some values from parameters, that are often needed: */
+	parameters->FindParam(&yts,YtsEnum);
+
+	switch(enum_type){
+		case VxEnum: for(i=0;i<num_nodal_values;i++)nodal_values[i]=nodal_values[i]/yts;break;
+		case VyEnum: for(i=0;i<num_nodal_values;i++)nodal_values[i]=nodal_values[i]/yts;break;
+		case VzEnum: for(i=0;i<num_nodal_values;i++)nodal_values[i]=nodal_values[i]/yts;break;
+		case MeltingRateEnum: for(i=0;i<num_nodal_values;i++)nodal_values[i]=nodal_values[i]/yts;break;
+		default: break;
+	}
+}
Index: /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp	(revision 4050)
@@ -0,0 +1,228 @@
+/*!\file PentaVertexElementResult.c
+ * \brief: implementation of the PentaVertexElementResult object
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "./ElementResultLocal.h"
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+
+/*Object constructors and destructor*/
+/*FUNCTION PentaVertexElementResult::PentaVertexElementResult(){{{1*/
+PentaVertexElementResult::PentaVertexElementResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::PentaVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time){{{1*/
+PentaVertexElementResult::PentaVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time): PentaVertexInput(in_enum_type,in_values){
+
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::~PentaVertexElementResult(){{{1*/
+PentaVertexElementResult::~PentaVertexElementResult(){
+	return;
+}
+/*}}}*/
+
+/*Object management*/
+/*FUNCTION PentaVertexElementResult::copy{{{1*/
+Object* PentaVertexElementResult::copy() {
+	
+	return new PentaVertexElementResult(this->enum_type,this->values,this->step,this->time);
+
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::DeepEcho{{{1*/
+void PentaVertexElementResult::DeepEcho(void){
+
+	printf("PentaVertexElementResult:\n");
+	PentaVertexElementResult::DeepEcho();
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::Demarshall{{{1*/
+void  PentaVertexElementResult::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 PentaVertexElementResult::Echo {{{1*/
+void PentaVertexElementResult::Echo(void){
+	this->DeepEcho();
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::Enum{{{1*/
+int PentaVertexElementResult::Enum(void){
+
+	return PentaVertexElementResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::EnumType{{{1*/
+int PentaVertexElementResult::EnumType(void){
+
+	return this->enum_type;
+
+}
+/*}}}*/
+/*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){
+
+	/*output*/
+	SingVertexElementResult* outresult=NULL;
+
+	/*Create new Sing result (copy of current result)*/
+	ISSMASSERT(index<6 && index>=0);
+	outresult=new SingVertexElementResult(this->enum_type,this->values[index],this->step,this->time);
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::SpawnBeamElementResult{{{1*/
+ElementResult* PentaVertexElementResult::SpawnBeamElementResult(int* indices){
+
+	/*output*/
+	BeamVertexElementResult* outresult=NULL;
+	double newvalues[2];
+
+	/*Loop over the new indices*/
+	for(int i=0;i<2;i++){
+
+		/*Check index value*/
+		ISSMASSERT(indices[i]>=0 && indices[i]<6);
+
+		/*Assign value to new result*/
+		newvalues[i]=this->values[indices[i]];
+	}
+
+	/*Create new Beam result*/
+	outresult=new BeamVertexElementResult(this->enum_type,&newvalues[0],this->step,this->time);
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::SpawnTriaElementResult{{{1*/
+ElementResult* PentaVertexElementResult::SpawnTriaElementResult(int* indices){
+
+	/*output*/
+	TriaVertexElementResult* outresult=NULL;
+	double newvalues[3];
+
+	/*Loop over the new indices*/
+	for(int i=0;i<3;i++){
+
+		/*Check index value*/
+		ISSMASSERT(indices[i]>=0 && indices[i]<6);
+
+		/*Assign value to new result*/
+		newvalues[i]=this->values[indices[i]];
+	}
+
+	/*Create new Tria result*/
+	outresult=new TriaVertexElementResult(this->enum_type,&newvalues[0],this->step,this->time);
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::ProcessUnits(Parameters* parameters){{{1*/
+void PentaVertexElementResult::ProcessUnits(Parameters* parameters){
+	
+	NodalValuesUnitConversion(this->values,6,this->enum_type,parameters);
+
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::NumberOfNodalValues(void){{{1*/
+int PentaVertexElementResult::NumberOfNodalValues(void){
+	return 6;
+}
+/*}}}*/
+/*FUNCTION PentaVertexElementResult::PentaVertexElementResult::PatchFill(int row, Patch* patch){{{1*/
+void PentaVertexElementResult::PatchFill(int row, Patch* patch){
+	
+	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,6);
+
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h	(revision 4050)
@@ -0,0 +1,60 @@
+/*! \file PentaVertexElementResult.h 
+ *  \brief: header file for penta vertex result  object. 
+ *  this object is just a PentaVertexInput with additional time and step info.
+ */
+
+
+#ifndef _PENTAVERTEXELEMENTRESULT_H_
+#define _PENTAVERTEXELEMENTRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "../Inputs/Input.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class PentaVertexElementResult: public PentaVertexInput,public ElementResult{
+
+	private: 
+		int    step;
+		double time;
+
+	public:
+
+		/*constructors, destructors: {{{1*/
+		PentaVertexElementResult();
+		PentaVertexElementResult(int enum_type,double* values,int step, double time);
+		~PentaVertexElementResult();
+		/*}}}*/
+		/*object management: {{{1*/
+		void  DeepEcho();
+		void  Echo();
+		int   Id(); 
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   MyRank();
+		Object* copy();
+		int   EnumType();
+		
+		void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
+
+		/*}}}*/
+		/*result virtual functions: {{{1*/
+		ElementResult* SpawnSingElementResult(int  index);
+		ElementResult* SpawnBeamElementResult(int* indices);
+		ElementResult* SpawnTriaElementResult(int* indices);
+		void    ProcessUnits(Parameters* parameters);
+		int     NumberOfNodalValues(void);
+		void    PatchFill(int row, Patch* patch);
+		/*}}}*/
+
+};
+#endif  /* _PENTAVERTEXELEMENTRESULT_H */
Index: /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.cpp	(revision 4050)
@@ -0,0 +1,163 @@
+/*!\file SingVertexElementResult.c
+ * \brief: implementation of the SingVertexElementResult object
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "./ElementResultLocal.h"
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+
+/*Object constructors and destructor*/
+/*FUNCTION SingVertexElementResult::SingVertexElementResult(){{{1*/
+SingVertexElementResult::SingVertexElementResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION SingVertexElementResult::SingVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time){{{1*/
+SingVertexElementResult::SingVertexElementResult(int in_enum_type,double in_value,int in_step, double in_time):SingVertexInput(in_enum_type,in_value){
+
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION SingVertexElementResult::~SingVertexElementResult(){{{1*/
+SingVertexElementResult::~SingVertexElementResult(){
+	return;
+}
+/*}}}*/
+
+/*Object management*/
+/*FUNCTION SingVertexElementResult::copy{{{1*/
+Object* SingVertexElementResult::copy() {
+	
+	return new SingVertexElementResult(this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+/*FUNCTION SingVertexElementResult::DeepEcho{{{1*/
+void SingVertexElementResult::DeepEcho(void){
+		
+	printf("SingVertexElementResult:\n");
+	SingVertexElementResult::DeepEcho();
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+
+}
+/*}}}*/
+/*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::Marshall{{{1*/
+void  SingVertexElementResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of SingVertexElementResult: */
+	enum_value=SingVertexElementResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall SingVertexElementResult 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 SingVertexElementResult::MarshallSize{{{1*/
+int   SingVertexElementResult::MarshallSize(){
+	
+	return sizeof(value)+
+		+sizeof(enum_type)
+		+sizeof(time)
+		+sizeof(step)
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION SingVertexElementResult::MyRank{{{1*/
+int    SingVertexElementResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+
+/*ElementResult functions*/
+/*FUNCTION SingVertexElementResult::ProcessUnits(Parameters* parameters){{{1*/
+void SingVertexElementResult::ProcessUnits(Parameters* parameters){
+	
+	NodalValuesUnitConversion(&this->value,1,this->enum_type,parameters);
+
+}
+/*}}}*/
+/*FUNCTION SingVertexElementResult::NumberOfNodalValues(void){{{1*/
+int SingVertexElementResult::NumberOfNodalValues(void){
+	return 1;
+}
+/*}}}*/
+/*FUNCTION SingVertexElementResult::SingVertexElementResult::PatchFill(int row, Patch* patch){{{1*/
+void SingVertexElementResult::PatchFill(int row, Patch* patch){
+	
+	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P0Enum,&this->value,1);
+
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/SingVertexElementResult.h	(revision 4050)
@@ -0,0 +1,59 @@
+/*! \file SingVertexElementResult.h 
+ *  \brief: header file for triavertexresult object
+ */
+
+
+#ifndef _SINGVERTEXELEMENTRESULT_H_
+#define _SINGVERTEXELEMENTRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "../Inputs/Input.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class SingVertexElementResult: public SingVertexInput,public ElementResult{
+
+	private: 
+		int    step;
+		double time;
+
+	public:
+
+		/*constructors, destructors: {{{1*/
+		SingVertexElementResult();
+		SingVertexElementResult(int enum_type,double value,int step,double time);
+		~SingVertexElementResult();
+		/*}}}*/
+		/*object management: {{{1*/
+		void  DeepEcho();
+		void  Echo();
+		int   Id(); 
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   MyRank();
+		Object* copy();
+		int   EnumType();
+		
+		void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
+
+		/*}}}*/
+		/*result virtual functions: {{{1*/
+		ElementResult* SpawnSingElementResult(int  index){ISSMERROR("Not implemented yet!");}
+		ElementResult* SpawnBeamElementResult(int* indices){ISSMERROR("Not implemented yet!");}
+		ElementResult* SpawnTriaElementResult(int* indices){ISSMERROR("Not implemented yet!");}
+		void    ProcessUnits(Parameters* parameters);
+		int     NumberOfNodalValues(void);
+		void    PatchFill(int row, Patch* patch);
+		/*}}}*/
+
+};
+#endif  /* _SINGVERTEXELEMENTRESULT_H */
Index: /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp	(revision 4050)
@@ -0,0 +1,217 @@
+/*!\file TriaVertexElementResult.c
+ * \brief: implementation of the TriaVertexElementResult object
+ */
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "./ElementResultLocal.h"
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+
+/*Object constructors and destructor*/
+/*FUNCTION TriaVertexElementResult::TriaVertexElementResult(){{{1*/
+TriaVertexElementResult::TriaVertexElementResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::TriaVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time){{{1*/
+TriaVertexElementResult::TriaVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time):TriaVertexInput(in_enum_type,in_values){
+
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::~TriaVertexElementResult(){{{1*/
+TriaVertexElementResult::~TriaVertexElementResult(){
+	return;
+}
+/*}}}*/
+
+/*Object management*/
+/*FUNCTION TriaVertexElementResult::copy{{{1*/
+Object* TriaVertexElementResult::copy() {
+	
+	return new TriaVertexElementResult(this->enum_type,this->values,this->step,this->time);
+
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::DeepEcho{{{1*/
+void TriaVertexElementResult::DeepEcho(void){
+		
+	printf("TriaVertexElementResult:\n");
+	TriaVertexElementResult::DeepEcho();
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::Demarshall{{{1*/
+void  TriaVertexElementResult::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 TriaVertexElementResult::Echo {{{1*/
+void TriaVertexElementResult::Echo(void){
+	this->DeepEcho();
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::Enum{{{1*/
+int TriaVertexElementResult::Enum(void){
+
+	return TriaVertexElementResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::EnumType{{{1*/
+int TriaVertexElementResult::EnumType(void){
+
+	return this->enum_type;
+
+}
+/*}}}*/
+/*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){
+
+	/*output*/
+	SingVertexElementResult* outresult=NULL;
+
+	/*Create new Sing result (copy of current result)*/
+	ISSMASSERT(index<3 && index>=0);
+	outresult=new SingVertexElementResult(this->enum_type,this->values[index],this->step,this->time);
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION BeamVertexElementResult::SpawnBeamElementResult{{{1*/
+ElementResult* TriaVertexElementResult::SpawnBeamElementResult(int* indices){
+
+	/*output*/
+	BeamVertexElementResult* outresult=NULL;
+	double newvalues[2];
+
+	/*Loop over the new indices*/
+	for(int i=0;i<2;i++){
+
+		/*Check index value*/
+		ISSMASSERT(indices[i]>=0 && indices[i]<3);
+
+		/*Assign value to new result*/
+		newvalues[i]=this->values[indices[i]];
+	}
+
+	/*Create new Beam result*/
+	outresult=new BeamVertexElementResult(this->enum_type,&newvalues[0],this->step,this->time);
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::SpawnTriaElementResult{{{1*/
+ElementResult* TriaVertexElementResult::SpawnTriaElementResult(int* indices){
+
+	/*output*/
+	TriaVertexElementResult* outresult=NULL;
+
+	/*Create new Tria result (copy of current result)*/
+	outresult=new TriaVertexElementResult(this->enum_type,&this->values[0],this->step,this->time);
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::ProcessUnits(Parameters* parameters){{{1*/
+void TriaVertexElementResult::ProcessUnits(Parameters* parameters){
+	
+	NodalValuesUnitConversion(this->values,3,this->enum_type,parameters);
+
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::NumberOfNodalValues(void){{{1*/
+int TriaVertexElementResult::NumberOfNodalValues(void){
+	return 3;
+}
+/*}}}*/
+/*FUNCTION TriaVertexElementResult::TriaVertexElementResult::PatchFill(int row, Patch* patch){{{1*/
+void TriaVertexElementResult::PatchFill(int row, Patch* patch){
+	
+	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,3);
+
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h
===================================================================
--- /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h	(revision 4050)
@@ -0,0 +1,59 @@
+/*! \file TriaVertexElementResult.h 
+ *  \brief: header file for triavertexresult object
+ */
+
+
+#ifndef _TRIAVERTEXELEMENTRESULT_H_
+#define _TRIAVERTEXELEMENTRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "../Inputs/Input.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class TriaVertexElementResult: public TriaVertexInput,public ElementResult{
+
+	private: 
+		int    step;
+		double time;
+
+	public:
+
+		/*constructors, destructors: {{{1*/
+		TriaVertexElementResult();
+		TriaVertexElementResult(int enum_type,double* values,int step,double time);
+		~TriaVertexElementResult();
+		/*}}}*/
+		/*object management: {{{1*/
+		void  DeepEcho();
+		void  Echo();
+		int   Id(); 
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		int   Enum();
+		int   MyRank();
+		Object* copy();
+		int   EnumType();
+		
+		void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
+
+		/*}}}*/
+		/*result virtual functions: {{{1*/
+		ElementResult* SpawnSingElementResult(int  index);
+		ElementResult* SpawnBeamElementResult(int* indices);
+		ElementResult* SpawnTriaElementResult(int* indices);
+		void    ProcessUnits(Parameters* parameters);
+		int     NumberOfNodalValues(void);
+		void    PatchFill(int row, Patch* patch);
+		/*}}}*/
+
+};
+#endif  /* _TRIAVERTEXELEMENTRESULT_H */
Index: /issm/trunk/src/c/objects/Elements/Beam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Beam.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Elements/Beam.cpp	(revision 4050)
@@ -1002,6 +1002,6 @@
 }
 /*}}}*/
-/*FUNCTION Beam::AXPY(int YEnum, double scalar, int XEnum);{{{1*/
-void  Beam::AXPY(int YEnum, double scalar, int XEnum){
+/*FUNCTION Beam::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/
+void  Beam::AXPYInput(int YEnum, double scalar, int XEnum){
 
 	Input* xinput=NULL;
@@ -1020,6 +1020,6 @@
 }
 /*}}}*/
-/*FUNCTION Beam::ControlConstrain(int control_type, double cm_min, double cm_max){{{1*/
-void  Beam::ControlConstrain(int control_type, double cm_min, double cm_max){
+/*FUNCTION Beam::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/
+void  Beam::ControlConstrainInput(int control_type, double cm_min, double cm_max){
 
 	Input* input=NULL;
@@ -1039,4 +1039,5 @@
 void  Beam::GetVectorFromInputs(Vec vector,int NameEnum){
 
+	int i;
 	const int numvertices=2;
 	int doflist1[numvertices];
@@ -1045,5 +1046,5 @@
 	for(i=0;i<this->inputs->Size();i++){
 		Input* input=(Input*)this->inputs->GetObjectByOffset(i);
-		if(input->EnumType==NameEnum){
+		if(input->EnumType()==NameEnum){
 			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
 			this->GetDofList1(&doflist1[0]);
Index: /issm/trunk/src/c/objects/Elements/Beam.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Beam.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Elements/Beam.h	(revision 4050)
@@ -96,6 +96,6 @@
 		void  DuplicateInput(int original_enum,int new_enum);
 		void  ScaleInput(int enum_type,double scale_factor);
-		void  AXPY(int YEnum, double scalar, int XEnum);
-		void  ControlConstrain(int control_type,double cm_min, double cm_max);
+		void  AXPYInput(int YEnum, double scalar, int XEnum);
+		void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
 
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Elements/Element.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Element.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Elements/Element.h	(revision 4050)
@@ -67,6 +67,6 @@
 		virtual void   ScaleInput(int enum_type,double scale_factor)=0;
 		virtual void   GetVectorFromInputs(Vec vector,int NameEnum)=0;
-		virtual void   AXPY(int YEnum, double scalar, int XEnum)=0;
-		virtual void   ControlConstrain(int control_type,double cm_min, double cm_max)=0;
+		virtual void   AXPYInput(int YEnum, double scalar, int XEnum)=0;
+		virtual void   ControlConstrainInput(int control_type,double cm_min, double cm_max)=0;
 		/*Implementation: */
 
Index: /issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Elements/Penta.cpp	(revision 4050)
@@ -616,6 +616,6 @@
 
 	for(i=0;i<this->results->Size();i++){
-		Result* result=(Result*)this->results->GetObjectByOffset(i);
-		result->ProcessUnits(this->parameters);
+		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+		elementresult->ProcessUnits(this->parameters);
 	}
 
@@ -4578,4 +4578,5 @@
 void  Penta::GradjDrag(void){
 
+	int i;
 	Tria* tria=NULL;
 	TriaVertexInput* triavertexinput=NULL;
@@ -4621,5 +4622,5 @@
 
 	/*Now, the tria  has a GradientEnum input. Take it, and make a PentaVertexInput out of it, then delete the tria: */
-	triavertexinput=tria->inputs->GetInput(GradientEnum);
+	triavertexinput=(TriaVertexInput*)tria->inputs->GetInput(GradientEnum);
 	for(i=0;i<3;i++)gradient[i]=triavertexinput->values[i];
 	this->inputs->AddInput(new PentaVertexInput(GradientEnum,&gradient[0]));
@@ -4632,4 +4633,5 @@
 void  Penta::GradjB(void){
 
+	int i;
 	Tria* tria=NULL;
 	TriaVertexInput* triavertexinput=NULL;
@@ -4665,5 +4667,5 @@
 	
 	/*Now, the tria  has a GradientEnum input. Take it, and make a PentaVertexInput out of it, then delete the tria: */
-	triavertexinput=tria->inputs->GetInput(GradientEnum);
+	triavertexinput=(TriaVertexInput*)tria->inputs->GetInput(GradientEnum);
 	for(i=0;i<3;i++)gradient[i]=triavertexinput->values[i];
 	this->inputs->AddInput(new PentaVertexInput(GradientEnum,&gradient[0]));
@@ -4959,10 +4961,10 @@
 	/*Go through all the results objects, and update the counters: */
 	for (i=0;i<this->results->Size();i++){
-		Result* result=(Result*)this->results->GetObjectByOffset(i);
+		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
 		/*first, we have one more result: */
 		numrows++;
 		/*now, how many vertices and how many nodal values for this result? :*/
 		numvertices=6; //this is a penta element, with 6 vertices
-		numnodes=result->NumberOfNodalValues(); //ask result object.
+		numnodes=elementresult->NumberOfNodalValues(); //ask result object.
 	}
 
@@ -4989,10 +4991,10 @@
 
 	for(i=0;i<this->results->Size();i++){
-		Result* result=(Result*)this->results->GetObjectByOffset(i);
+		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
 
 		/*For this result,fill the information in the Patch object (element id + vertices ids), and then hand 
 		 *it to the result object, to fill the rest: */
 		patch->fillelementinfo(count,this->id,vertices_ids,6);
-		result->PatchFill(count,patch);
+		elementresult->PatchFill(count,patch);
 
 		/*increment counter: */
@@ -5352,6 +5354,6 @@
 }
 /*}}}*/
-/*FUNCTION Penta::AXPY(int YEnum, double scalar, int XEnum);{{{1*/
-void  Penta::AXPY(int YEnum, double scalar, int XEnum){
+/*FUNCTION Penta::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/
+void  Penta::AXPYInput(int YEnum, double scalar, int XEnum){
 
 	Input* xinput=NULL;
@@ -5370,6 +5372,6 @@
 }
 /*}}}*/
-/*FUNCTION Penta::ControlConstrain(int control_type, double cm_min, double cm_max){{{1*/
-void  Penta::ControlConstrain(int control_type, double cm_min, double cm_max){
+/*FUNCTION Penta::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/
+void  Penta::ControlConstrainInput(int control_type, double cm_min, double cm_max){
 
 	Input* input=NULL;
@@ -5389,4 +5391,5 @@
 void  Penta::GetVectorFromInputs(Vec vector,int NameEnum){
 
+	int i;
 	const int numvertices=6;
 	int doflist1[numvertices];
@@ -5395,5 +5398,5 @@
 	for(i=0;i<this->inputs->Size();i++){
 		Input* input=(Input*)this->inputs->GetObjectByOffset(i);
-		if(input->EnumType==NameEnum){
+		if(input->EnumType()==NameEnum){
 			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
 			this->GetDofList1(&doflist1[0]);
Index: /issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Penta.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Elements/Penta.h	(revision 4050)
@@ -163,6 +163,6 @@
 		void  DuplicateInput(int original_enum,int new_enum);
 		void  ScaleInput(int enum_type,double scale_factor);
-		void  AXPY(int YEnum, double scalar, int XEnum);
-		void  ControlConstrain(int control_type,double cm_min, double cm_max);
+		void  AXPYInput(int YEnum, double scalar, int XEnum);
+		void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
 		void  GetVectorFromInputs(Vec vector,int NameEnum);
 
Index: /issm/trunk/src/c/objects/Elements/Sing.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Sing.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Elements/Sing.cpp	(revision 4050)
@@ -708,6 +708,6 @@
 }
 /*}}}*/
-/*FUNCTION Sing::AXPY(int YEnum, double scalar, int XEnum);{{{1*/
-void  Sing::AXPY(int YEnum, double scalar, int XEnum){
+/*FUNCTION Sing::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/
+void  Sing::AXPYInput(int YEnum, double scalar, int XEnum){
 
 	Input* xinput=NULL;
@@ -726,6 +726,6 @@
 }
 /*}}}*/
-/*FUNCTION Sing::ControlConstrain(int control_type, double cm_min, double cm_max){{{1*/
-void  Sing::ControlConstrain(int control_type, double cm_min, double cm_max){
+/*FUNCTION Sing::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/
+void  Sing::ControlConstrainInput(int control_type, double cm_min, double cm_max){
 
 	Input* input=NULL;
@@ -745,4 +745,5 @@
 void  Sing::GetVectorFromInputs(Vec vector,int NameEnum){
 
+	int i;
 	const int numvertices=1;
 	int doflist1[numvertices];
@@ -751,5 +752,5 @@
 	for(i=0;i<this->inputs->Size();i++){
 		Input* input=(Input*)this->inputs->GetObjectByOffset(i);
-		if(input->EnumType==NameEnum){
+		if(input->EnumType()==NameEnum){
 			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
 			this->GetDofList1(&doflist1[0]);
Index: /issm/trunk/src/c/objects/Elements/Sing.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Sing.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Elements/Sing.h	(revision 4050)
@@ -95,6 +95,6 @@
 		void  DuplicateInput(int original_enum,int new_enum);
 		void  ScaleInput(int enum_type,double scale_factor);
-		void  AXPY(int YEnum, double scalar, int XEnum);
-		void  ControlConstrain(int control_type,double cm_min, double cm_max);
+		void  AXPYInput(int YEnum, double scalar, int XEnum);
+		void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
 
 
Index: /issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Elements/Tria.cpp	(revision 4050)
@@ -512,6 +512,6 @@
 
 	for(i=0;i<this->results->Size();i++){
-		Result* result=(Result*)this->results->GetObjectByOffset(i);
-		result->ProcessUnits(this->parameters);
+		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
+		elementresult->ProcessUnits(this->parameters);
 	}
 
@@ -4308,5 +4308,5 @@
 /*}}}*/
 /*FUNCTION Tria::GradjDragStokes {{{1*/
-void  Tria::GradjDragStokes(Vec grad_g){
+void  Tria::GradjDragStokes(void){
 
 	int i;
@@ -4478,5 +4478,5 @@
 /*}}}*/
 /*FUNCTION Tria::GradjB{{{1*/
-void  Tria::GradjB(Vec grad_g){
+void  Tria::GradjB(void){
 
 	int i;
@@ -5057,10 +5057,10 @@
 	/*Go through all the results objects, and update the counters: */
 	for (i=0;i<this->results->Size();i++){
-		Result* result=(Result*)this->results->GetObjectByOffset(i);
+		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
 		/*first, we have one more result: */
 		numrows++;
 		/*now, how many vertices and how many nodal values for this result? :*/
 		numvertices=3; //this is a tria element, with 3 vertices
-		numnodes=result->NumberOfNodalValues(); //ask result object.
+		numnodes=elementresult->NumberOfNodalValues(); //ask result object.
 	}
 
@@ -5087,10 +5087,10 @@
 
 	for(i=0;i<this->results->Size();i++){
-		Result* result=(Result*)this->results->GetObjectByOffset(i);
+		ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i);
 
 		/*For this result,fill the information in the Patch object (element id + vertices ids), and then hand 
 		 *it to the result object, to fill the rest: */
 		patch->fillelementinfo(row,this->id,vertices_ids,3);
-		result->PatchFill(row,patch);
+		elementresult->PatchFill(row,patch);
 
 		/*increment rower: */
@@ -5450,6 +5450,6 @@
 }
 /*}}}*/
-/*FUNCTION Tria::AXPY(int YEnum, double scalar, int XEnum);{{{1*/
-void  Tria::AXPY(int YEnum, double scalar, int XEnum){
+/*FUNCTION Tria::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/
+void  Tria::AXPYInput(int YEnum, double scalar, int XEnum){
 
 	Input* xinput=NULL;
@@ -5468,6 +5468,6 @@
 }
 /*}}}*/
-/*FUNCTION Tria::ControlConstrain(int control_type, double cm_min, double cm_max){{{1*/
-void  Tria::ControlConstrain(int control_type, double cm_min, double cm_max){
+/*FUNCTION Tria::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/
+void  Tria::ControlConstrainInput(int control_type, double cm_min, double cm_max){
 
 	Input* input=NULL;
@@ -5487,4 +5487,5 @@
 void  Tria::GetVectorFromInputs(Vec vector,int NameEnum){
 
+	int i;
 	const int numvertices=3;
 	int doflist1[numvertices];
@@ -5493,5 +5494,5 @@
 	for(i=0;i<this->inputs->Size();i++){
 		Input* input=(Input*)this->inputs->GetObjectByOffset(i);
-		if(input->EnumType==NameEnum){
+		if(input->EnumType()==NameEnum){
 			/*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
 			this->GetDofList1(&doflist1[0]);
Index: /issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/objects/Elements/Tria.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Elements/Tria.h	(revision 4050)
@@ -141,6 +141,6 @@
 		void  DuplicateInput(int original_enum,int new_enum);
 		void  ScaleInput(int enum_type,double scale_factor);
-		void  AXPY(int YEnum, double scalar, int XEnum);
-		void  ControlConstrain(int control_type,double cm_min, double cm_max);
+		void  AXPYInput(int YEnum, double scalar, int XEnum);
+		void  ControlConstrainInput(int control_type,double cm_min, double cm_max);
 		void  GetVectorFromInputs(Vec vector,int NameEnum);
 
Index: /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp	(revision 4050)
@@ -0,0 +1,141 @@
+/*!\file BoolExternalResult.c
+ * \brief: implementation of the BoolExternalResult object
+ */
+
+/*header files: */
+/*{{{1*/
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+/*}}}*/
+
+/*Object constructors and destructor*/
+/*FUNCTION BoolExternalResult::BoolExternalResult(){{{1*/
+BoolExternalResult::BoolExternalResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION BoolExternalResult::BoolExternalResult(int enum_type,bool value){{{1*/
+BoolExternalResult::BoolExternalResult(int in_id, int in_enum_type,bool in_value,int in_step, double in_time){
+
+	id=in_id;
+	enum_type=in_enum_type;
+	value=in_value;
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION BoolExternalResult::~BoolExternalResult(){{{1*/
+BoolExternalResult::~BoolExternalResult(){
+	return;
+}
+/*}}}*/
+
+/*Object methods*/
+/*FUNCTION BoolExternalResult::copy{{{1*/
+Object* BoolExternalResult::copy() {
+	
+	return new BoolExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+/*FUNCTION BoolExternalResult::DeepEcho{{{1*/
+void BoolExternalResult::DeepEcho(void){
+
+	printf("BoolExternalResult:\n");
+	printf("   id: %i\n",this->id);
+	printf("   enum:  %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	printf("   value: %s\n",this->value?"true":"false");
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+}
+/*}}}*/
+/*FUNCTION BoolExternalResult::Demarshall{{{1*/
+void  BoolExternalResult::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 BoolExternalResult::Echo {{{1*/
+void BoolExternalResult::Echo(void){
+	this->DeepEcho();
+}
+/*}}}*/
+/*FUNCTION BoolExternalResult::Enum{{{1*/
+int BoolExternalResult::Enum(void){
+
+	return BoolExternalResultEnum;
+
+}
+/*}}}*/
+/*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; 
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.h	(revision 4050)
@@ -0,0 +1,69 @@
+/*! \file BoolExternalResult.h 
+ *  \brief: header file for triavertexinput object
+ */
+
+
+#ifndef _BOOLEXTERNALRESULT_H_
+#define _BOOLEXTERNALRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#ifdef _SERIAL_
+#include <mex.h>
+#endif
+
+
+#include "./ExternalResult.h"
+#include "../../include/include.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class BoolExternalResult: public ExternalResult{
+
+	public:
+		int    id;
+		int    enum_type;
+		bool   value;
+		int    step;
+		double time;
+
+
+		/*constructors, destructors: {{{1*/
+		BoolExternalResult();
+		BoolExternalResult(int id, int enum_type,bool value,int step,double time);
+		~BoolExternalResult();
+
+		/*}}}*/
+		/*Object methods: {{{1*/
+		Object* copy();
+		void  DeepEcho();
+		void  Demarshall(char** pmarshalled_dataset);
+		void  Echo();
+		int   Enum();
+		int   Id();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		int   MyRank();
+
+		void  UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromSolution(double* solution){ISSMERROR("Not implemented yet!");}
+		/*}}}*/
+		/*ExternalResult methods: {{{1*/
+		int   EnumType(){return enum_type;}
+		/*}}}*/
+};
+#endif  /* _BOOLEXTERNALRESULT_H */
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp	(revision 4050)
@@ -0,0 +1,141 @@
+/*!\file DoubleExternalResult.c
+ * \brief: implementation of the DoubleExternalResult object
+ */
+
+/*header files: */
+/*{{{1*/
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+/*}}}*/
+
+/*Object constructors and destructor*/
+/*FUNCTION DoubleExternalResult::DoubleExternalResult(){{{1*/
+DoubleExternalResult::DoubleExternalResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION DoubleExternalResult::DoubleExternalResult(int enum_type,double value){{{1*/
+DoubleExternalResult::DoubleExternalResult(int in_id, int in_enum_type,double in_value,int in_step, double in_time){
+
+	id=in_id;
+	enum_type=in_enum_type;
+	value=in_value;
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION DoubleExternalResult::~DoubleExternalResult(){{{1*/
+DoubleExternalResult::~DoubleExternalResult(){
+	return;
+}
+/*}}}*/
+
+/*Object methods*/
+/*FUNCTION DoubleExternalResult::copy{{{1*/
+Object* DoubleExternalResult::copy() {
+	
+	return new DoubleExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+/*FUNCTION DoubleExternalResult::DeepEcho{{{1*/
+void DoubleExternalResult::DeepEcho(void){
+
+	printf("DoubleExternalResult:\n");
+	printf("   id: %i\n",this->id);
+	printf("   enum:  %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	printf("   value: %g\n",this->value);
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+}
+/*}}}*/
+/*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::Marshall{{{1*/
+void  DoubleExternalResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of DoubleExternalResult: */
+	enum_value=DoubleExternalResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall DoubleExternalResult 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 DoubleExternalResult::MarshallSize{{{1*/
+int   DoubleExternalResult::MarshallSize(){
+	
+	return sizeof(value)+
+		+sizeof(id)
+		+sizeof(enum_type)
+		+sizeof(step)
+		+sizeof(time)
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION DoubleExternalResult::MyRank{{{1*/
+int    DoubleExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.h	(revision 4050)
@@ -0,0 +1,69 @@
+/*! \file DoubleExternalResult.h 
+ *  \brief: header file for triavertexinput object
+ */
+
+
+#ifndef _DOUBLEEXTERNALRESULT_H_
+#define _DOUBLEEXTERNALRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#ifdef _SERIAL_
+#include <mex.h>
+#endif
+
+
+#include "./ExternalResult.h"
+#include "../../include/include.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class DoubleExternalResult: public ExternalResult{
+
+	public:
+		int    id;
+		int    enum_type;
+		double value;
+		int    step;
+		double time;
+
+
+		/*constructors, destructors: {{{1*/
+		DoubleExternalResult();
+		DoubleExternalResult(int id,int enum_type,double value,int step,double time);
+		~DoubleExternalResult();
+
+		/*}}}*/
+		/*Object methods: {{{1*/
+		Object* copy();
+		void  DeepEcho();
+		void  Demarshall(char** pmarshalled_dataset);
+		void  Echo();
+		int   Enum();
+		int   Id();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		int   MyRank();
+
+		void  UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromSolution(double* solution){ISSMERROR("Not implemented yet!");}
+		/*}}}*/
+		/*ExternalResult methods: {{{1*/
+		int   EnumType(){return enum_type;}
+		/*}}}*/
+};
+#endif  /* _DOUBLEEXTERNALRESULT_H */
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp	(revision 4050)
@@ -0,0 +1,163 @@
+/*!\file DoubleVecExternalResult.c
+ * \brief: implementation of the DoubleVecExternalResult object
+ */
+
+/*header files: */
+/*{{{1*/
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+/*}}}*/
+
+/*Object constructors and destructor*/
+/*FUNCTION DoubleVecExternalResult::DoubleVecExternalResult(){{{1*/
+DoubleVecExternalResult::DoubleVecExternalResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION DoubleVecExternalResult::DoubleVecExternalResult(int enum_type,IssmDoubleVec values,int M){{{1*/
+DoubleVecExternalResult::DoubleVecExternalResult(int in_id, int in_enum_type,double* in_values, int in_M,int in_step,double in_time){
+
+	id=in_id;
+	enum_type=in_enum_type;
+	M=in_M;
+
+	values=(double*)xmalloc(M*sizeof(double));
+	memcpy(values,in_values,M*sizeof(double));
+
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION DoubleVecExternalResult::~DoubleVecExternalResult(){{{1*/
+DoubleVecExternalResult::~DoubleVecExternalResult(){
+	xfree((void**)&values);
+	return;
+}
+/*}}}*/
+
+/*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);
+
+}
+/*}}}*/
+/*FUNCTION DoubleVecExternalResult::DeepEcho{{{1*/
+void DoubleVecExternalResult::DeepEcho(void){
+
+	int i;
+	
+	printf("DoubleVecExternalResult:\n");
+	printf("   id: %i\n",this->id);
+	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	printf("   vector size: %i\n",this->M);
+	for(i=0;i<this->M;i++){
+		printf("%i %g\n",i,this->values[i]);
+	}
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+}
+/*}}}*/
+/*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::Marshall{{{1*/
+void  DoubleVecExternalResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of DoubleVecExternalResult: */
+	enum_value=DoubleVecExternalResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall DoubleVecExternalResult 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,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+	memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
+	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 DoubleVecExternalResult::MarshallSize{{{1*/
+int   DoubleVecExternalResult::MarshallSize(){
+	
+	return sizeof(M)
+		+M*sizeof(double)
+		+sizeof(id)
+		+sizeof(enum_type)
+		+sizeof(step)
+		+sizeof(time)
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION DoubleVecExternalResult::MyRank{{{1*/
+int    DoubleVecExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.h	(revision 4050)
@@ -0,0 +1,68 @@
+/*! \file DoubleVecExternalResult.h 
+ */
+
+
+#ifndef _DOUBLEVECEXTERNALRESULT_H_
+#define _DOUBLEVECEXTERNALRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#ifdef _SERIAL_
+#include <mex.h>
+#endif
+
+
+#include "./ExternalResult.h"
+#include "../../include/include.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class DoubleVecExternalResult: public ExternalResult{
+
+	private: 
+		int id;
+		int enum_type;
+		double* values;
+		int M;
+		int step;
+		double time;
+
+	public:
+		/*constructors, destructors: {{{1*/
+		DoubleVecExternalResult();
+		DoubleVecExternalResult(int id,int enum_type,double* values,int M,int step, double time);
+		~DoubleVecExternalResult();
+		/*}}}*/
+		/*Object methods: {{{1*/
+		Object* copy();
+		void  DeepEcho();
+		void  Demarshall(char** pmarshalled_dataset);
+		void  Echo();
+		int   Enum();
+		int   Id();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		int   MyRank();
+
+		void  UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromSolution(double* solution){ISSMERROR("Not implemented yet!");}
+		/*}}}*/
+		/*ExternalResult methods: {{{1*/
+		int   EnumType(){return enum_type;}
+		/*}}}*/
+};
+#endif  /* _DOUBLEVECEXTERNALRESULT_H */
Index: /issm/trunk/src/c/objects/ExternalResults/ExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/ExternalResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/ExternalResult.h	(revision 4050)
@@ -0,0 +1,37 @@
+/*!\file:  ExternalResult.h
+ * \brief abstract class for ExternalResult object
+ */ 
+
+
+#ifndef _EXTERNALRESULT_H_
+#define _EXTERNALRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#ifdef _SERIAL_
+#include <mex.h>
+#endif
+
+#include "../Object.h"
+#include "../Node.h"
+/*}}}*/
+
+class ExternalResult: public Object{
+
+	public: 
+		
+		virtual        ~ExternalResult(){};
+
+		/*methods:{{{1*/
+		virtual int   EnumType()=0;
+		/*}}}*/
+
+};
+#endif
Index: /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp	(revision 4050)
@@ -0,0 +1,141 @@
+/*!\file IntExternalResult.c
+ * \brief: implementation of the IntExternalResult object
+ */
+
+/*header files: */
+/*{{{1*/
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+/*}}}*/
+
+/*Object constructors and destructor*/
+/*FUNCTION IntExternalResult::IntExternalResult(){{{1*/
+IntExternalResult::IntExternalResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION IntExternalResult::IntExternalResult(int enum_type,double value){{{1*/
+IntExternalResult::IntExternalResult(int in_id, int in_enum_type,int in_value,int in_step, double in_time){
+
+	id=in_id;
+	enum_type=in_enum_type;
+	value=in_value;
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION IntExternalResult::~IntExternalResult(){{{1*/
+IntExternalResult::~IntExternalResult(){
+	return;
+}
+/*}}}*/
+
+/*Object methods*/
+/*FUNCTION IntExternalResult::copy{{{1*/
+Object* IntExternalResult::copy() {
+	
+	return new IntExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+/*FUNCTION IntExternalResult::DeepEcho{{{1*/
+void IntExternalResult::DeepEcho(void){
+
+	printf("IntExternalResult:\n");
+	printf("   id: %i\n",this->id);
+	printf("   enum:  %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	printf("   value: %i\n",this->value);
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+}
+/*}}}*/
+/*FUNCTION IntExternalResult::Demarshall{{{1*/
+void  IntExternalResult::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 IntExternalResult::Echo {{{1*/
+void IntExternalResult::Echo(void){
+	this->DeepEcho();
+}
+/*}}}*/
+/*FUNCTION IntExternalResult::Enum{{{1*/
+int IntExternalResult::Enum(void){
+
+	return IntExternalResultEnum;
+
+}
+/*}}}*/
+/*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; 
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/IntExternalResult.h	(revision 4050)
@@ -0,0 +1,69 @@
+/*! \file IntExternalResult.h 
+ *  \brief: header file for triavertexinput object
+ */
+
+
+#ifndef _INTEXTERNALRESULT_H_
+#define _INTEXTERNALRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#ifdef _SERIAL_
+#include <mex.h>
+#endif
+
+
+#include "./ExternalResult.h"
+#include "../../include/include.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class IntExternalResult: public ExternalResult{
+
+	public:
+		int    id;
+		int    enum_type;
+		int    value;
+		int    step;
+		double time;
+
+
+		/*constructors, destructors: {{{1*/
+		IntExternalResult();
+		IntExternalResult(int id,int enum_type,int value,int step,double time);
+		~IntExternalResult();
+
+		/*}}}*/
+		/*Object methods: {{{1*/
+		Object* copy();
+		void  DeepEcho();
+		void  Demarshall(char** pmarshalled_dataset);
+		void  Echo();
+		int   Enum();
+		int   Id();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		int   MyRank();
+
+		void  UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromSolution(double* solution){ISSMERROR("Not implemented yet!");}
+		/*}}}*/
+		/*ExternalResult methods: {{{1*/
+		int   EnumType(){return enum_type;}
+		/*}}}*/
+};
+#endif  /* _INTEXTERNALRESULT_H */
Index: /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp	(revision 4050)
@@ -0,0 +1,195 @@
+/*!\file PetscVecExternalResult.c
+ * \brief: implementation of the PetscVecExternalResult object
+ */
+
+/*header files: */
+/*{{{1*/
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+/*}}}*/
+
+/*Object constructors and destructor*/
+/*FUNCTION PetscVecExternalResult::PetscVecExternalResult(){{{1*/
+PetscVecExternalResult::PetscVecExternalResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION PetscVecExternalResult::PetscVecExternalResult(int enum_type,IssmPetscVec value){{{1*/
+PetscVecExternalResult::PetscVecExternalResult(int in_id, int in_enum_type,Vec in_value,int in_step, double in_time){
+
+	id=in_id;
+	enum_type=in_enum_type;
+
+	value=NULL;
+
+	if(in_value){
+		VecDuplicate(in_value,&value);
+		VecCopy(in_value,value);
+	}
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION PetscVecExternalResult::~PetscVecExternalResult(){{{1*/
+PetscVecExternalResult::~PetscVecExternalResult(){
+	VecFree(&value);
+}
+/*}}}*/
+
+/*Object methods*/
+/*FUNCTION PetscVecExternalResult::copy{{{1*/
+Object* PetscVecExternalResult::copy() {
+	
+	return new PetscVecExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+/*FUNCTION PetscVecExternalResult::DeepEcho{{{1*/
+void PetscVecExternalResult::DeepEcho(void){
+
+	int i;
+	printf("PetscVecExternalResult:\n");
+	printf("   id: %i\n",this->id);
+	printf("   enum: %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+	VecView(value,PETSC_VIEWER_STDOUT_WORLD);
+}
+/*}}}*/
+/*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::Marshall{{{1*/
+void  PetscVecExternalResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+	int   M;
+	double* serial_value=NULL;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of PetscVecExternalResult: */
+	enum_value=PetscVecExternalResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall PetscVecExternalResult 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,&step,sizeof(step));marshalled_dataset+=sizeof(step);
+	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
+	
+	if(value){
+		VecGetSize(value,&M);
+		VecToMPISerial(&serial_value,value);
+		memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+		memcpy(marshalled_dataset,serial_value,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
+	}
+	else{
+		M=0;
+		memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
+	}
+	/*Free ressources:*/
+	xfree((void**)&serial_value);
+
+	/*return:*/
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION PetscVecExternalResult::MarshallSize{{{1*/
+int   PetscVecExternalResult::MarshallSize(){
+
+	int M=0;
+	if(value)VecGetSize(value,&M);
+
+	return sizeof(M)+M*sizeof(double)
+		+sizeof(id)
+		+sizeof(enum_type)
+		+sizeof(step)
+		+sizeof(time)
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION PetscVecExternalResult::MyRank{{{1*/
+int    PetscVecExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.h	(revision 4050)
@@ -0,0 +1,67 @@
+/*! \file PetscVecExternalResult.h 
+ *  \brief: header file for triavertexinput object
+ */
+
+
+#ifndef _PETSCVECEXTERNALRESULT_H_
+#define _PETSCVECEXTERNALRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#ifdef _SERIAL_
+#include <mex.h>
+#endif
+
+
+#include "./ExternalResult.h"
+#include "../../include/include.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class PetscVecExternalResult: public ExternalResult{
+
+	private: 
+		int id;
+		int enum_type;
+		Vec value;
+		int step;
+		double time;
+
+	public:
+		/*constructors, destructors: {{{1*/
+		PetscVecExternalResult();
+		PetscVecExternalResult(int id,int enum_type,Vec value, int step, double time);
+		~PetscVecExternalResult();
+		/*}}}*/
+		/*Object methods: {{{1*/
+		Object* copy();
+		void  DeepEcho();
+		void  Demarshall(char** pmarshalled_dataset);
+		void  Echo();
+		int   Enum();
+		int   Id();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		int   MyRank();
+		void  UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromSolution(double* solution){ISSMERROR("Not implemented yet!");}
+		/*}}}*/
+		/*ExternalResult methods: {{{1*/
+		int   EnumType(){return enum_type;}
+		/*}}}*/
+};
+#endif  /* _PETSCVECEXTERNALRESULT_H */
Index: /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp	(revision 4050)
@@ -0,0 +1,156 @@
+/*!\file StringExternalResult.c
+ * \brief: implementation of the StringExternalResult object
+ */
+
+/*header files: */
+/*{{{1*/
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "stdio.h"
+#include <string.h>
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../DataSet/DataSet.h"
+#include "../../include/include.h"
+/*}}}*/
+
+/*Object constructors and destructor*/
+/*FUNCTION StringExternalResult::StringExternalResult(){{{1*/
+StringExternalResult::StringExternalResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION StringExternalResult::StringExternalResult(int enum_type,IssmString value){{{1*/
+StringExternalResult::StringExternalResult(int in_id, int in_enum_type,char* in_value,int in_step, double in_time){
+
+	id=in_id;
+	enum_type=in_enum_type;
+	value=(char*)xmalloc((strlen(in_value)+1)*sizeof(char));
+	strcpy(value,in_value);
+	step=in_step;
+	time=in_time;
+	
+}
+/*}}}*/
+/*FUNCTION StringExternalResult::~StringExternalResult(){{{1*/
+StringExternalResult::~StringExternalResult(){
+	xfree((void**)&value);
+}
+/*}}}*/
+
+/*Object methods*/
+/*FUNCTION StringExternalResult::copy{{{1*/
+Object* StringExternalResult::copy() {
+	
+	return new StringExternalResult(this->id,this->enum_type,this->value,this->step,this->time);
+
+}
+/*}}}*/
+/*FUNCTION StringExternalResult::DeepEcho{{{1*/
+void StringExternalResult::DeepEcho(void){
+
+	printf("StringExternalResult:\n");
+	printf("   id: %i\n",this->id);
+	printf("   enum:  %i (%s)\n",this->enum_type,EnumAsString(this->enum_type));
+	printf("   value: %s\n",this->value);
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+}
+/*}}}*/
+/*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(this->value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+	memcpy(this->step,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+	memcpy(this->time,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+
+	/*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::Marshall{{{1*/
+void  StringExternalResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+	int   stringsize;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of StringExternalResult: */
+	enum_value=StringExternalResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+
+	/*marshall data: */
+	memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	stringsize=strlen(this->value)+1;
+	
+	memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
+	memcpy(marshalled_dataset,this->value,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+	memcpy(marshalled_dataset,this->step,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+	memcpy(marshalled_dataset,this->time,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION StringExternalResult::MarshallSize{{{1*/
+int   StringExternalResult::MarshallSize(){
+
+	int stringsize;
+	stringsize=strlen(this->value)+1;
+	
+	return sizeof(int)+
+		+stringsize*sizeof(char)
+		+sizeof(id)
+		+sizeof(enum_type)
+		+sizeof(step)
+		+sizeof(time)
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION StringExternalResult::MyRank{{{1*/
+int    StringExternalResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
Index: /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.h
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.h	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/StringExternalResult.h	(revision 4050)
@@ -0,0 +1,68 @@
+/*! \file StringExternalResult.h 
+ *  \brief: header file for triavertexinput object
+ */
+
+
+#ifndef _STRINGEXTERNALRESULT_H_
+#define _STRINGEXTERNALRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#ifdef _SERIAL_
+#include <mex.h>
+#endif
+
+
+#include "./ExternalResult.h"
+#include "../../include/include.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class StringExternalResult: public ExternalResult{
+
+	private: 
+		int    id;
+		int    enum_type;
+		char*  value;
+		int    step;
+		double time;
+
+	public:
+		/*constructors, destructors: {{{1*/
+		StringExternalResult();
+		StringExternalResult(int id,int enum_type,char* value,int step, double time);
+		~StringExternalResult();
+		/*}}}*/
+		/*Object methods: {{{1*/
+		Object* copy();
+		void  DeepEcho();
+		void  Demarshall(char** pmarshalled_dataset);
+		void  Echo();
+		int   Enum();
+		int   Id();
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		int   MyRank();
+
+		void  UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
+		void  UpdateInputsFromSolution(double* solution){ISSMERROR("Not implemented yet!");}
+		/*}}}*/
+		/*ExternalResult methods: {{{1*/
+		int   EnumType(){return enum_type;}
+		/*}}}*/
+};
+#endif  /* _STRINGEXTERNALRESULT_H */
Index: /issm/trunk/src/c/objects/ExternalResults/list
===================================================================
--- /issm/trunk/src/c/objects/ExternalResults/list	(revision 4050)
+++ /issm/trunk/src/c/objects/ExternalResults/list	(revision 4050)
@@ -0,0 +1,6 @@
+BoolExternalResultEnum
+DoubleExternalResultEnum
+DoubleVecExternalResultEnum
+IntExternalResultEnum
+PetscVecExternalResultEnum
+StringExternalResultEnum
Index: /issm/trunk/src/c/objects/FemModel.cpp
===================================================================
--- /issm/trunk/src/c/objects/FemModel.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/FemModel.cpp	(revision 4050)
@@ -31,4 +31,5 @@
 	this->solution_type=in_solution_type;
 	analysis_counter=nummodels-1; //point to last analysis_type carried out.
+	this->results=new DataSet(); //not initialized by CreateDataSets
 	
 	/*Dynamically allocate whatever is a list of length nummodels: */
@@ -100,4 +101,5 @@
 	delete materials;
 	delete parameters;
+	delete results;
 	delete partition;
 	delete tpartition;
Index: /issm/trunk/src/c/objects/FemModel.h
===================================================================
--- /issm/trunk/src/c/objects/FemModel.h	(revision 4049)
+++ /issm/trunk/src/c/objects/FemModel.h	(revision 4050)
@@ -35,4 +35,5 @@
 		DataSet*            materials;  //one set of materials, for each element
 		Parameters*         parameters; //one set of parameters, independent of the analysis_type
+		DataSet*            results; //results that cannot be fit into the elements (such as one time constants, arrays, strings, etc ...)
 
 		DofVec*             partition; //one partitioning for all elements
Index: /issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp	(revision 4050)
@@ -167,7 +167,7 @@
 /*}}}*/
 /*FUNCTION BeamVertexInput::SpawnResult{{{1*/
-Result* BeamVertexInput::SpawnResult(int step, double time){
-
-	return new BeamVertexResult(this->enum_type,this->values,step,time);
+ElementResult* BeamVertexInput::SpawnResult(int step, double time){
+
+	return new BeamVertexElementResult(this->enum_type,this->values,step,time);
 
 }
@@ -267,5 +267,5 @@
 
 	/*xinput is of the same type, so cast it: */
-	xbeamvertexinput=(BeamVertexInput)xinput;
+	xbeamvertexinput=(BeamVertexInput*)xinput;
 
 	/*Carry out the AXPY operation:*/
Index: /issm/trunk/src/c/objects/Inputs/BeamVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BeamVertexInput.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/BeamVertexInput.h	(revision 4050)
@@ -48,5 +48,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
-		Result* SpawnResult(int step, double time);
+		ElementResult* SpawnResult(int step, double time);
 
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/BoolInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BoolInput.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/BoolInput.cpp	(revision 4050)
@@ -175,5 +175,5 @@
 /*}}}*/
 /*FUNCTION BoolInput::SpawnResult{{{1*/
-Result* BoolInput::SpawnResult(int step, double time){
+ElementResult* BoolInput::SpawnResult(int step, double time){
 
 	ISSMERROR(" not supported yet!");
@@ -234,5 +234,5 @@
 
 	/*xinput is of the same type, so cast it: */
-	xboolinput=(BoolInput)xinput;
+	xboolinput=(BoolInput*)xinput;
 
 	/*Carry out the AXPY operation:*/
Index: /issm/trunk/src/c/objects/Inputs/BoolInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/BoolInput.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/BoolInput.h	(revision 4050)
@@ -48,5 +48,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
-		Result* SpawnResult(int step, double time);
+		ElementResult* SpawnResult(int step, double time);
 
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/DoubleInput.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/DoubleInput.cpp	(revision 4050)
@@ -175,7 +175,7 @@
 /*}}}*/
 /*FUNCTION DoubleInput::SpawnResult{{{1*/
-Result* DoubleInput::SpawnResult(int step, double time){
-
-	return new DoubleResult(this->enum_type,this->value,step,time);
+ElementResult* DoubleInput::SpawnResult(int step, double time){
+
+	return new DoubleElementResult(this->enum_type,this->value,step,time);
 
 }
@@ -245,5 +245,5 @@
 
 	/*xinput is of the same type, so cast it: */
-	xdoubleinput=(DoubleInput)xinput;
+	xdoubleinput=(DoubleInput*)xinput;
 
 	/*Carry out the AXPY operation:*/
Index: /issm/trunk/src/c/objects/Inputs/DoubleInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/DoubleInput.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/DoubleInput.h	(revision 4050)
@@ -49,5 +49,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
-		Result* SpawnResult(int step, double time);
+		ElementResult* SpawnResult(int step, double time);
 
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/Input.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/Input.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/Input.h	(revision 4050)
@@ -11,5 +11,5 @@
 #include "../Object.h"
 class Node;
-class Result;
+class ElementResult;
 #include "../Node.h"
 /*}}}*/
@@ -49,5 +49,5 @@
 		virtual Input* SpawnBeamInput(int* indices)=0;
 		virtual Input* SpawnTriaInput(int* indices)=0;
-		virtual Result* SpawnResult(int step, double time)=0;
+		virtual ElementResult* SpawnResult(int step, double time)=0;
 		virtual void SquareMin(double* psquaremin, bool process_units,Parameters* parameters)=0;
 		virtual void Scale(double scale_factor)=0;
Index: /issm/trunk/src/c/objects/Inputs/IntInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/IntInput.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/IntInput.cpp	(revision 4050)
@@ -172,5 +172,5 @@
 /*}}}*/
 /*FUNCTION IntInput::SpawnResult{{{1*/
-Result* IntInput::SpawnResult(int step, double time){
+ElementResult* IntInput::SpawnResult(int step, double time){
 	
 	ISSMERROR(" not supported yet!");
@@ -223,17 +223,20 @@
 /*FUNCTION IntInput::Scale(double scale_factor){{{1*/
 void IntInput::Scale(double scale_factor){
-	value=value*scale_factor;
+	double dvalue=(double)value*scale_factor;
+	value=(int)dvalue;
 }
 /*}}}*/
 /*FUNCTION IntInput::AXPY(Input* xinput,int scalar);{{{1*/
-void IntInput::AXPY(Input* xinput,int scalar){
-
+void IntInput::AXPY(Input* xinput,double scalar){
+
+	double dvalue;
 	IntInput*  xintinput=NULL;
 
 	/*xinput is of the same type, so cast it: */
-	xintinput=(IntInput)xinput;
+	xintinput=(IntInput*)xinput;
 
 	/*Carry out the AXPY operation:*/
-	this->value=this->value+scalar*xintinput->value;
+	dvalue=(double)this->value+scalar*(double)xintinput->value;
+	this->value=(int)dvalue;
 
 }
@@ -242,6 +245,6 @@
 void IntInput::Constrain(double cm_min, double cm_max){
 
-	if(!isnan(cm_min)) if (this->value<cm_min)this->value=cm_min;
-	if(!isnan(cm_max)) if (this->value>cm_max)this->value=cm_max;
+	if(!isnan(cm_min)) if (this->value<cm_min)this->value=(int)cm_min;
+	if(!isnan(cm_max)) if (this->value>cm_max)this->value=(int)cm_max;
 
 }
Index: /issm/trunk/src/c/objects/Inputs/IntInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/IntInput.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/IntInput.h	(revision 4050)
@@ -48,5 +48,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
-		Result* SpawnResult(int step, double time);
+		ElementResult* SpawnResult(int step, double time);
 
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp	(revision 4050)
@@ -200,7 +200,7 @@
 /*}}}*/
 /*FUNCTION PentaVertexInput::SpawnResult{{{1*/
-Result* PentaVertexInput::SpawnResult(int step, double time){
-
-	return new PentaVertexResult(this->enum_type,this->values,step,time);
+ElementResult* PentaVertexInput::SpawnResult(int step, double time){
+
+	return new PentaVertexElementResult(this->enum_type,this->values,step,time);
 
 }
@@ -916,5 +916,5 @@
 
 	/*xinput is of the same type, so cast it: */
-	xpentavertexinput=(PentaVertexInput)xinput;
+	xpentavertexinput=(PentaVertexInput*)xinput;
 
 	/*Carry out the AXPY operation:*/
Index: /issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/PentaVertexInput.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/PentaVertexInput.h	(revision 4050)
@@ -47,5 +47,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
-		Result* SpawnResult(int step, double time);
+		ElementResult* SpawnResult(int step, double time);
 
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp	(revision 4050)
@@ -158,7 +158,7 @@
 /*}}}*/
 /*FUNCTION SingVertexInput::SpawnResult{{{1*/
-Result* SingVertexInput::SpawnResult(int step, double time){
-
-	return new SingVertexResult(this->enum_type,this->value,step,time);
+ElementResult* SingVertexInput::SpawnResult(int step, double time){
+
+	return new SingVertexElementResult(this->enum_type,this->value,step,time);
 
 }
@@ -235,8 +235,8 @@
 
 	/*xinput is of the same type, so cast it: */
-	xsingvertexinput=(SingVertexInput)xinput;
+	xsingvertexinput=(SingVertexInput*)xinput;
 
 	/*Carry out the AXPY operation:*/
-	this->value=this->value+scalar*xngvertexinput->value;
+	this->value=this->value+scalar*xsingvertexinput->value;
 
 }
Index: /issm/trunk/src/c/objects/Inputs/SingVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/SingVertexInput.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/SingVertexInput.h	(revision 4050)
@@ -47,5 +47,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
-		Result* SpawnResult(int step, double time);
+		ElementResult* SpawnResult(int step, double time);
 
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
===================================================================
--- /issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp	(revision 4050)
@@ -186,7 +186,7 @@
 /*}}}*/
 /*FUNCTION TriaVertexInput::SpawnResult{{{1*/
-Result* TriaVertexInput::SpawnResult(int step, double time){
-
-	return new TriaVertexResult(this->enum_type,this->values,step,time);
+ElementResult* TriaVertexInput::SpawnResult(int step, double time){
+
+	return new TriaVertexElementResult(this->enum_type,this->values,step,time);
 
 }
@@ -490,5 +490,5 @@
 
 	/*xinput is of the same type, so cast it: */
-	xtriavertexinput=(TriaVertexInput)xinput;
+	xtriavertexinput=(TriaVertexInput*)xinput;
 
 	/*Carry out the AXPY operation:*/
Index: /issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
===================================================================
--- /issm/trunk/src/c/objects/Inputs/TriaVertexInput.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Inputs/TriaVertexInput.h	(revision 4050)
@@ -47,5 +47,5 @@
 		Input* SpawnBeamInput(int* indices);
 		Input* SpawnTriaInput(int* indices);
-		Result* SpawnResult(int step, double time);
+		ElementResult* SpawnResult(int step, double time);
 
 		/*}}}*/
Index: /issm/trunk/src/c/objects/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Loads/Pengrid.cpp	(revision 4050)
@@ -466,5 +466,5 @@
 	parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
 
-	//Create elementary matrix: add penalty to contrain wb (wb=ub*db/dx+vb*db/dy)
+	//Create elementary matrix: add penalty to constrain wb (wb=ub*db/dx+vb*db/dy)
 	Ke[2][0]=-slope[0]*kmax*pow((double)10.0,penalty_offset);
 	Ke[2][1]=-slope[1]*kmax*pow((double)10.0,penalty_offset);
Index: /issm/trunk/src/c/objects/Params/DoubleVecParam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleVecParam.cpp	(revision 4049)
+++ /issm/trunk/src/c/objects/Params/DoubleVecParam.cpp	(revision 4050)
@@ -26,17 +26,17 @@
 }
 /*}}}*/
-/*FUNCTION DoubleVecParam::DoubleVecParam(int enum_type,IssmDoubleVec value,int M){{{1*/
-DoubleVecParam::DoubleVecParam(int in_enum_type,double* in_value, int in_M){
+/*FUNCTION DoubleVecParam::DoubleVecParam(int enum_type,IssmDoubleVec values,int M){{{1*/
+DoubleVecParam::DoubleVecParam(int in_enum_type,double* in_values, int in_M){
 
 	enum_type=in_enum_type;
 	M=in_M;
 
-	value=(double*)xmalloc(M*sizeof(double));
-	memcpy(value,in_value,M*sizeof(double));
+	values=(double*)xmalloc(M*sizeof(double));
+	memcpy(values,in_values,M*sizeof(double));
 }
 /*}}}*/
 /*FUNCTION DoubleVecParam::~DoubleVecParam(){{{1*/
 DoubleVecParam::~DoubleVecParam(){
-	xfree((void**)&value);
+	xfree((void**)&values);
 	return;
 }
@@ -47,5 +47,5 @@
 Object* DoubleVecParam::copy() {
 	
-	return new DoubleVecParam(this->enum_type,this->value,this->M);
+	return new DoubleVecParam(this->enum_type,this->values,this->M);
 
 }
@@ -60,5 +60,5 @@
 	printf("   vector size: %i\n",this->M);
 	for(i=0;i<this->M;i++){
-		printf("%i %g\n",i,this->value[i]);
+		printf("%i %g\n",i,this->values[i]);
 	}
 }
@@ -79,6 +79,6 @@
 	/*data: */
 	memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
-	value=(double*)xmalloc(M*sizeof(double));
-	memcpy(value,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
+	values=(double*)xmalloc(M*sizeof(double));
+	memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
 
 	/*return: */
@@ -124,5 +124,5 @@
 	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,value,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
+	memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
 
 	*pmarshalled_dataset=marshalled_dataset;
@@ -152,5 +152,5 @@
 	M=this->M;
 	output=(double*)xmalloc(M*sizeof(double));
-	memcpy(output,value,M*sizeof(double));
+	memcpy(output,values,M*sizeof(double));
 
 	/*Assign output pointers:*/
@@ -168,5 +168,5 @@
 
 	int i;
-	double* newvalue=NULL;
+	double* newvalues=NULL;
 
 	/*This param holds a vector of size numberofvertices, which means we are being asked to 
@@ -175,13 +175,13 @@
 	if(this->M==numberofvertices){
 
-		newvalue=(double*)xmalloc(this->M*sizeof(double));
+		newvalues=(double*)xmalloc(this->M*sizeof(double));
 				
 		for(i=0;i<this->M;i++){
-			newvalue[(int)(partition[i])]=this->value[i];
+			newvalues[(int)(partition[i])]=this->values[i];
 		}
 
-		/*Reassign value to new value: */
-		xfree((void**)&this->value);
-		this->value=newvalue;
+		/*Reassign values to new values: */
+		xfree((void**)&this->values);
+		this->values=newvalues;
 	}
 
Index: /issm/trunk/src/c/objects/Params/DoubleVecParam.h
===================================================================
--- /issm/trunk/src/c/objects/Params/DoubleVecParam.h	(revision 4049)
+++ /issm/trunk/src/c/objects/Params/DoubleVecParam.h	(revision 4050)
@@ -31,7 +31,6 @@
 
 	private: 
-		/*just hold 3 values for 3 vertices: */
 		int enum_type;
-		IssmDouble* value;
+		IssmDouble* values;
 		int M;
 
@@ -39,5 +38,5 @@
 		/*constructors, destructors: {{{1*/
 		DoubleVecParam();
-		DoubleVecParam(int enum_type,IssmDouble* value,int M);
+		DoubleVecParam(int enum_type,IssmDouble* values,int M);
 		~DoubleVecParam();
 		/*}}}*/
Index: /issm/trunk/src/c/objects/objects.h
===================================================================
--- /issm/trunk/src/c/objects/objects.h	(revision 4049)
+++ /issm/trunk/src/c/objects/objects.h	(revision 4050)
@@ -50,11 +50,20 @@
 #include "./Inputs/TriaVertexInput.h"
 
-/*Results: */
-#include "./Results/Result.h"
-#include "./Results/DoubleResult.h"
-#include "./Results/TriaVertexResult.h"
-#include "./Results/PentaVertexResult.h"
-#include "./Results/SingVertexResult.h"
-#include "./Results/BeamVertexResult.h"
+/*ElementResults: */
+#include "./ElementResults/ElementResult.h"
+#include "./ElementResults/DoubleElementResult.h"
+#include "./ElementResults/TriaVertexElementResult.h"
+#include "./ElementResults/PentaVertexElementResult.h"
+#include "./ElementResults/SingVertexElementResult.h"
+#include "./ElementResults/BeamVertexElementResult.h"
+
+/*ExternalResults: */
+#include "./ExternalResults/ExternalResult.h"
+#include "./ExternalResults/BoolExternalResult.h"
+#include "./ExternalResults/DoubleExternalResult.h"
+#include "./ExternalResults/DoubleVecExternalResult.h"
+#include "./ExternalResults/IntExternalResult.h"
+#include "./ExternalResults/PetscVecExternalResult.h"
+#include "./ExternalResults/StringExternalResult.h"
 
 /*Materials: */
