Index: /issm/trunk/src/c/Bamgx/Bamgx.h
===================================================================
--- /issm/trunk/src/c/Bamgx/Bamgx.h	(revision 3684)
+++ /issm/trunk/src/c/Bamgx/Bamgx.h	(revision 3685)
@@ -7,5 +7,4 @@
 
 #include "../objects/objects.h"
-#include "objects/BamgObjects.h"
 
 /* local prototypes: */
Index: /issm/trunk/src/c/DataSet/DataSet.cpp
===================================================================
--- /issm/trunk/src/c/DataSet/DataSet.cpp	(revision 3684)
+++ /issm/trunk/src/c/DataSet/DataSet.cpp	(revision 3685)
@@ -1,7 +1,8 @@
 /*
  * \file DataSet.c
- * \brief: implementation of the DataSet class
+ * \brief: implementation of the DataSet class, and derived classes Inputs and Parameters
  */
 
+/*Headers: {{{1*/
 #ifdef HAVE_CONFIG_H
 	#include "config.h"
@@ -21,7 +22,8 @@
 
 using namespace std;
-
+/*}}}*/
+/*DataSet: {{{1*/
 /*Constructors/Destructors*/
-/*FUNCTION DataSet::DataSet(){{{1*/
+/*FUNCTION DataSet::DataSet(){{{2*/
 DataSet::DataSet(){
 	
@@ -32,5 +34,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::DataSet(int dataset_enum){{{1*/
+/*FUNCTION DataSet::DataSet(int dataset_enum){{{2*/
 DataSet::DataSet(int dataset_enum){
 	enum_type=dataset_enum;
@@ -42,5 +44,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Copy{{{1*/
+/*FUNCTION DataSet::Copy{{{2*/
 DataSet*   DataSet::Copy(void){
 
@@ -73,5 +75,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::~DataSet{{{1*/
+/*FUNCTION DataSet::~DataSet{{{2*/
 DataSet::~DataSet(){
 	clear();
@@ -82,5 +84,5 @@
 
 /*I/O*/
-/*FUNCTION DataSet::Marshall{{{1*/
+/*FUNCTION DataSet::Marshall{{{2*/
 char* DataSet::Marshall(){
 
@@ -129,5 +131,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::MarshallSize{{{1*/
+/*FUNCTION DataSet::MarshallSize{{{2*/
 int DataSet::MarshallSize(){
 
@@ -150,5 +152,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Demarshall{{{1*/
+/*FUNCTION DataSet::Demarshall{{{2*/
 DataSet* DataSetDemarshall(char* marshalled_dataset){
 
@@ -157,5 +159,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::DemarshallRaw{{{1*/
+/*FUNCTION DataSet::DemarshallRaw{{{2*/
 DataSet* DataSetDemarshallRaw(char** pmarshalled_dataset){
 
@@ -309,5 +311,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Spawn{{{1*/
+/*FUNCTION DataSet::Spawn{{{2*/
 DataSet* DataSet::Spawn(int* indices, int num){
 	ISSMERROR(" not supported yet!");
@@ -316,5 +318,5 @@
 
 /*Specific methods*/
-/*FUNCTION DataSet::AddObject{{{1*/
+/*FUNCTION DataSet::AddObject{{{2*/
 int  DataSet::AddObject(Object* object){
 
@@ -324,5 +326,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::clear{{{1*/
+/*FUNCTION DataSet::clear{{{2*/
 void  DataSet::clear(){
 
@@ -335,5 +337,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::DeleteObject{{{1*/
+/*FUNCTION DataSet::DeleteObject{{{2*/
 int  DataSet::DeleteObject(Object* object){
 
@@ -348,5 +350,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::DeepEcho{{{1*/
+/*FUNCTION DataSet::DeepEcho{{{2*/
 void DataSet::DeepEcho(){
 
@@ -367,5 +369,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Echo{{{1*/
+/*FUNCTION DataSet::Echo{{{2*/
 void DataSet::Echo(){
 
@@ -386,5 +388,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::FindResult(Vec* presult,char* name){{{1*/
+/*FUNCTION DataSet::FindResult(Vec* presult,char* name){{{2*/
 int   DataSet::FindResult(Vec* presult,char* name){
 
@@ -416,5 +418,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::FindResult(void* pvalue, char* name){{{1*/
+/*FUNCTION DataSet::FindResult(void* pvalue, char* name){{{2*/
 int   DataSet::FindResult(void* pvalue, char* name){
 
@@ -448,10 +450,10 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::GetEnum{{{1*/
+/*FUNCTION DataSet::GetEnum{{{2*/
 int  DataSet::GetEnum(){
 	return enum_type;
 }
 /*}}}*/
-/*FUNCTION DataSet::GetEnum(int offset){{{1*/
+/*FUNCTION DataSet::GetEnum(int offset){{{2*/
 int   DataSet::GetEnum(int offset){
 
@@ -460,5 +462,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::GetObjectByOffset{{{1*/
+/*FUNCTION DataSet::GetObjectByOffset{{{2*/
 Object* DataSet::GetObjectByOffset(int offset){
 
@@ -467,5 +469,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::GetObjectById{{{1*/
+/*FUNCTION DataSet::GetObjectById{{{2*/
 Object* DataSet::GetObjectById(int* poffset,int eid){
 
@@ -491,5 +493,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Ranks{{{1*/
+/*FUNCTION DataSet::Ranks{{{2*/
 void   DataSet::Ranks(int* ranks){
 
@@ -514,5 +516,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Presort{{{1*/
+/*FUNCTION DataSet::Presort{{{2*/
 void DataSet::Presort(){
 
@@ -534,5 +536,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::SetSorting{{{1*/
+/*FUNCTION DataSet::SetSorting{{{2*/
 void DataSet::SetSorting(int* in_sorted_ids,int* in_id_offsets){
 
@@ -542,5 +544,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Size{{{1*/
+/*FUNCTION DataSet::Size{{{2*/
 int  DataSet::Size(void){
 
@@ -548,5 +550,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Sort{{{1*/
+/*FUNCTION DataSet::Sort{{{2*/
 void DataSet::Sort(){
 
@@ -559,5 +561,5 @@
 
 /*Objects methods*/
-/*FUNCTION DataSet::ComputeBasalStress{{{1*/
+/*FUNCTION DataSet::ComputeBasalStress{{{2*/
 void DataSet::ComputeBasalStress(Vec sigma_b,int analysis_type,int sub_analysis_type){
 
@@ -576,5 +578,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::ComputePressure{{{1*/
+/*FUNCTION DataSet::ComputePressure{{{2*/
 void DataSet::ComputePressure(Vec p_g,int analysis_type,int sub_analysis_type){
 
@@ -593,5 +595,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::ComputeStrainRate{{{1*/
+/*FUNCTION DataSet::ComputeStrainRate{{{2*/
 void DataSet::ComputeStrainRate(Vec eps,int analysis_type,int sub_analysis_type){
 
@@ -610,5 +612,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Configure{{{1*/
+/*FUNCTION DataSet::Configure{{{2*/
 void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials,Parameters* parameters){
 
@@ -638,5 +640,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::CostFunction{{{1*/
+/*FUNCTION DataSet::CostFunction{{{2*/
 void  DataSet::CostFunction(double* pJ,int analysis_type,int sub_analysis_type){
 
@@ -661,5 +663,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::CreateKMatrix{{{1*/
+/*FUNCTION DataSet::CreateKMatrix{{{2*/
 void  DataSet::CreateKMatrix(Mat Kgg,int analysis_type,int sub_analysis_type){
 
@@ -684,5 +686,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::CreatePartitioningVector{{{1*/
+/*FUNCTION DataSet::CreatePartitioningVector{{{2*/
 void  DataSet::CreatePartitioningVector(Vec* ppartition,int numberofobjects){
 
@@ -712,5 +714,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::CreatePVector{{{1*/
+/*FUNCTION DataSet::CreatePVector{{{2*/
 void  DataSet::CreatePVector(Vec pg,int analysis_type,int sub_analysis_type){
 
@@ -735,5 +737,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::DistributeDofs{{{1*/
+/*FUNCTION DataSet::DistributeDofs{{{2*/
 void  DataSet::DistributeDofs(int numberofobjects,int numberofdofsperobject){
 
@@ -817,5 +819,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Du{{{1*/
+/*FUNCTION DataSet::Du{{{2*/
 void  DataSet::Du(Vec du_g,int analysis_type,int sub_analysis_type){
 
@@ -836,5 +838,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::FieldAverageOntoVertices{{{1*/
+/*FUNCTION DataSet::FieldAverageOntoVertices{{{2*/
 void DataSet::FieldAverageOntoVertices(Vec fieldsum,Vec connectivity,double* field){
 
@@ -853,5 +855,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::FieldDepthAverageAtBase{{{1*/
+/*FUNCTION DataSet::FieldDepthAverageAtBase{{{2*/
 void  DataSet::FieldDepthAverageAtBase(Vec field,double* field_serial,char* fieldname){
 
@@ -870,5 +872,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::FieldExtrude{{{1*/
+/*FUNCTION DataSet::FieldExtrude{{{2*/
 void  DataSet::FieldExtrude(Vec field,double* field_serial,char* field_name, int collapse){
 
@@ -895,5 +897,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::FlagClones{{{1*/
+/*FUNCTION DataSet::FlagClones{{{2*/
 void  DataSet::FlagClones(int numberofobjects){
 
@@ -936,5 +938,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::FlagNodeSets{{{1*/
+/*FUNCTION DataSet::FlagNodeSets{{{2*/
 void DataSet::FlagNodeSets(Vec pv_g, Vec pv_m, Vec pv_n, Vec pv_f, Vec pv_s){
 
@@ -973,5 +975,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Gradj{{{1*/
+/*FUNCTION DataSet::Gradj{{{2*/
 void  DataSet::Gradj(Vec grad_g,int analysis_type,int sub_analysis_type,char* control_type){
 
@@ -992,5 +994,5 @@
 }		
 /*}}}*/
-/*FUNCTION DataSet::MeltingIsPresent{{{1*/
+/*FUNCTION DataSet::MeltingIsPresent{{{2*/
 int   DataSet::MeltingIsPresent(){
 
@@ -1017,5 +1019,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::MeltingConstraints{{{1*/
+/*FUNCTION DataSet::MeltingConstraints{{{2*/
 void  DataSet::MeltingConstraints(int* pconverged, int* pnum_unstable_constraints,int analysis_type,int sub_analysis_type){
 
@@ -1059,5 +1061,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::Misfit{{{1*/
+/*FUNCTION DataSet::Misfit{{{2*/
 void  DataSet::Misfit(double* pJ,int analysis_type,int sub_analysis_type){
 
@@ -1082,5 +1084,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::NumberOfDofs{{{1*/
+/*FUNCTION DataSet::NumberOfDofs{{{2*/
 int   DataSet::NumberOfDofs(){
 
@@ -1114,5 +1116,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::NumberOfRgbs{{{1*/
+/*FUNCTION DataSet::NumberOfRgbs{{{2*/
 int   DataSet::NumberOfRgbs(){
 
@@ -1134,5 +1136,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::OutputRifts{{{1*/
+/*FUNCTION DataSet::OutputRifts{{{2*/
 void  DataSet::OutputRifts(Vec riftproperties){
 
@@ -1153,5 +1155,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::PenaltyCreateKMatrix{{{1*/
+/*FUNCTION DataSet::PenaltyCreateKMatrix{{{2*/
 void  DataSet::PenaltyCreateKMatrix(Mat Kgg,double kmax,int analysis_type,int sub_analysis_type){
 
@@ -1170,5 +1172,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::PenaltyCreatePVector{{{1*/
+/*FUNCTION DataSet::PenaltyCreatePVector{{{2*/
 void  DataSet::PenaltyCreatePVector(Vec pg,double kmax,int analysis_type,int sub_analysis_type){
 
@@ -1187,5 +1189,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::RiftIsPresent{{{1*/
+/*FUNCTION DataSet::RiftIsPresent{{{2*/
 int   DataSet::RiftIsPresent(){
 
@@ -1215,5 +1217,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::SetupMpcs{{{1*/
+/*FUNCTION DataSet::SetupMpcs{{{2*/
 void DataSet::SetupMpcs(Mat Rmg,DataSet* nodes){
 
@@ -1283,5 +1285,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::SetupSpcs{{{1*/
+/*FUNCTION DataSet::SetupSpcs{{{2*/
 void   DataSet::SetupSpcs(DataSet* nodes,Vec yg){
 
@@ -1322,5 +1324,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::SurfaceArea{{{1*/
+/*FUNCTION DataSet::SurfaceArea{{{2*/
 void  DataSet::SurfaceArea(double* pS,int analysis_type,int sub_analysis_type){
 
@@ -1345,5 +1347,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::UpdateInputs{{{1*/
+/*FUNCTION DataSet::UpdateInputs{{{2*/
 void  DataSet::UpdateInputs(double* solution, int analysis_type, int sub_analysis_type){
 
@@ -1362,5 +1364,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::AddInput{{{1*/
+/*FUNCTION DataSet::AddInput{{{2*/
 void  DataSet::AddInput(double value, int enum_type){
 
@@ -1379,5 +1381,5 @@
 }
 /*}}}*/
-/*FUNCTION DataSet::UpdateVertexPositions{{{1*/
+/*FUNCTION DataSet::UpdateVertexPositions{{{2*/
 void  DataSet::UpdateVertexPositions(double* thickness,double* bed){
 
@@ -1395,2 +1397,654 @@
 }
 /*}}}*/
+
+/*}}}*/
+/*Inputs: {{{1*/
+
+/*Object constructors and destructor*/
+/*FUNCTION Inputs::Inputs(){{{2*/
+Inputs::Inputs(){
+	return;
+}
+/*}}}*/
+/*FUNCTION Inputs::Inputs(int in_enum){{{2*/
+Inputs::Inputs(int in_enum): DataSet(in_enum) {
+	//do nothing;
+	return;
+}
+/*}}}*/
+/*FUNCTION Inputs::~Inputs(){{{2*/
+Inputs::~Inputs(){
+	return;
+}
+/*}}}*/
+
+/*Object management*/
+/*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type){{{2*/
+void Inputs::GetParameterValue(double* pvalue,double* gauss, int enum_type){
+
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	/*Go through inputs and check whether any input with the same name is already in: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+		if (input->EnumType()==enum_type)break;
+	}
+
+	if (!input){
+		/*we could not find an input with the correct enum type. No defaults values were provided, 
+		 * error out: */
+		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
+	}
+
+	/*Ok, we have an input if we made it here, request the input to return the values: */
+	input->GetParameterValue(pvalue,gauss);
+
+}
+/*}}}*/
+/*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type,double defaultvalue){{{2*/
+void Inputs::GetParameterValue(double* pvalue,double* gauss, int enum_type,double defaultvalue){
+
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	/*Go through inputs and check whether any input with the same name is already in: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+		if (input->EnumType()==enum_type)break;
+	}
+
+	if (!input){
+		/*we could not find an input with the correct enum type. Return the default value: */
+		*pvalue=defaultvalue;
+	}
+	else{
+		input->GetParameterValue(pvalue,gauss);
+	}
+}
+/*}}}*/
+/*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type){{{2*/
+void Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type){
+
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	/*Go through inputs and check whether any input with the same name is already in: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+		if (input->EnumType()==enum_type)break;
+	}
+
+	if (!input){
+		/*we could not find an input with the correct enum type. No defaults values were provided, 
+		 * error out: */
+		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
+	}
+
+	/*Ok, we have an input if we made it here, request the input to return the values: */
+	input->GetParameterValues(values,gauss_pointers,numgauss);
+
+}
+/*}}}*/
+/*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node, int enum_type){{{2*/
+void Inputs::GetParameterValue(double* pvalue,Node* node,int enum_type){
+
+	/*given a node, instead of a gauss point, we want to recover a value: probably in an element!: */
+
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	/*Go through inputs and check whether any input with the same name is already in: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+		if (input->EnumType()==enum_type)break;
+	}
+
+	if (!input){
+		/*we could not find an input with the correct enum type. No defaults values were provided, 
+		 * error out: */
+		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
+	}
+
+	/*Ok, we have an input if we made it here, request the input to return the values: */
+	input->GetParameterValue(pvalue,node);
+}
+/*}}}*/
+/*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node1, Node* node2,int enum_type){{{2*/
+void Inputs::GetParameterValue(double* pvalue,Node* node1, Node* node2,double gauss_coord,int enum_type){
+
+	/*given a node, instead of a gauss point, we want to recover a value: probably in an element!: */
+
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	/*Go through inputs and check whether any input with the same name is already in: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+		if (input->EnumType()==enum_type)break;
+	}
+
+	if (!input){
+		/*we could not find an input with the correct enum type. No defaults values were provided, 
+		 * error out: */
+		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
+	}
+
+	/*Ok, we have an input if we made it here, request the input to return the values: */
+	input->GetParameterValue(pvalue,node1,node2,gauss_coord);
+}
+/*}}}*/
+/*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){{{2*/
+void Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){
+
+	int i;
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	/*Go through inputs and check whether any input with the same name is already in: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+		if (input->EnumType()==enum_type)break;
+	}
+
+	if (!input){
+		/*we could not find an input with the correct enum type. Return the default values: */
+		for(i=0;i<numgauss;i++)values[i]=defaultvalues[i];
+	}
+	else{
+		input->GetParameterValues(values,gauss_pointers,numgauss);
+	}
+
+}
+/*}}}*/
+/*FUNCTION Inputs::GetParameterValue(bool* pvalue,int enum-type){{{2*/
+void Inputs::GetParameterValue(bool* pvalue,int enum_type){
+
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	/*Go through inputs and check whether any input with the same name is already in: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+		if (input->EnumType()==enum_type)break;
+	}
+
+	if (!input){
+		/*we could not find an input with the correct enum type. No defaults values were provided, 
+		 * error out: */
+		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
+	}
+
+	/*Ok, we have an input if we made it here, request the input to return the value: */
+	input->GetParameterValue(pvalue);
+
+}
+/*}}}*/
+/*FUNCTION Inputs::GetParameterValue(int* pvalue,int enum-type){{{2*/
+void Inputs::GetParameterValue(int* pvalue,int enum_type){
+
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	/*Go through inputs and check whether any input with the same name is already in: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+		if (input->EnumType()==enum_type)break;
+	}
+
+	if (!input){
+		/*we could not find an input with the correct enum type. No defaults values were provided, 
+		 * error out: */
+		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
+	}
+
+	/*Ok, we have an input if we made it here, request the input to return the value: */
+	input->GetParameterValue(pvalue);
+
+}
+/*}}}*/
+/*FUNCTION Inputs::GetParameterValue(double* pvalue,int enum-type){{{2*/
+void Inputs::GetParameterValue(double* pvalue,int enum_type){
+
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	/*Go through inputs and check whether any input with the same name is already in: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+		if (input->EnumType()==enum_type)break;
+	}
+
+	if (!input){
+		/*we could not find an input with the correct enum type. No defaults values were provided, 
+		 * error out: */
+		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
+	}
+
+	/*Ok, we have an input if we made it here, request the input to return the value: */
+	input->GetParameterValue(pvalue);
+
+}
+/*}}}*/
+/*FUNCTION Inputs::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type){{{2*/
+void Inputs::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type){
+
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	/*Go through inputs and check whether any input with the same name is already in: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+		if (input->EnumType()==enum_type)break;
+	}
+
+	if (!input){
+		/*we could not find an input with the correct enum type. No defaults values were provided, 
+		 * error out: */
+		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
+	}
+
+	/*Ok, we have an input if we made it here, request the input to return the value: */
+	input->GetParameterDerivativeValue(derivativevalues,xyz_list,gauss);
+}
+/*}}}*/
+/*FUNCTION Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum){{{2*/
+void Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum){
+
+	vector<Object*>::iterator object;
+	Input* xinput=NULL;
+	Input* yinput=NULL;
+
+	/*Go through inputs and find data for xenum: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		xinput=(Input*)(*object); 
+		if (xinput->EnumType()==xenum)break;
+	}
+	/*Go through inputs and find data for yenum: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		yinput=(Input*)(*object); 
+		if (yinput->EnumType()==yenum)break;
+	}
+
+	if (!xinput | !yinput){
+		/*we could not find one input with the correct enum type. No defaults values were provided, 
+		 * error out: */
+		ISSMERROR("%s%i%s%i\n"," could not find input with enum type ",xenum," or enum type ",yenum);
+	}
+
+	/*Ok, we have the inputs, call bilinear operator: */
+	xinput->GetStrainRate(epsilon,yinput,xyz_list,gauss);
+
+}
+/*}}}*/
+/*FUNCTION Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){{{2*/
+void Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){
+
+	vector<Object*>::iterator object;
+	Input* xinput=NULL;
+	Input* yinput=NULL;
+	Input* zinput=NULL;
+
+	/*Go through inputs and find data for xenum: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		xinput=(Input*)(*object); 
+		if (xinput->EnumType()==xenum)break;
+	}
+	/*Go through inputs and find data for yenum: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		yinput=(Input*)(*object); 
+		if (yinput->EnumType()==yenum)break;
+	}
+	/*Go through inputs and find data for zenum: */
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+		zinput=(Input*)(*object); 
+		if (zinput->EnumType()==zenum)break;
+	}
+
+	if (!xinput | !yinput | !zinput){
+		/*we could not find one input with the correct enum type. No defaults values were provided, 
+		 * error out: */
+		ISSMERROR("%s%i%s%i%s%i\n"," could not find input with enum type ",xenum," or enum type ",yenum, " or enum type ",zenum);
+	}
+
+	/*Ok, we have the inputs, call bilinear operator: */
+	xinput->GetStrainRateStokes(epsilon,yinput,zinput,xyz_list,gauss);
+
+}
+/*}}}*/
+/*FUNCTION Inputs::AddInput{{{2*/
+int  Inputs::AddInput(Input* in_input){
+
+	/*First, go through dataset of inputs and check whether any input 
+	 * with the same name is already in. If so, erase the corresponding 
+	 * object before adding this new one: */
+	vector<Object*>::iterator object;
+	Input* input=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		input=(Input*)(*object); 
+
+		if (input->EnumType()==in_input->EnumType()){
+			this->DeleteObject(input);
+			break;
+		}
+	}
+	this->AddObject(in_input);
+}
+/*}}}*/
+
+/*Object functions*/
+
+
+/*}}}*/
+/*Parameters: {{{1*/
+
+
+/*Object constructors and destructor*/
+/*FUNCTION Parameters::Parameters(){{{2*/
+Parameters::Parameters(){
+	return;
+}
+/*}}}*/
+/*FUNCTION Parameters::Parameters(int in_enum){{{2*/
+Parameters::Parameters(int in_enum): DataSet(in_enum){
+	//do nothing;
+	return;
+}
+/*}}}*/
+/*FUNCTION Parameters::~Parameters(){{{2*/
+Parameters::~Parameters(){
+	return;
+}
+/*}}}*/
+
+/*Object management*/
+/*FUNCTION Parameters::FindParam(double* pscalar, int enum_type){{{2*/
+int   Parameters::FindParam(double* pscalar, int enum_type){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if(param->EnumType()==enum_type){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pscalar);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+}
+/*}}}*/
+/*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{2*/
+int   Parameters::FindParam(int* pinteger,int enum_type){
+	
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if(param->EnumType()==enum_type){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pinteger);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+}
+/*}}}*/
+/*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{2*/
+int   Parameters::FindParam(char** pstring,int enum_type){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if(param->EnumType()==enum_type){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pstring);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+/*}}}*/
+/*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){{{2*/
+int   Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if(param->EnumType()==enum_type){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pstringarray,pM);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+/*}}}*/
+/*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM,int enum_type){{{2*/
+int   Parameters::FindParam(double** pdoublearray,int* pM, int enum_type){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if(param->EnumType()==enum_type){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pdoublearray,pM);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+/*}}}*/
+/*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){{{2*/
+int   Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if(param->EnumType()==enum_type){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pdoublearray,pM,pN);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+/*}}}*/
+/*FUNCTION Parameters::FindParam(Vec* pvec,int enum_type){{{2*/
+int   Parameters::FindParam(Vec* pvec,int enum_type){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if(param->EnumType()==enum_type){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pvec);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+/*}}}*/
+/*FUNCTION Parameters::FindParamMat* pmat,int enum_type){{{2*/
+int   Parameters::FindParam(Mat* pmat,int enum_type){
+	
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+	
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	int found=0;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if(param->EnumType()==enum_type){
+				/*Ok, this is the one! Recover the value of this parameter: */
+				param->GetParameterValue(pmat);
+				found=1;
+				break;
+			}
+		}
+	}
+	return found;
+
+}
+/*}}}*/
+/*FUNCTION Parameters::FindParamObject{{{2*/
+Object* Parameters::FindParamObject(int enum_type){
+
+	/*Go through a dataset, and find a Param* object 
+	 *which parameter name is "name" : */
+
+	vector<Object*>::iterator object;
+	Param* param=NULL;
+
+	for ( object=objects.begin() ; object < objects.end(); object++ ){
+
+		/*Find param type objects: */
+		if((*object)->Enum()==ParamEnum){
+
+			/*Ok, this object is a parameter, recover it and ask which name it has: */
+			param=(Param*)(*object);
+
+			if(param->EnumType()==enum_type){
+				/*Ok, this is the one! Return the object: */
+				return (*object);
+			}
+		}
+	}
+	return NULL;
+}
+/*}}}*/
+
+/*Object functions*/
+
+
+/*}}}*/
Index: /issm/trunk/src/c/DataSet/DataSet.h
===================================================================
--- /issm/trunk/src/c/DataSet/DataSet.h	(revision 3684)
+++ /issm/trunk/src/c/DataSet/DataSet.h	(revision 3685)
@@ -1,9 +1,5 @@
 /*
- * DataSet.h:
- * \brief Class that holds objects.
- * \file DataSet.h This prototype defines a DataSet, capable of holding any type of 
- * objects (using the abstract class Object). 
+ * DataSet.h: declaration of DataSet,Parameters and Inputs classes
  */
-
 
 #ifndef _DATASET_H_
@@ -11,9 +7,14 @@
 
 #include <vector>
+#include "../objects/Object.h"
 #include "../toolkits/toolkits.h"
-#include "../objects/Object.h"
+
+/*forward declarations */
+class Parameters;
+class DataSet;
 class Inputs;
-class Parameters;
 
+
+/********************************************************DATASET************************************************/
 class DataSet{
 	
@@ -102,3 +103,68 @@
 DataSet* DataSetDemarshallRaw(char** pmarshalled_dataset);
 
+
+
+/********************************************************INPUTS************************************************/
+class Input;
+class Node;
+#include "./DataSet.h"
+#include "../objects/objects.h"
+
+class Inputs: public DataSet{
+
+	public:
+
+		/*constructors, destructors: {{{1*/
+		Inputs();
+		Inputs(int enum_type);
+		~Inputs();
+		/*}}}*/
+		/*numerics: {{{1*/
+		int  AddInput(Input* in_input);
+		
+		void GetParameterValue(bool* pvalue,int enum_type);
+		void GetParameterValue(int* pvalue,int enum_type);
+		void GetParameterValue(double* pvalue,int enum_type);
+		void GetParameterValue(double* pvalue,Node* node,int enum_type);
+		void GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_coord,int enum_type);
+		void GetParameterValue(double* pvalue,double* gauss,int enum_type);
+		void GetParameterValue(double* pvalue,double* gauss,int enum_type,double defaultvalue);
+		
+		void GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type);
+		void GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues);
+	
+		void GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type);
+		void GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum);
+		void GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int yenum);
+		/*}}}*/
+
+};
+
+
+/********************************************************PARAMETERS************************************************/
+
+class Parameters: public DataSet{
+
+	public:
+
+		/*constructors, destructors: {{{1*/
+		Parameters();
+		Parameters(int enum_type);
+		~Parameters();
+		/*}}}*/
+		/*numerics: {{{1*/
+		int   FindParam(double* pscalar, int enum_type);
+		int   FindParam(int* pinteger,int enum_type);
+		int   FindParam(char** pstring,int enum_type);
+		int   FindParam(char*** pstringarray,int* pM,int enum_type);
+		int   FindParam(double** pdoublearray,int* pM,int enum_type);
+		int   FindParam(double** pdoublearray,int* pM,int* pN,int enum_type);
+		int   FindParam(Vec* pvec,int enum_type);
+		int   FindParam(Mat* pmat,int enum_type);
+		Object* FindParamObject(int enum_type);
+		/*}}}*/
+
+};
+
+
 #endif
Index: sm/trunk/src/c/DataSet/Inputs.cpp
===================================================================
--- /issm/trunk/src/c/DataSet/Inputs.cpp	(revision 3684)
+++ 	(revision )
@@ -1,371 +1,0 @@
-/*!\file Inputs.c
- * \brief: implementation of the Inputs object
- */
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-
-#include <vector>
-#include <functional>
-#include <algorithm>
-#include <iostream>
-
-#include "./DataSet.h"
-#include "./Inputs.h"
-
-#include "../shared/shared.h"
-#include "../include/macros.h"
-#include "../EnumDefinitions/EnumDefinitions.h"
-
-using namespace std;
-
-
-/*Object constructors and destructor*/
-/*FUNCTION Inputs::Inputs(){{{1*/
-Inputs::Inputs(){
-	return;
-}
-/*}}}*/
-/*FUNCTION Inputs::Inputs(int in_enum){{{1*/
-Inputs::Inputs(int in_enum): DataSet(in_enum) {
-	//do nothing;
-	return;
-}
-/*}}}*/
-/*FUNCTION Inputs::~Inputs(){{{1*/
-Inputs::~Inputs(){
-	return;
-}
-/*}}}*/
-
-/*Object management*/
-/*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type){{{1*/
-void Inputs::GetParameterValue(double* pvalue,double* gauss, int enum_type){
-
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	/*Go through inputs and check whether any input with the same name is already in: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-		if (input->EnumType()==enum_type)break;
-	}
-
-	if (!input){
-		/*we could not find an input with the correct enum type. No defaults values were provided, 
-		 * error out: */
-		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
-	}
-
-	/*Ok, we have an input if we made it here, request the input to return the values: */
-	input->GetParameterValue(pvalue,gauss);
-
-}
-/*}}}*/
-/*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type,double defaultvalue){{{1*/
-void Inputs::GetParameterValue(double* pvalue,double* gauss, int enum_type,double defaultvalue){
-
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	/*Go through inputs and check whether any input with the same name is already in: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-		if (input->EnumType()==enum_type)break;
-	}
-
-	if (!input){
-		/*we could not find an input with the correct enum type. Return the default value: */
-		*pvalue=defaultvalue;
-	}
-	else{
-		input->GetParameterValue(pvalue,gauss);
-	}
-}
-/*}}}*/
-/*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type){{{1*/
-void Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type){
-
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	/*Go through inputs and check whether any input with the same name is already in: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-		if (input->EnumType()==enum_type)break;
-	}
-
-	if (!input){
-		/*we could not find an input with the correct enum type. No defaults values were provided, 
-		 * error out: */
-		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
-	}
-
-	/*Ok, we have an input if we made it here, request the input to return the values: */
-	input->GetParameterValues(values,gauss_pointers,numgauss);
-
-}
-/*}}}*/
-/*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node, int enum_type){{{1*/
-void Inputs::GetParameterValue(double* pvalue,Node* node,int enum_type){
-
-	/*given a node, instead of a gauss point, we want to recover a value: probably in an element!: */
-
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	/*Go through inputs and check whether any input with the same name is already in: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-		if (input->EnumType()==enum_type)break;
-	}
-
-	if (!input){
-		/*we could not find an input with the correct enum type. No defaults values were provided, 
-		 * error out: */
-		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
-	}
-
-	/*Ok, we have an input if we made it here, request the input to return the values: */
-	input->GetParameterValue(pvalue,node);
-}
-/*}}}*/
-/*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node1, Node* node2,int enum_type){{{1*/
-void Inputs::GetParameterValue(double* pvalue,Node* node1, Node* node2,double gauss_coord,int enum_type){
-
-	/*given a node, instead of a gauss point, we want to recover a value: probably in an element!: */
-
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	/*Go through inputs and check whether any input with the same name is already in: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-		if (input->EnumType()==enum_type)break;
-	}
-
-	if (!input){
-		/*we could not find an input with the correct enum type. No defaults values were provided, 
-		 * error out: */
-		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
-	}
-
-	/*Ok, we have an input if we made it here, request the input to return the values: */
-	input->GetParameterValue(pvalue,node1,node2,gauss_coord);
-}
-/*}}}*/
-/*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){{{1*/
-void Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){
-
-	int i;
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	/*Go through inputs and check whether any input with the same name is already in: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-		if (input->EnumType()==enum_type)break;
-	}
-
-	if (!input){
-		/*we could not find an input with the correct enum type. Return the default values: */
-		for(i=0;i<numgauss;i++)values[i]=defaultvalues[i];
-	}
-	else{
-		input->GetParameterValues(values,gauss_pointers,numgauss);
-	}
-
-}
-/*}}}*/
-/*FUNCTION Inputs::GetParameterValue(bool* pvalue,int enum-type){{{1*/
-void Inputs::GetParameterValue(bool* pvalue,int enum_type){
-
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	/*Go through inputs and check whether any input with the same name is already in: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-		if (input->EnumType()==enum_type)break;
-	}
-
-	if (!input){
-		/*we could not find an input with the correct enum type. No defaults values were provided, 
-		 * error out: */
-		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
-	}
-
-	/*Ok, we have an input if we made it here, request the input to return the value: */
-	input->GetParameterValue(pvalue);
-
-}
-/*}}}*/
-/*FUNCTION Inputs::GetParameterValue(int* pvalue,int enum-type){{{1*/
-void Inputs::GetParameterValue(int* pvalue,int enum_type){
-
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	/*Go through inputs and check whether any input with the same name is already in: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-		if (input->EnumType()==enum_type)break;
-	}
-
-	if (!input){
-		/*we could not find an input with the correct enum type. No defaults values were provided, 
-		 * error out: */
-		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
-	}
-
-	/*Ok, we have an input if we made it here, request the input to return the value: */
-	input->GetParameterValue(pvalue);
-
-}
-/*}}}*/
-/*FUNCTION Inputs::GetParameterValue(double* pvalue,int enum-type){{{1*/
-void Inputs::GetParameterValue(double* pvalue,int enum_type){
-
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	/*Go through inputs and check whether any input with the same name is already in: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-		if (input->EnumType()==enum_type)break;
-	}
-
-	if (!input){
-		/*we could not find an input with the correct enum type. No defaults values were provided, 
-		 * error out: */
-		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
-	}
-
-	/*Ok, we have an input if we made it here, request the input to return the value: */
-	input->GetParameterValue(pvalue);
-
-}
-/*}}}*/
-/*FUNCTION Inputs::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type){{{1*/
-void Inputs::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type){
-
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	/*Go through inputs and check whether any input with the same name is already in: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-		if (input->EnumType()==enum_type)break;
-	}
-
-	if (!input){
-		/*we could not find an input with the correct enum type. No defaults values were provided, 
-		 * error out: */
-		ISSMERROR("%s%i"," could not find input with enum type ",enum_type);
-	}
-
-	/*Ok, we have an input if we made it here, request the input to return the value: */
-	input->GetParameterDerivativeValue(derivativevalues,xyz_list,gauss);
-}
-/*}}}*/
-/*FUNCTION Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum){{{1*/
-void Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum){
-
-	vector<Object*>::iterator object;
-	Input* xinput=NULL;
-	Input* yinput=NULL;
-
-	/*Go through inputs and find data for xenum: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-		xinput=(Input*)(*object); 
-		if (xinput->EnumType()==xenum)break;
-	}
-	/*Go through inputs and find data for yenum: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-		yinput=(Input*)(*object); 
-		if (yinput->EnumType()==yenum)break;
-	}
-
-	if (!xinput | !yinput){
-		/*we could not find one input with the correct enum type. No defaults values were provided, 
-		 * error out: */
-		ISSMERROR("%s%i%s%i\n"," could not find input with enum type ",xenum," or enum type ",yenum);
-	}
-
-	/*Ok, we have the inputs, call bilinear operator: */
-	xinput->GetStrainRate(epsilon,yinput,xyz_list,gauss);
-
-}
-/*}}}*/
-/*FUNCTION Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){{{1*/
-void Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){
-
-	vector<Object*>::iterator object;
-	Input* xinput=NULL;
-	Input* yinput=NULL;
-	Input* zinput=NULL;
-
-	/*Go through inputs and find data for xenum: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-		xinput=(Input*)(*object); 
-		if (xinput->EnumType()==xenum)break;
-	}
-	/*Go through inputs and find data for yenum: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-		yinput=(Input*)(*object); 
-		if (yinput->EnumType()==yenum)break;
-	}
-	/*Go through inputs and find data for zenum: */
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-		zinput=(Input*)(*object); 
-		if (zinput->EnumType()==zenum)break;
-	}
-
-	if (!xinput | !yinput | !zinput){
-		/*we could not find one input with the correct enum type. No defaults values were provided, 
-		 * error out: */
-		ISSMERROR("%s%i%s%i%s%i\n"," could not find input with enum type ",xenum," or enum type ",yenum, " or enum type ",zenum);
-	}
-
-	/*Ok, we have the inputs, call bilinear operator: */
-	xinput->GetStrainRateStokes(epsilon,yinput,zinput,xyz_list,gauss);
-
-}
-/*}}}*/
-/*FUNCTION Inputs::AddInput{{{1*/
-int  Inputs::AddInput(Input* in_input){
-
-	/*First, go through dataset of inputs and check whether any input 
-	 * with the same name is already in. If so, erase the corresponding 
-	 * object before adding this new one: */
-	vector<Object*>::iterator object;
-	Input* input=NULL;
-
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		input=(Input*)(*object); 
-
-		if (input->EnumType()==in_input->EnumType()){
-			this->DeleteObject(input);
-			break;
-		}
-	}
-	this->AddObject(in_input);
-}
-/*}}}*/
-
-/*Object functions*/
Index: sm/trunk/src/c/DataSet/Inputs.h
===================================================================
--- /issm/trunk/src/c/DataSet/Inputs.h	(revision 3684)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*! \file Inputs.h 
- *  \brief: header file for inputs object
- */
-
-#ifndef _INPUTS_H_
-#define _INPUTS_H_
-
-#include "./DataSet.h"
-class Input;
-#include "../objects/Input.h"
-#include "../objects/Node.h"
-
-class Inputs: public DataSet{
-
-	public:
-
-		/*constructors, destructors: {{{1*/
-		Inputs();
-		Inputs(int enum_type);
-		~Inputs();
-		/*}}}*/
-		/*numerics: {{{1*/
-		int  AddInput(Input* in_input);
-		
-		void GetParameterValue(bool* pvalue,int enum_type);
-		void GetParameterValue(int* pvalue,int enum_type);
-		void GetParameterValue(double* pvalue,int enum_type);
-		void GetParameterValue(double* pvalue,Node* node,int enum_type);
-		void GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_coord,int enum_type);
-		void GetParameterValue(double* pvalue,double* gauss,int enum_type);
-		void GetParameterValue(double* pvalue,double* gauss,int enum_type,double defaultvalue);
-		
-		void GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type);
-		void GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues);
-	
-		void GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type);
-		void GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum);
-		void GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int yenum);
-		/*}}}*/
-
-};
-#endif  /* _INPUTS_H */
Index: sm/trunk/src/c/DataSet/Parameters.cpp
===================================================================
--- /issm/trunk/src/c/DataSet/Parameters.cpp	(revision 3684)
+++ 	(revision )
@@ -1,319 +1,0 @@
-/*!\file Parameters.c
- * \brief: implementation of the Parameters object
- */
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include <vector>
-#include <functional>
-#include <algorithm>
-#include <iostream>
-
-#include "./DataSet.h"
-#include "./Parameters.h"
-
-#include "../shared/shared.h"
-#include "../include/macros.h"
-#include "../EnumDefinitions/EnumDefinitions.h"
-
-using namespace std;
-
-
-/*Object constructors and destructor*/
-/*FUNCTION Parameters::Parameters(){{{1*/
-Parameters::Parameters(){
-	return;
-}
-/*}}}*/
-/*FUNCTION Parameters::Parameters(int in_enum){{{1*/
-Parameters::Parameters(int in_enum): DataSet(in_enum){
-	//do nothing;
-	return;
-}
-/*}}}*/
-/*FUNCTION Parameters::~Parameters(){{{1*/
-Parameters::~Parameters(){
-	return;
-}
-/*}}}*/
-
-/*Object management*/
-/*FUNCTION Parameters::FindParam(double* pscalar, int enum_type){{{1*/
-int   Parameters::FindParam(double* pscalar, int enum_type){
-	
-	/*Go through a dataset, and find a Param* object 
-	 *which parameter name is "name" : */
-	
-	vector<Object*>::iterator object;
-	Param* param=NULL;
-
-	int found=0;
-
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		/*Find param type objects: */
-		if((*object)->Enum()==ParamEnum){
-
-			/*Ok, this object is a parameter, recover it and ask which name it has: */
-			param=(Param*)(*object);
-
-			if(param->EnumType()==enum_type){
-				/*Ok, this is the one! Recover the value of this parameter: */
-				param->GetParameterValue(pscalar);
-				found=1;
-				break;
-			}
-		}
-	}
-	return found;
-}
-/*}}}*/
-/*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{1*/
-int   Parameters::FindParam(int* pinteger,int enum_type){
-	
-	
-	/*Go through a dataset, and find a Param* object 
-	 *which parameter name is "name" : */
-	
-	vector<Object*>::iterator object;
-	Param* param=NULL;
-
-	int found=0;
-
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		/*Find param type objects: */
-		if((*object)->Enum()==ParamEnum){
-
-			/*Ok, this object is a parameter, recover it and ask which name it has: */
-			param=(Param*)(*object);
-
-			if(param->EnumType()==enum_type){
-				/*Ok, this is the one! Recover the value of this parameter: */
-				param->GetParameterValue(pinteger);
-				found=1;
-				break;
-			}
-		}
-	}
-	return found;
-}
-/*}}}*/
-/*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{1*/
-int   Parameters::FindParam(char** pstring,int enum_type){
-	
-	/*Go through a dataset, and find a Param* object 
-	 *which parameter name is "name" : */
-	
-	vector<Object*>::iterator object;
-	Param* param=NULL;
-
-	int found=0;
-
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		/*Find param type objects: */
-		if((*object)->Enum()==ParamEnum){
-
-			/*Ok, this object is a parameter, recover it and ask which name it has: */
-			param=(Param*)(*object);
-
-			if(param->EnumType()==enum_type){
-				/*Ok, this is the one! Recover the value of this parameter: */
-				param->GetParameterValue(pstring);
-				found=1;
-				break;
-			}
-		}
-	}
-	return found;
-
-}
-/*}}}*/
-/*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){{{1*/
-int   Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){
-	
-	/*Go through a dataset, and find a Param* object 
-	 *which parameter name is "name" : */
-	
-	vector<Object*>::iterator object;
-	Param* param=NULL;
-
-	int found=0;
-
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		/*Find param type objects: */
-		if((*object)->Enum()==ParamEnum){
-
-			/*Ok, this object is a parameter, recover it and ask which name it has: */
-			param=(Param*)(*object);
-
-			if(param->EnumType()==enum_type){
-				/*Ok, this is the one! Recover the value of this parameter: */
-				param->GetParameterValue(pstringarray,pM);
-				found=1;
-				break;
-			}
-		}
-	}
-	return found;
-
-}
-/*}}}*/
-/*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM,int enum_type){{{1*/
-int   Parameters::FindParam(double** pdoublearray,int* pM, int enum_type){
-	
-	/*Go through a dataset, and find a Param* object 
-	 *which parameter name is "name" : */
-	
-	vector<Object*>::iterator object;
-	Param* param=NULL;
-
-	int found=0;
-
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		/*Find param type objects: */
-		if((*object)->Enum()==ParamEnum){
-
-			/*Ok, this object is a parameter, recover it and ask which name it has: */
-			param=(Param*)(*object);
-
-			if(param->EnumType()==enum_type){
-				/*Ok, this is the one! Recover the value of this parameter: */
-				param->GetParameterValue(pdoublearray,pM)
-				found=1;
-				break;
-			}
-		}
-	}
-	return found;
-
-}
-/*}}}*/
-/*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){{{1*/
-int   Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){
-	
-	/*Go through a dataset, and find a Param* object 
-	 *which parameter name is "name" : */
-	
-	vector<Object*>::iterator object;
-	Param* param=NULL;
-
-	int found=0;
-
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		/*Find param type objects: */
-		if((*object)->Enum()==ParamEnum){
-
-			/*Ok, this object is a parameter, recover it and ask which name it has: */
-			param=(Param*)(*object);
-
-			if(param->EnumType()==enum_type){
-				/*Ok, this is the one! Recover the value of this parameter: */
-				param->GetParameterValue(pdoublearray,pM,pN);
-				found=1;
-				break;
-			}
-		}
-	}
-	return found;
-
-}
-/*}}}*/
-/*FUNCTION Parameters::FindParam(Vec* pvec,int enum_type){{{1*/
-int   Parameters::FindParam(Vec* pvec,int enum_type){
-	
-	/*Go through a dataset, and find a Param* object 
-	 *which parameter name is "name" : */
-	
-	vector<Object*>::iterator object;
-	Param* param=NULL;
-
-	int found=0;
-
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		/*Find param type objects: */
-		if((*object)->Enum()==ParamEnum){
-
-			/*Ok, this object is a parameter, recover it and ask which name it has: */
-			param=(Param*)(*object);
-
-			if(param->EnumType()==enum_type){
-				/*Ok, this is the one! Recover the value of this parameter: */
-				param->GetParameterValue(pvec);
-				found=1;
-				break;
-			}
-		}
-	}
-	return found;
-
-}
-/*}}}*/
-/*FUNCTION Parameters::FindParamMat* pmat,int enum_type){{{1*/
-int   Parameters::FindParam(Mat* pmat,int enum_type){
-	
-	/*Go through a dataset, and find a Param* object 
-	 *which parameter name is "name" : */
-	
-	vector<Object*>::iterator object;
-	Param* param=NULL;
-
-	int found=0;
-
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		/*Find param type objects: */
-		if((*object)->Enum()==ParamEnum){
-
-			/*Ok, this object is a parameter, recover it and ask which name it has: */
-			param=(Param*)(*object);
-
-			if(param->EnumType()==enum_type){
-				/*Ok, this is the one! Recover the value of this parameter: */
-				param->GetParameterValue(pmat);
-				found=1;
-				break;
-			}
-		}
-	}
-	return found;
-
-}
-/*}}}*/
-/*FUNCTION Parameters::FindParamObject{{{1*/
-Object* Parameters::FindParamObject(int enum_type){
-
-	/*Go through a dataset, and find a Param* object 
-	 *which parameter name is "name" : */
-
-	vector<Object*>::iterator object;
-	Param* param=NULL;
-
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
-		/*Find param type objects: */
-		if((*object)->Enum()==ParamEnum){
-
-			/*Ok, this object is a parameter, recover it and ask which name it has: */
-			param=(Param*)(*object);
-
-			if(param->EnumType()==enum_type){
-				/*Ok, this is the one! Return the object: */
-				return (*object);
-			}
-		}
-	}
-	return NULL;
-}
-/*}}}*/
-
-/*Object functions*/
Index: sm/trunk/src/c/DataSet/Parameters.h
===================================================================
--- /issm/trunk/src/c/DataSet/Parameters.h	(revision 3684)
+++ 	(revision )
@@ -1,32 +1,0 @@
-/*! \file Parameters.h 
- *  \brief: header file for inputs object
- */
-
-#ifndef _PARAMETERS_H_
-#define _PARAMETERS_H_
-
-#include "./DataSet.h"
-
-class Parameters: public DataSet{
-
-	public:
-
-		/*constructors, destructors: {{{1*/
-		Parameters();
-		Parameters(int enum_type);
-		~Parameters();
-		/*}}}*/
-		/*numerics: {{{1*/
-		int   FindParam(double* pscalar, int enum_type);
-		int   FindParam(int* pinteger,int enum_type);
-		int   FindParam(char** pstring,int enum_type);
-		int   FindParam(char*** pstringarray,int* pM,int enum_type);
-		int   FindParam(double** pdoublearray,int* pM,int enum_type);
-		int   FindParam(double** pdoublearray,int* pM,int* pN,int enum_type);
-		int   FindParam(Vec* pvec,int enum_type);
-		int   FindParam(Mat* pmat,int enum_type);
-		Object* FindParamObject(int enum_type);
-		/*}}}*/
-
-};
-#endif  /* _PARAMETERS_H */
Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 3684)
+++ /issm/trunk/src/c/Makefile.am	(revision 3685)
@@ -23,10 +23,10 @@
 libISSM_a_SOURCES = ./objects/objects.h\
 					./objects/Object.h\
-					./objects/BamgGeom.h\
-					./objects/BamgGeom.cpp\
-					./objects/BamgMesh.h\
-					./objects/BamgMesh.cpp\
-					./objects/BamgOpts.h\
-					./objects/BamgOpts.cpp\
+					./objects/Bamg/BamgGeom.h\
+					./objects/Bamg/BamgGeom.cpp\
+					./objects/Bamg/BamgMesh.h\
+					./objects/Bamg/BamgMesh.cpp\
+					./objects/Bamg/BamgOpts.h\
+					./objects/Bamg/BamgOpts.cpp\
 					./objects/Element.h\
 					./objects/Model.h\
@@ -35,9 +35,7 @@
 					./objects/FemModel.cpp\
 					./objects/Material.h\
-					./objects/Material.cpp\
 					./objects/DofVec.h\
 					./objects/DofVec.cpp\
 					./objects/Load.h\
-					./objects/Load.cpp\
 					./objects/OptArgs.h\
 					./objects/OptPars.h\
@@ -45,6 +43,6 @@
 					./objects/Contour.h\
 					./objects/Contour.cpp\
-					./objects/Friction.h\
-					./objects/Friction.cpp\
+					./objects/Loads/Friction.h\
+					./objects/Loads/Friction.cpp\
 					./objects/DakotaPlugin.h\
 					./objects/DakotaPlugin.cpp\
@@ -55,76 +53,74 @@
 					./objects/DofIndexing.h\
 					./objects/DofIndexing.cpp\
+					./objects/IoModel.h\
+					./objects/IoModel.cpp\
 					./objects/Node.h\
 					./objects/Node.cpp\
 					./objects/Result.h\
 					./objects/Result.cpp\
-					./objects/Tria.h\
-					./objects/Tria.cpp\
-					./objects/InputObjects/Input.h\
-					./objects/InputObjects/TriaVertexInput.h\
-					./objects/InputObjects/TriaVertexInput.cpp\
-					./objects/InputObjects/SingVertexInput.h\
-					./objects/InputObjects/SingVertexInput.cpp\
-					./objects/InputObjects/BeamVertexInput.h\
-					./objects/InputObjects/BeamVertexInput.cpp\
-					./objects/InputObjects/PentaVertexInput.h\
-					./objects/InputObjects/PentaVertexInput.cpp\
-					./objects/InputObjects/BoolInput.h\
-					./objects/InputObjects/BoolInput.cpp\
-					./objects/InputObjects/IntInput.h\
-					./objects/InputObjects/IntInput.cpp\
-					./objects/InputObjects/DoubleInput.h\
-					./objects/InputObjects/DoubleInput.cpp\
-					./objects/Sing.h\
-					./objects/Sing.cpp\
-					./objects/Beam.h\
-					./objects/Beam.cpp\
-					./objects/Penta.h\
-					./objects/Penta.cpp\
-					./objects/Matice.h\
-					./objects/Matice.cpp\
-					./objects/Matpar.h\
-					./objects/Matpar.cpp\
-					./objects/Spc.cpp\
-					./objects/Spc.h\
-					./objects/Rgb.cpp\
-					./objects/Rgb.h\
-					./objects/Penpair.cpp\
-					./objects/Penpair.h\
-					./objects/Pengrid.cpp\
-					./objects/Pengrid.h\
-					./objects/Icefront.cpp\
-					./objects/Icefront.h\
-					./objects/Riftfront.cpp\
-					./objects/Riftfront.h\
-					./objects/Numericalflux.cpp\
-					./objects/Numericalflux.h\
-					./objects/ParamObjects/Param.h\
-					./objects/ParamObjects/BoolParam.cpp\
-					./objects/ParamObjects/BoolParam.h\
-					./objects/ParamObjects/IntParam.cpp\
-					./objects/ParamObjects/IntParam.h\
-					./objects/ParamObjects/DoubleParam.cpp\
-					./objects/ParamObjects/DoubleParam.h\
-					./objects/ParamObjects/PetscMatParam.cpp\
-					./objects/ParamObjects/PetscMatParam.h\
-					./objects/ParamObjects/StringArrayParam.cpp\
-					./objects/ParamObjects/StringArrayParam.h\
-					./objects/ParamObjects/DoubleMatParam.cpp\
-					./objects/ParamObjects/DoubleMatParam.h\
-					./objects/ParamObjects/DoubleVecParam.cpp\
-					./objects/ParamObjects/DoubleVecParam.h\
-					./objects/ParamObjects/PetscVecParam.cpp\
-					./objects/ParamObjects/PetscVecParam.h\
-					./objects/ParamObjects/StringParam.cpp\
-					./objects/ParamObjects/StringParam.h\
+					./objects/Elements/Tria.h\
+					./objects/Elements/Tria.cpp\
+					./objects/Inputs/Input.h\
+					./objects/Inputs/TriaVertexInput.h\
+					./objects/Inputs/TriaVertexInput.cpp\
+					./objects/Inputs/SingVertexInput.h\
+					./objects/Inputs/SingVertexInput.cpp\
+					./objects/Inputs/BeamVertexInput.h\
+					./objects/Inputs/BeamVertexInput.cpp\
+					./objects/Inputs/PentaVertexInput.h\
+					./objects/Inputs/PentaVertexInput.cpp\
+					./objects/Inputs/BoolInput.h\
+					./objects/Inputs/BoolInput.cpp\
+					./objects/Inputs/IntInput.h\
+					./objects/Inputs/IntInput.cpp\
+					./objects/Inputs/DoubleInput.h\
+					./objects/Inputs/DoubleInput.cpp\
+					./objects/Elements/Sing.h\
+					./objects/Elements/Sing.cpp\
+					./objects/Elements/Beam.h\
+					./objects/Elements/Beam.cpp\
+					./objects/Elements/Penta.h\
+					./objects/Elements/Penta.cpp\
+					./objects/Materials/Matice.h\
+					./objects/Materials/Matice.cpp\
+					./objects/Materials/Matpar.h\
+					./objects/Materials/Matpar.cpp\
+					./objects/Constraints/Spc.cpp\
+					./objects/Constraints/Spc.h\
+					./objects/Constraints/Rgb.cpp\
+					./objects/Constraints/Rgb.h\
+					./objects/Loads/Penpair.cpp\
+					./objects/Loads/Penpair.h\
+					./objects/Loads/Pengrid.cpp\
+					./objects/Loads/Pengrid.h\
+					./objects/Loads/Icefront.cpp\
+					./objects/Loads/Icefront.h\
+					./objects/Loads/Riftfront.cpp\
+					./objects/Loads/Riftfront.h\
+					./objects/Loads/Numericalflux.cpp\
+					./objects/Loads/Numericalflux.h\
+					./objects/Params/Param.h\
+					./objects/Params/BoolParam.cpp\
+					./objects/Params/BoolParam.h\
+					./objects/Params/IntParam.cpp\
+					./objects/Params/IntParam.h\
+					./objects/Params/DoubleParam.cpp\
+					./objects/Params/DoubleParam.h\
+					./objects/Params/PetscMatParam.cpp\
+					./objects/Params/PetscMatParam.h\
+					./objects/Params/StringArrayParam.cpp\
+					./objects/Params/StringArrayParam.h\
+					./objects/Params/DoubleMatParam.cpp\
+					./objects/Params/DoubleMatParam.h\
+					./objects/Params/DoubleVecParam.cpp\
+					./objects/Params/DoubleVecParam.h\
+					./objects/Params/PetscVecParam.cpp\
+					./objects/Params/PetscVecParam.h\
+					./objects/Params/StringParam.cpp\
+					./objects/Params/StringParam.h\
 					./objects/NodeSets.cpp\
 					./objects/NodeSets.h\
 					./DataSet/DataSet.cpp\
 					./DataSet/DataSet.h\
-					./DataSet/Inputs.cpp\
-					./DataSet/Inputs.h\
-					./DataSet/Parameters.cpp\
-					./DataSet/Parameters.h\
 					./shared/shared.h\
 					./shared/Alloc/alloc.h\
@@ -228,6 +224,4 @@
 					./EnumDefinitions/EnumDefinitions.cpp\
 					./ModelProcessorx/ModelProcessorx.h\
-					./ModelProcessorx/IoModel.h\
-					./ModelProcessorx/IoModel.cpp\
 					./ModelProcessorx/Partitioning.cpp\
 					./ModelProcessorx/CreateDataSets.cpp\
@@ -456,9 +450,9 @@
 					./objects/Object.h\
 					./objects/BamgGeom.h\
-					./objects/BamgGeom.cpp\
-					./objects/BamgMesh.h\
-					./objects/BamgMesh.cpp\
-					./objects/BamgOpts.h\
-					./objects/BamgOpts.cpp\
+					./objects/Bamg/BamgGeom.cpp\
+					./objects/Bamg/BamgMesh.h\
+					./objects/Bamg/BamgMesh.cpp\
+					./objects/Bamg/BamgOpts.h\
+					./objects/Bamg/BamgOpts.cpp\
 					./objects/Element.h\
 					./objects/Model.h\
@@ -467,9 +461,7 @@
 					./objects/FemModel.cpp\
 					./objects/Material.h\
-					./objects/Material.cpp\
 					./objects/DofVec.h\
 					./objects/DofVec.cpp\
 					./objects/Load.h\
-					./objects/Load.cpp\
 					./objects/SolverEnum.h\
 					./objects/Contour.h\
@@ -477,10 +469,12 @@
 					./objects/OptArgs.h\
 					./objects/OptPars.h\
-					./objects/Friction.h\
-					./objects/Friction.cpp\
+					./objects/Loads/Friction.h\
+					./objects/Loads/Friction.cpp\
 					./objects/DakotaPlugin.h\
 					./objects/DakotaPlugin.cpp\
 					./objects/DofIndexing.h\
 					./objects/DofIndexing.cpp\
+					./objects/IoModel.h\
+					./objects/IoModel.cpp\
 					./objects/Node.h\
 					./objects/Node.cpp\
@@ -491,72 +485,68 @@
 					./objects/Result.h\
 					./objects/Result.cpp\
-					./objects/Tria.h\
-					./objects/Tria.cpp\
-					./objects/InputObjects/Input.h\
-					./objects/InputObjects/TriaVertexInput.h\
-					./objects/InputObjects/TriaVertexInput.cpp\
-					./objects/InputObjects/SingVertexInput.h\
-					./objects/InputObjects/SingVertexInput.cpp\
-					./objects/InputObjects/BeamVertexInput.h\
-					./objects/InputObjects/BeamVertexInput.cpp\
-					./objects/InputObjects/PentaVertexInput.h\
-					./objects/InputObjects/PentaVertexInput.cpp\
-					./objects/InputObjects/BoolInput.h\
-					./objects/InputObjects/BoolInput.cpp\
-					./objects/InputObjects/IntInput.h\
-					./objects/InputObjects/IntInput.cpp\
-					./objects/InputObjects/DoubleInput.h\
-					./objects/InputObjects/DoubleInput.cpp\
-					./objects/Sing.h\
-					./objects/Sing.cpp\
-					./objects/Beam.h\
-					./objects/Beam.cpp\
-					./objects/Penta.h\
-					./objects/Penta.cpp\
-					./objects/Matice.h\
-					./objects/Matice.cpp\
-					./objects/Matpar.h\
-					./objects/Matpar.cpp\
-					./objects/Spc.cpp\
-					./objects/Spc.h\
-					./objects/Rgb.cpp\
-					./objects/Rgb.h\
-					./objects/Penpair.cpp\
-					./objects/Penpair.h\
-					./objects/Pengrid.cpp\
-					./objects/Pengrid.h\
-					./objects/Icefront.cpp\
-					./objects/Icefront.h\
-					./objects/Riftfront.cpp\
-					./objects/Riftfront.h\
-					./objects/Numericalflux.cpp\
-					./objects/Numericalflux.h\
-					./objects/ParamObjects/Param.h\
-					./objects/ParamObjects/BoolParam.cpp\
-					./objects/ParamObjects/BoolParam.h\
-					./objects/ParamObjects/IntParam.cpp\
-					./objects/ParamObjects/IntParam.h\
-					./objects/ParamObjects/DoubleParam.cpp\
-					./objects/ParamObjects/DoubleParam.h\
-					./objects/ParamObjects/PetscMatParam.cpp\
-					./objects/ParamObjects/PetscMatParam.h\
-					./objects/ParamObjects/StringArrayParam.cpp\
-					./objects/ParamObjects/StringArrayParam.h\
-					./objects/ParamObjects/DoubleMatParam.cpp\
-					./objects/ParamObjects/DoubleMatParam.h\
-					./objects/ParamObjects/DoubleVecParam.cpp\
-					./objects/ParamObjects/DoubleVecParam.h\
-					./objects/ParamObjects/PetscVecParam.cpp\
-					./objects/ParamObjects/PetscVecParam.h\
-					./objects/ParamObjects/StringParam.cpp\
-					./objects/ParamObjects/StringParam.h\
+					./objects/Elements/Tria.h\
+					./objects/Elements/Tria.cpp\
+					./objects/Inputs/Input.h\
+					./objects/Inputs/TriaVertexInput.h\
+					./objects/Inputs/TriaVertexInput.cpp\
+					./objects/Inputs/SingVertexInput.h\
+					./objects/Inputs/SingVertexInput.cpp\
+					./objects/Inputs/BeamVertexInput.h\
+					./objects/Inputs/BeamVertexInput.cpp\
+					./objects/Inputs/PentaVertexInput.h\
+					./objects/Inputs/PentaVertexInput.cpp\
+					./objects/Inputs/BoolInput.h\
+					./objects/Inputs/BoolInput.cpp\
+					./objects/Inputs/IntInput.h\
+					./objects/Inputs/IntInput.cpp\
+					./objects/Inputs/DoubleInput.h\
+					./objects/Inputs/DoubleInput.cpp\
+					./objects/Elements/Sing.h\
+					./objects/Elements/Sing.cpp\
+					./objects/Elements/Beam.h\
+					./objects/Elements/Beam.cpp\
+					./objects/Elements/Penta.h\
+					./objects/Elements/Penta.cpp\
+					./objects/Materials/Matice.h\
+					./objects/Materials/Matice.cpp\
+					./objects/Materials/Matpar.h\
+					./objects/Materials/Matpar.cpp\
+					./objects/Constraints/Spc.cpp\
+					./objects/Constraints/Spc.h\
+					./objects/Constraints/Rgb.cpp\
+					./objects/Constraints/Rgb.h\
+					./objects/Loads/Penpair.cpp\
+					./objects/Loads/Penpair.h\
+					./objects/Loads/Pengrid.cpp\
+					./objects/Loads/Pengrid.h\
+					./objects/Loads/Icefront.cpp\
+					./objects/Loads/Icefront.h\
+					./objects/Loads/Riftfront.cpp\
+					./objects/Loads/Riftfront.h\
+					./objects/Loads/Numericalflux.cpp\
+					./objects/Loads/Numericalflux.h\
+					./objects/Params/Param.h\
+					./objects/Params/BoolParam.cpp\
+					./objects/Params/BoolParam.h\
+					./objects/Params/IntParam.cpp\
+					./objects/Params/IntParam.h\
+					./objects/Params/DoubleParam.cpp\
+					./objects/Params/DoubleParam.h\
+					./objects/Params/PetscMatParam.cpp\
+					./objects/Params/PetscMatParam.h\
+					./objects/Params/StringArrayParam.cpp\
+					./objects/Params/StringArrayParam.h\
+					./objects/Params/DoubleMatParam.cpp\
+					./objects/Params/DoubleMatParam.h\
+					./objects/Params/DoubleVecParam.cpp\
+					./objects/Params/DoubleVecParam.h\
+					./objects/Params/PetscVecParam.cpp\
+					./objects/Params/PetscVecParam.h\
+					./objects/Params/StringParam.cpp\
+					./objects/Params/StringParam.h\
 					./objects/NodeSets.cpp\
 					./objects/NodeSets.h\
 					./DataSet/DataSet.cpp\
 					./DataSet/DataSet.h\
-					./DataSet/Inputs.cpp\
-					./DataSet/Inputs.h\
-					./DataSet/Parameters.cpp\
-					./DataSet/Parameters.h\
 					./shared/shared.h\
 					./shared/Threads/issm_threads.h\
@@ -657,6 +647,4 @@
 					./EnumDefinitions/EnumDefinitions.cpp\
 					./ModelProcessorx/ModelProcessorx.h\
-					./ModelProcessorx/IoModel.h\
-					./ModelProcessorx/IoModel.cpp\
 					./ModelProcessorx/Partitioning.cpp\
 					./ModelProcessorx/CreateDataSets.cpp\
Index: /issm/trunk/src/c/ModelProcessorx/CreateDataSets.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/CreateDataSets.cpp	(revision 3684)
+++ /issm/trunk/src/c/ModelProcessorx/CreateDataSets.cpp	(revision 3685)
@@ -9,5 +9,5 @@
 #endif
 
-#include "./IoModel.h"
+#include "../objects/objects.h"
 #include "../shared/shared.h"
 #include "../include/macros.h"
Index: /issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp	(revision 3684)
+++ /issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp	(revision 3685)
@@ -9,5 +9,4 @@
 #include "../shared/shared.h"
 #include "../MeshPartitionx/MeshPartitionx.h"
-#include "./IoModel.h"
 
 void CreateParameters(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
Index: sm/trunk/src/c/ModelProcessorx/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/IoModel.cpp	(revision 3684)
+++ 	(revision )
@@ -1,404 +1,0 @@
-/*! \file IoModel.cpp
- * \brief  file containing the methods that will help in processing the input data coming 
- * into ISSM, from Matlab, or through a binary file opened for reading.
- */
-
-#ifdef HAVE_CONFIG_H
-	#include "config.h"
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "../shared/shared.h"
-#include "../io/io.h"
-#include "../include/globals.h"
-#include "../include/macros.h"
-#include <string.h>
-#include "stdio.h"
-
-#include "./IoModel.h"
-
-/*FUNCTION IoModel::IoModel(){{{1*/
-IoModel::IoModel(){
-	this->IoModelInit();
-}
-/*}}}*/
-/*FUNCTION IoModel::~IoModel(){{{1*/
-IoModel::~IoModel(){
-	
-	int i;
-
-	/*!Two cases here: 
-	 * - serial mode: matlab's memory manager will take care of delete iomodel when returning from Imp. Do nothing here, so as not to confuse 
-	 *                the memory manager.
-     * - in parallel, anything the io layer does (FetchData) did needs to be erased explicitely in the iomodel.
-	 */
-
-	#ifdef _PARALLEL_
-	xfree((void**)&this->x);
-	xfree((void**)&this->y);
-	xfree((void**)&this->z);
-	xfree((void**)&this->elements);
-	xfree((void**)&this->elements_type);
-	xfree((void**)&this->gridonhutter);
-	xfree((void**)&this->gridonmacayeal);
-	if (strcmp(this->meshtype,"3d")==0){
-		xfree((void**)&this->elements2d);
-		xfree((void**)&this->deadgrids);
-		xfree((void**)&this->uppernodes);
-		xfree((void**)&this->gridonpattyn);
-	}
-	xfree((void**)&this->solverstring);
-	xfree((void**)&this->elementonbed);
-	xfree((void**)&this->elementonsurface);
-	xfree((void**)&this->gridonbed);
-	xfree((void**)&this->gridonsurface);
-	xfree((void**)&this->gridonstokes);
-	xfree((void**)&this->borderstokes);
-	xfree((void**)&this->thickness);
-	xfree((void**)&this->surface);
-	xfree((void**)&this->bed);
-	xfree((void**)&this->vx_obs);
-	xfree((void**)&this->vy_obs);
-	xfree((void**)&this->vx);
-	xfree((void**)&this->vy);
-	xfree((void**)&this->vz);
-	xfree((void**)&this->pressure);
-	xfree((void**)&this->temperature);
-	xfree((void**)&this->drag_coefficient);
-	xfree((void**)&this->drag_p);
-	xfree((void**)&this->drag_q);
-	xfree((void**)&this->elementoniceshelf);
-	xfree((void**)&this->elementonwater);
-	xfree((void**)&this->gridonicesheet);
-	xfree((void**)&this->gridoniceshelf);
-	xfree((void**)&this->pressureload);
-	xfree((void**)&this->spcvelocity);
-	xfree((void**)&this->spcthickness);
-	xfree((void**)&this->spctemperature);
-	xfree((void**)&this->edges);
-	xfree((void**)&this->geothermalflux);
-	xfree((void**)&this->melting_rate);
-	xfree((void**)&this->accumulation_rate);
-	xfree((void**)&this->dhdt);
-	xfree((void**)&this->rheology_B);
-	xfree((void**)&this->rheology_n);
-	xfree((void**)&this->fit);
-	xfree((void**)&this->weights);
-	xfree((void**)&this->cm_jump);
-	xfree((void**)&this->optscal);
-	xfree((void**)&this->maxiter);
-
-
-	/*!Delete structure fields: */
-	xfree((void**)&this->inputfilename);
-	xfree((void**)&this->outputfilename);
-	xfree((void**)&this->repository);
-	xfree((void**)&this->meshtype);
-	xfree((void**)&this->name);
-	
-	xfree((void**)&this->riftinfo);
-	
-	xfree((void**)&this->penalties);
-	xfree((void**)&this->penaltypartitioning);
-	
-	xfree((void**)&this->control_type);
-	
-	/*exterior data: */
-	xfree((void**)&this->my_elements);
-	xfree((void**)&this->my_vertices);
-	xfree((void**)&this->my_nodes);
-	xfree((void**)&this->my_bordervertices);
-	xfree((void**)&this->penaltypartitioning);
-	#endif
-}
-/*}}}*/
-/*FUNCTION IoModel::IoModel(ConstDataHandle iomodel_handle){{{1*/
-IoModel::IoModel(ConstDataHandle iomodel_handle){
-	
-	int i,j;
-		
-	/*First, initialize the structure: */
-	this->IoModelInit();
-	
-	/*Get all the data that consists of scalars, integers and strings: */
-
-	IoModelFetchData(&this->name,iomodel_handle,"name"); 
-	IoModelFetchData(&this->inputfilename,iomodel_handle,"inputfilename"); 
-	IoModelFetchData(&this->outputfilename,iomodel_handle,"outputfilename"); 
-	IoModelFetchData(&this->analysis_type,iomodel_handle,"analysis_type"); 
-	IoModelFetchData(&this->sub_analysis_type,iomodel_handle,"sub_analysis_type"); 
-	IoModelFetchData(&this->qmu_analysis,iomodel_handle,"qmu_analysis"); 
-	IoModelFetchData(&this->control_analysis,iomodel_handle,"control_analysis"); 
-	IoModelFetchData(&this->meshtype,iomodel_handle,"type");
-	/*!Get numberofelements and numberofvertices: */
-	IoModelFetchData(&this->numberofvertices,iomodel_handle,"numberofgrids");
-	IoModelFetchData(&this->numberofelements,iomodel_handle,"numberofelements");
-	/*!In case we are running 3d, we are going to need the collapsed and non-collapsed 2d meshes, from which the 3d mesh was extruded: */
-	if (strcmp(this->meshtype,"3d")==0){
-	
-		/*!Deal with 2d mesh: */
-		IoModelFetchData(&this->numberofelements2d,iomodel_handle,"numberofelements2d");
-		IoModelFetchData(&this->numberofvertices2d,iomodel_handle,"numberofgrids2d");
-		IoModelFetchData(&this->numlayers,iomodel_handle,"numlayers");
-	}
-
-
-	/*elements type: */
-	IoModelFetchData(&this->ishutter,iomodel_handle,"ishutter");
-	IoModelFetchData(&this->ismacayealpattyn,iomodel_handle,"ismacayealpattyn");
-	IoModelFetchData(&this->isstokes,iomodel_handle,"isstokes");
-
-	/*!Get drag_type, drag and p,q: */
-	IoModelFetchData(&this->drag_type,iomodel_handle,"drag_type");
-
-	/*!Get materials: */
-	IoModelFetchData(&this->rho_water,iomodel_handle,"rho_water");
-	IoModelFetchData(&this->rho_ice,iomodel_handle,"rho_ice");
-	IoModelFetchData(&this->g,iomodel_handle,"g");
-
-	/*Get control parameters: */
-	IoModelFetchData(&this->control_type,iomodel_handle,"control_type"); 
-
-	/*!Get solution parameters: */
-	IoModelFetchData(&this->yts,iomodel_handle,"yts");
-	IoModelFetchData(&this->meanvel,iomodel_handle,"meanvel");
-	IoModelFetchData(&this->epsvel,iomodel_handle,"epsvel");
-	IoModelFetchData(&this->verbose,iomodel_handle,"verbose");
-	IoModelFetchData(&this->plot,iomodel_handle,"plot");
-	IoModelFetchData(&this->artificial_diffusivity,iomodel_handle,"artificial_diffusivity");
-	IoModelFetchData(&this->nsteps,iomodel_handle,"nsteps");
-	IoModelFetchData(&this->eps_cm,iomodel_handle,"eps_cm");
-	IoModelFetchData(&this->tolx,iomodel_handle,"tolx");
-	IoModelFetchData(&this->cm_noisedmp,iomodel_handle,"cm_noisedmp");
-	IoModelFetchData(&this->cm_mindmp_value,iomodel_handle,"cm_mindmp_value");
-	IoModelFetchData(&this->cm_mindmp_slope,iomodel_handle,"cm_mindmp_slope");
-	IoModelFetchData(&this->cm_maxdmp_value,iomodel_handle,"cm_maxdmp_value");
-	IoModelFetchData(&this->cm_maxdmp_slope,iomodel_handle,"cm_maxdmp_slope");
-	IoModelFetchData(&this->cm_min,iomodel_handle,"cm_min");
-	IoModelFetchData(&this->cm_max,iomodel_handle,"cm_max");
-	IoModelFetchData(&this->cm_gradient,iomodel_handle,"cm_gradient");
-	IoModelFetchData(&this->eps_res,iomodel_handle,"eps_res");
-	IoModelFetchData(&this->eps_rel,iomodel_handle,"eps_rel");
-	IoModelFetchData(&this->eps_abs,iomodel_handle,"eps_abs");
-	IoModelFetchData(&this->max_nonlinear_iterations,iomodel_handle,"max_nonlinear_iterations");
-	IoModelFetchData(&this->dt,iomodel_handle,"dt");
-	IoModelFetchData(&this->ndt,iomodel_handle,"ndt");
-	IoModelFetchData(&this->penalty_offset,iomodel_handle,"penalty_offset");
-	IoModelFetchData(&this->penalty_melting,iomodel_handle,"penalty_melting");
-	IoModelFetchData(&this->penalty_lock,iomodel_handle,"penalty_lock");
-	IoModelFetchData(&this->sparsity,iomodel_handle,"sparsity");
-	IoModelFetchData(&this->connectivity,iomodel_handle,"connectivity");
-	IoModelFetchData(&this->lowmem,iomodel_handle,"lowmem");
-	IoModelFetchData(&this->solverstring,iomodel_handle,"solverstring");
-	IoModelFetchData(&this->viscosity_overshoot,iomodel_handle,"viscosity_overshoot");
-	IoModelFetchData(&this->artdiff,iomodel_handle,"artificial_diffusivity");
-	IoModelFetchData(&this->stokesreconditioning,iomodel_handle,"stokesreconditioning");
-	IoModelFetchData(&this->waitonlock,iomodel_handle,"waitonlock");
-
-	/*!Get thermal parameters: */
-	IoModelFetchData(&this->beta,iomodel_handle,"beta");
-	IoModelFetchData(&this->meltingpoint,iomodel_handle,"meltingpoint");
-	IoModelFetchData(&this->latentheat,iomodel_handle,"latentheat");
-	IoModelFetchData(&this->heatcapacity,iomodel_handle,"heatcapacity");
-	IoModelFetchData(&this->thermalconductivity,iomodel_handle,"thermalconductivity");
-	IoModelFetchData(&this->min_thermal_constraints,iomodel_handle,"min_thermal_constraints");
-	IoModelFetchData(&this->min_mechanical_constraints,iomodel_handle,"min_mechanical_constraints");
-	IoModelFetchData(&this->stabilize_constraints,iomodel_handle,"stabilize_constraints");
-	IoModelFetchData(&this->mixed_layer_capacity,iomodel_handle,"mixed_layer_capacity");
-	IoModelFetchData(&this->thermal_exchange_velocity,iomodel_handle,"thermal_exchange_velocity");
-	
-	/*qmu: */
-	if(this->qmu_analysis){
-		IoModelFetchData(&this->numberofvariables,iomodel_handle,"numberofvariables");
-		IoModelFetchData(&this->numberofresponses,iomodel_handle,"numberofresponses");
-		IoModelFetchData(&this->qmu_npart,iomodel_handle,"npart");
-	}
-	
-	/*parameter output : */
-	IoModelFetchData(&this->numoutput,iomodel_handle,"numoutput");
-}
-/*}}}*/
-/*FUNCTION IoModel::IoModelInit(void){{{1*/
-void IoModel::IoModelInit(void){
-	
-	/*!initialize all pointers to 0: */
-	this->name=NULL;
-	this->inputfilename=NULL;
-	this->outputfilename=NULL;
-	this->repository=NULL;
-	this->meshtype=NULL;
-	this->analysis_type=0;
-	this->sub_analysis_type=0;
-	this->qmu_analysis=0;
-	this->control_analysis=0;
-	this->solverstring=NULL;
-	this->numberofresponses=0;
-	this->numberofvariables=0;
-	this->qmu_npart=0; 
-	this->numberofelements=0;
-	this->numberofvertices=0;
-	this->x=NULL; 
-	this->y=NULL;
-	this->z=NULL;
-	this->elements=NULL;
-	this->elements_type=NULL;
-	this->numberofvertices2d=0;
-	this->elements2d=NULL;
-	this->deadgrids=NULL;
-	this->numlayers=0;
-	this->uppernodes=NULL;
-	this->gridonhutter=NULL;
-	this->gridonmacayeal=NULL;
-	this->gridonpattyn=NULL;
-	
-	this->vx_obs=NULL;
-	this->vy_obs=NULL;
-	this->vx=NULL;
-	this->vy=NULL;
-	this->vz=NULL;
-	this->pressure=NULL;
-	this->temperature=NULL;
-	this->melting_rate=NULL;
-	this->geothermalflux=NULL;
-	this->elementonbed=NULL;
-	this->elementonsurface=NULL;
-	this->gridonbed=NULL;
-	this->gridonsurface=NULL;
-	this->gridonstokes=NULL;
-	this->borderstokes=NULL;
-	this->thickness=NULL;
-	this->surface=NULL;
-	this->bed=NULL;
-	this->elementoniceshelf=NULL;
-	this->elementonwater=NULL;
-	this->gridonicesheet=NULL;
-	this->gridoniceshelf=NULL;
-
-	this->drag_type=0;
-	this->drag_coefficient=NULL;
-	this->drag_p=NULL;
-	this->drag_q=NULL;
-	
-	
-	this->numberofpressureloads=0;
-	this->pressureload=NULL;
-	this-> spcvelocity=NULL;
-	this-> spctemperature=NULL;
-	this-> spcthickness=NULL;
-	this->numberofedges=0;
-	this->edges=NULL;
-	
-	/*!materials: */
-	this->rho_water=0;
-	this->rho_ice=0;
-	this->g=0;
-	this->rheology_n=NULL;
-	this->rheology_B=NULL;
-
-	/*!control methods: */
-	this->control_type=NULL;
-
-	/*!solution parameters: */
-	this->fit=NULL;
-	this->weights=NULL;
-	this->cm_jump=NULL;
-	this->meanvel=0;
-	this->epsvel=0;
-	this->artificial_diffusivity=0;
-	this->nsteps=0;
-	this->eps_cm=0;
-	this->tolx=0;
-	this->maxiter=NULL;
-	this->cm_noisedmp=0;
-	this->cm_mindmp_value=0;
-	this->cm_mindmp_slope=0;
-	this->cm_maxdmp_value=0;
-	this->cm_maxdmp_slope=0;
-	this->cm_min=0;
-	this->cm_max=0;
-	this->cm_gradient=0;
-	this->verbose=0;
-	this->plot=0;
-	this->eps_res=0;
-	this->eps_rel=0;
-	this->eps_abs=0;
-	this->max_nonlinear_iterations=0;
-	this->dt=0;
-	this->ndt=0;
-	this->penalty_offset=0;
-	this->penalty_melting=0;
-	this->penalty_lock=0;
-	this->sparsity=0;
-	this->connectivity=0;
-	this->lowmem=0;
-	this->optscal=NULL;
-	this->yts=0;
-	this->viscosity_overshoot=0;
-	this->artdiff=0;
-	this->stokesreconditioning=0;
-	this->waitonlock=0;
-
-	/*!thermal parameters: */
-	this->beta=0;
-	this->meltingpoint=0;
-	this->latentheat=0;
-	this->heatcapacity=0;
-	this->thermalconductivity=0;
-	this->min_thermal_constraints=0;
-	this->min_mechanical_constraints=0;
-	this->stabilize_constraints=0;
-	this->mixed_layer_capacity=0;
-	this->thermal_exchange_velocity=0;
-
-	
-	this->numrifts=0;
-	this->riftinfo=NULL;
-
-	/*!penalties: */
-	this->numpenalties=0;
-	this->penalties=NULL;
-	this->penaltypartitioning=NULL;
-
-	/*!basal: */
-	this->accumulation_rate=NULL;
-	this->dhdt=NULL;
-	
-	/*parameter output: */
-	this->numoutput=0;
-
-	/*elements type: */
-	this->ishutter=0;
-	this->ismacayealpattyn=0;
-	this->isstokes=0;
-
-	/*exterior data: */
-	this->my_elements=NULL;
-	this->my_vertices=NULL;
-	this->my_nodes=NULL;
-	this->my_bordervertices=NULL;
-	this->penaltypartitioning=NULL;
-}
-/*}}}*/
-/*FUNCTION IoModel::Echo(int which_part,int rank){{{1*/
-void IoModel::Echo(int which_part,int rank) {
-
-	//which_part  determines what gets echoed, otherwise, we'll get too much output.
-	//1-> penalties
-
-	int i,j;
-
-	if(which_part==1 && my_rank==rank && (strcmp(this->meshtype,"3d")==0)){
-		printf("IoModel penalties: \n");
-		printf("   number of penalties: %i\n",this->numpenalties);
-		printf("   grids: \n");
-
-		for(i=0;i<this->numpenalties;i++){
-			for(j=0;j<this->numlayers;j++){
-				printf("%i ",(int)*(this->penalties+this->numlayers*i+j));
-			}
-			printf("\n");
-		}
-	}
-}
-/*}}}*/
Index: sm/trunk/src/c/ModelProcessorx/IoModel.h
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/IoModel.h	(revision 3684)
+++ 	(revision )
@@ -1,197 +1,0 @@
-/* \file IoModel.h
- * \brief  Header file defining the IoModel structure that will help in processing the input data coming 
- * into ISSM, from Matlab, or through a binary file opened for reading.
- * \sa IoModel.cpp
- */
-
-#ifndef _IOMODEL_H
-#define _IOMODEL_H
-
-#include "../io/io.h"
-
-class IoModel {
-
-	public:
-
-		/*Data: {{{1*/
-		char*   name;
-		char*	  inputfilename;
-		char*	  outputfilename;
-		char*   repository;
-		char*   meshtype;
-		int     analysis_type;
-		int     sub_analysis_type;
-		int     qmu_analysis;
-		int     control_analysis;
-		char*   solverstring;
-
-		/*2d mesh: */
-		int     numberofelements;
-		int     numberofvertices;
-		double* x;
-		double* y;
-		double* z;
-		double* elements;
-		double* elements_type;
-
-		/*3d mesh: */
-		int     numberofvertices2d;
-		int     numberofelements2d;
-		double* elements2d;
-		double* deadgrids;
-		int     numlayers;
-		double* uppernodes;
-
-		/*elements type: */
-		int     ishutter;
-		int     ismacayealpattyn;
-		int     isstokes;
-		double* gridonhutter;
-		double* gridonmacayeal;
-		double* gridonpattyn;
-
-		/*results: */
-		double* vx;
-		double* vy;
-		double* vz;
-		double* pressure;
-		double* temperature;
-
-		/*observations: */
-		double*  vx_obs;
-		double*  vy_obs;
-
-		/*qmu: */
-		int      numberofresponses;
-		int      numberofvariables;
-		int      qmu_npart;
-
-		/*geometry: */
-		double* elementonbed;
-		double* elementonsurface;
-		double* gridonbed;
-		double* gridonsurface;
-		double* gridonstokes;
-		double* borderstokes;
-		double* thickness;
-		double* surface;
-		double* bed;
-		double* elementoniceshelf;
-		double* elementonwater;
-		double* gridonicesheet;
-		double* gridoniceshelf;
-
-		/*friction: */
-		int     drag_type;
-		double* drag_coefficient;
-		double* drag_p;
-		double* drag_q;
-
-		/*boundary conditions: */
-		int     numberofpressureloads;
-		double* pressureload;
-		double* spcvelocity;
-		double* spctemperature;
-		double* spcthickness;
-		double* geothermalflux;
-		int     numberofedges;
-		double* edges;
-
-		/*materials: */
-		double  rho_water,rho_ice;
-		double  g;
-		double* rheology_B;
-		double* rheology_n;
-
-		/*numerical parameters: */
-		double  meanvel;
-		double  epsvel;
-		int     artdiff;
-		double  viscosity_overshoot;
-		double  stokesreconditioning;
-		double  cm_noisedmp;
-		double  cm_mindmp_value;
-		double  cm_mindmp_slope;
-		double  cm_maxdmp_value;
-		double  cm_maxdmp_slope;
-		double  cm_min;
-		double  cm_max;
-		int     cm_gradient;;
-
-		double  cm_noisedampening;
-
-		/*control methods: */
-		char*	control_type;
-
-		/*solution parameters: */
-		double* fit;
-		double* weights;
-		double* cm_jump;
-		int     artificial_diffusivity;
-		int     nsteps;
-		double  eps_cm;
-		double  tolx;
-		double* maxiter;
-		int     verbose;
-		int     plot;
-		double  eps_res;
-		double  eps_rel;
-		double  eps_abs;
-		double  max_nonlinear_iterations;
-		double  dt,ndt;
-		double  penalty_offset;
-		double  penalty_melting;
-		int     penalty_lock;
-		double  sparsity;
-		int     connectivity;
-		int     lowmem;
-		double* optscal;
-		double  yts;
-		double  waitonlock;
-
-		/*thermal parameters: */
-		double beta;
-		double meltingpoint;
-		double latentheat;
-		double  heatcapacity,thermalconductivity;
-		int    min_thermal_constraints;
-		int    min_mechanical_constraints;
-		int    stabilize_constraints;
-		double mixed_layer_capacity;
-		double thermal_exchange_velocity;
-
-		/*rifts: */
-		int      numrifts;
-		double*  riftinfo;
-
-		/*penalties: */
-		int      numpenalties;
-		double*  penalties;
-
-		/*basal: */
-		double*  melting_rate;
-		double*  accumulation_rate;
-		double*  dhdt;
-
-		/*parameter output: */
-		int      numoutput;
-
-		/*exterior partitioning data, to be carried around: */
-		bool*   my_elements;
-		bool*   my_vertices;
-		bool*   my_nodes;
-		bool*   my_bordervertices;
-		int*    penaltypartitioning;
-		int*    singlenodetoelementconnectivity;
-		/*}}}*/
-		/*Methods: {{{1*/
-		~IoModel();
-		IoModel();
-		IoModel(ConstDataHandle iomodel_handle);
-		void IoModelInit(void);
-		void Echo(int which_part,int rank);
-		/*}}}*/
-
-};
-
-#endif  /* _IOMODEL_H */
Index: /issm/trunk/src/c/ModelProcessorx/Partitioning.cpp
===================================================================
--- /issm/trunk/src/c/ModelProcessorx/Partitioning.cpp	(revision 3684)
+++ /issm/trunk/src/c/ModelProcessorx/Partitioning.cpp	(revision 3685)
@@ -10,8 +10,9 @@
 
 #include <string.h>
-#include "./IoModel.h"
+#include "../objects/objects.h"
 #include "../shared/shared.h"
 #include "../EnumDefinitions/EnumDefinitions.h"
 #include "../include/macros.h"
+#include "../io/io.h"
 #include "../include/typedefs.h"
 #include "../MeshPartitionx/MeshPartitionx.h"
Index: /issm/trunk/src/c/io/FetchParams.cpp
===================================================================
--- /issm/trunk/src/c/io/FetchParams.cpp	(revision 3684)
+++ /issm/trunk/src/c/io/FetchParams.cpp	(revision 3685)
@@ -12,13 +12,14 @@
 
 #include <mex.h>
-
-#include "../objects/Param.h"
 #include "./io.h"
+#include "../objects/objects.h"
 #include "../shared/shared.h"
 #include "../include/macros.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
 
 void FetchParams(DataSet** pparameters, DataHandle dataref){
 
 	int i,j;
+	int count;
 
 	/*output: */
Index: /issm/trunk/src/c/io/IoModelFetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/IoModelFetchData.cpp	(revision 3684)
+++ /issm/trunk/src/c/io/IoModelFetchData.cpp	(revision 3685)
@@ -10,7 +10,4 @@
 
 #include "./io.h"
-#include "../ModelProcessorx/IoModel.h"
-#include "../shared/shared.h"
-#include "../include/macros.h"
 
 #ifdef _SERIAL_
Index: /issm/trunk/src/c/io/WriteParams.cpp
===================================================================
--- /issm/trunk/src/c/io/WriteParams.cpp	(revision 3684)
+++ /issm/trunk/src/c/io/WriteParams.cpp	(revision 3685)
@@ -13,6 +13,6 @@
 #include <mex.h>
 
-#include "../objects/Param.h"
 #include "./io.h"
+#include "../objects/objects.h"
 #include "../shared/shared.h"
 #include "../include/macros.h"
Index: /issm/trunk/src/c/io/io.h
===================================================================
--- /issm/trunk/src/c/io/io.h	(revision 3684)
+++ /issm/trunk/src/c/io/io.h	(revision 3685)
@@ -3,11 +3,8 @@
  */
 
-#ifndef IO_H_
-#define IO_H_
+#ifndef _IO_H_
+#define _IO_H_
 
-#include "../objects/NodeSets.h"
-#include "../objects/DofVec.h"
-#include "../objects/BamgMesh.h"
-#include "../objects/BamgGeom.h"
+#include "../objects/objects.h"
 #include "../DataSet/DataSet.h"
 #include "../include/types.h"
@@ -59,8 +56,4 @@
 #endif
 
-
-
-
-
 #ifdef _PARALLEL_
 void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid);
@@ -83,6 +76,3 @@
 
 
-
-
-
 #endif	/* _IO_H_ */
Index: /issm/trunk/src/c/shared/Elements/GetVerticesCoordinates.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/GetVerticesCoordinates.cpp	(revision 3684)
+++ /issm/trunk/src/c/shared/Elements/GetVerticesCoordinates.cpp	(revision 3685)
@@ -3,5 +3,5 @@
  */ 
 
-#include "../../objects/Node.h"
+#include "../../objects/objects.h"
 
 int GetVerticesCoordinates( double* xyz,  Node** nodes, int numgrids){
Index: /issm/trunk/src/c/shared/Numerics/numerics.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/numerics.h	(revision 3684)
+++ /issm/trunk/src/c/shared/Numerics/numerics.h	(revision 3685)
@@ -8,6 +8,7 @@
 #include "./GaussPoints.h"
 #include "./isnan.h"
-#include "../../objects/OptArgs.h"
-#include "../../objects/OptPars.h"
+
+struct OptArgs;
+struct OptPars;
 
 double min(double a,double b);
