Index: /issm/trunk/src/c/Container/DataSet.cpp
===================================================================
--- /issm/trunk/src/c/Container/DataSet.cpp	(revision 6174)
+++ /issm/trunk/src/c/Container/DataSet.cpp	(revision 6175)
@@ -47,5 +47,4 @@
 /*FUNCTION DataSet::Copy{{{1*/
 DataSet*   DataSet::Copy(void){
-
 
 	DataSet* copy=NULL;
@@ -198,156 +197,157 @@
 		memcpy(&enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
 
-		if(enum_type==NodeEnum){
-			Node* node=NULL;
-			node=new Node();
-			node->Demarshall(&marshalled_dataset);
-			dataset->AddObject(node);
-		}
-		else if(enum_type==VertexEnum){
-			Vertex* vertex=NULL;
-			vertex=new Vertex();
-			vertex->Demarshall(&marshalled_dataset);
-			dataset->AddObject(vertex);
-		}
-		else if(enum_type==DoubleParamEnum){
-			DoubleParam* doubleparam=NULL;
-			doubleparam=new DoubleParam();
-			doubleparam->Demarshall(&marshalled_dataset);
-			dataset->AddObject(doubleparam);
-		}
-		else if(enum_type==TriaEnum){
-			Tria* tria=NULL;
-			tria=new Tria();
-			tria->Demarshall(&marshalled_dataset);
-			dataset->AddObject(tria);
-		}
-		else if(enum_type==TriaVertexInputEnum){
-			TriaVertexInput* triavertexinput=NULL;
-			triavertexinput=new TriaVertexInput();
-			triavertexinput->Demarshall(&marshalled_dataset);
-			dataset->AddObject(triavertexinput);
-		}
-		else if(enum_type==PentaVertexInputEnum){
-			PentaVertexInput* pentavertexinput=NULL;
-			pentavertexinput=new PentaVertexInput();
-			pentavertexinput->Demarshall(&marshalled_dataset);
-			dataset->AddObject(pentavertexinput);
-		}
-		else if(enum_type==TriaVertexElementResultEnum){
-			TriaVertexElementResult* triavertexelementresult=NULL;
-			triavertexelementresult=new TriaVertexElementResult();
-			triavertexelementresult->Demarshall(&marshalled_dataset);
-			dataset->AddObject(triavertexelementresult);
-		}
-		else if(enum_type==PentaVertexElementResultEnum){
-			PentaVertexElementResult* pentavertexelementresult=NULL;
-			pentavertexelementresult=new PentaVertexElementResult();
-			pentavertexelementresult->Demarshall(&marshalled_dataset);
-			dataset->AddObject(pentavertexelementresult);
-		}
-		else if(enum_type==PentaEnum){
-			Penta* penta=NULL;
-			penta=new Penta();
-			penta->Demarshall(&marshalled_dataset);
-			dataset->AddObject(penta);
-		}
-		else if(enum_type==MaticeEnum){
-			Matice* matice=NULL;
-			matice=new Matice();
-			matice->Demarshall(&marshalled_dataset);
-			dataset->AddObject(matice);
-		}
-		else if(enum_type==MatparEnum){
-			Matpar* matpar=NULL;
-			matpar=new Matpar();
-			matpar->Demarshall(&marshalled_dataset);
-			dataset->AddObject(matpar);
-		}
-		else if(enum_type==SpcEnum){
-			Spc* spc=NULL;
-			spc=new Spc();
-			spc->Demarshall(&marshalled_dataset);
-			dataset->AddObject(spc);
-		}
-		else if(enum_type==PengridEnum){
-			Pengrid* pengrid=NULL;
-			pengrid=new Pengrid();
-			pengrid->Demarshall(&marshalled_dataset);
-			dataset->AddObject(pengrid);
-		}
-		else if(enum_type==PenpairEnum){
-			Penpair* penpair=NULL;
-			penpair=new Penpair();
-			penpair->Demarshall(&marshalled_dataset);
-			dataset->AddObject(penpair);
-		}
-		else if(enum_type==IcefrontEnum){
-			Icefront* icefront=NULL;
-			icefront=new Icefront();
-			icefront->Demarshall(&marshalled_dataset);
-			dataset->AddObject(icefront);
-		}
-		else if(enum_type==NumericalfluxEnum){
-			Numericalflux* numericalflux=NULL;
-			numericalflux=new Numericalflux();
-			numericalflux->Demarshall(&marshalled_dataset);
-			dataset->AddObject(numericalflux);
-		}
-		else if(enum_type==RiftfrontEnum){
-			Riftfront* riftfront=NULL;
-			riftfront=new Riftfront();
-			riftfront->Demarshall(&marshalled_dataset);
-			dataset->AddObject(riftfront);
-		}
-		else if(enum_type==DoubleInputEnum){
-			DoubleInput* doubleinput=NULL;
-			doubleinput=new DoubleInput();
-			doubleinput->Demarshall(&marshalled_dataset);
-			dataset->AddObject(doubleinput);
-		}
-		else if(enum_type==IntInputEnum){
-			IntInput* intinput=NULL;
-			intinput=new IntInput();
-			intinput->Demarshall(&marshalled_dataset);
-			dataset->AddObject(intinput);
-		}
-		else if(enum_type==BoolInputEnum){
-			BoolInput* boolinput=NULL;
-			boolinput=new BoolInput();
-			boolinput->Demarshall(&marshalled_dataset);
-			dataset->AddObject(boolinput);
-		}
-		else if(enum_type==IntParamEnum){
-			IntParam* intparam=NULL;
-			intparam=new IntParam();
-			intparam->Demarshall(&marshalled_dataset);
-			dataset->AddObject(intparam);
-		}
-		else if(enum_type==BoolParamEnum){
-			BoolParam* boolparam=NULL;
-			boolparam=new BoolParam();
-			boolparam->Demarshall(&marshalled_dataset);
-			dataset->AddObject(boolparam);
-		}
-		else if(enum_type==StringParamEnum){
-			StringParam* stringparam=NULL;
-			stringparam=new StringParam();
-			stringparam->Demarshall(&marshalled_dataset);
-			dataset->AddObject(stringparam);
-		}
-		else if(enum_type==DoubleVecExternalResultEnum){
-			DoubleVecExternalResult* doublevecexternalresult=NULL;
-			doublevecexternalresult=new DoubleVecExternalResult();
-			doublevecexternalresult->Demarshall(&marshalled_dataset);
-			dataset->AddObject(doublevecexternalresult);
-		}
-		else if(enum_type==DoubleExternalResultEnum){
-			DoubleExternalResult* doubleexternalresult=NULL;
-			doubleexternalresult=new DoubleExternalResult();
-			doubleexternalresult->Demarshall(&marshalled_dataset);
-			dataset->AddObject(doubleexternalresult);
-		}
-		else{
-			ISSMERROR("could not recognize enum type: %i (%s)",enum_type,EnumToString(enum_type));
+		switch(enum_type){
+			case NodeEnum:{
+				Node* node=NULL;
+				node=new Node();
+				node->Demarshall(&marshalled_dataset);
+				dataset->AddObject(node);}
+				break;
+			case VertexEnum:{
+				Vertex* vertex=NULL;
+				vertex=new Vertex();
+				vertex->Demarshall(&marshalled_dataset);
+				dataset->AddObject(vertex);}
+				break;
+			case DoubleParamEnum:{
+				DoubleParam* doubleparam=NULL;
+				doubleparam=new DoubleParam();
+				doubleparam->Demarshall(&marshalled_dataset);
+				dataset->AddObject(doubleparam);}
+				break;
+			case TriaEnum:{
+				Tria* tria=NULL;
+				tria=new Tria();
+				tria->Demarshall(&marshalled_dataset);
+				dataset->AddObject(tria);}
+				break;
+			case TriaVertexInputEnum:{
+				TriaVertexInput* triavertexinput=NULL;
+				triavertexinput=new TriaVertexInput();
+				triavertexinput->Demarshall(&marshalled_dataset);
+				dataset->AddObject(triavertexinput);}
+				break;
+			case PentaVertexInputEnum:{
+				PentaVertexInput* pentavertexinput=NULL;
+				pentavertexinput=new PentaVertexInput();
+				pentavertexinput->Demarshall(&marshalled_dataset);
+				dataset->AddObject(pentavertexinput);}
+				break;
+			case TriaVertexElementResultEnum:{
+				TriaVertexElementResult* triavertexelementresult=NULL;
+				triavertexelementresult=new TriaVertexElementResult();
+				triavertexelementresult->Demarshall(&marshalled_dataset);
+				dataset->AddObject(triavertexelementresult);}
+				break;
+			case PentaVertexElementResultEnum:{
+				PentaVertexElementResult* pentavertexelementresult=NULL;
+				pentavertexelementresult=new PentaVertexElementResult();
+				pentavertexelementresult->Demarshall(&marshalled_dataset);
+				dataset->AddObject(pentavertexelementresult);}
+				break;
+			case PentaEnum:{
+				Penta* penta=NULL;
+				penta=new Penta();
+				penta->Demarshall(&marshalled_dataset);
+				dataset->AddObject(penta);}
+				break;
+			case MaticeEnum:{
+				Matice* matice=NULL;
+				matice=new Matice();
+				matice->Demarshall(&marshalled_dataset);
+				dataset->AddObject(matice);}
+				break;
+			case MatparEnum:{
+				Matpar* matpar=NULL;
+				matpar=new Matpar();
+				matpar->Demarshall(&marshalled_dataset);
+				dataset->AddObject(matpar);}
+				break;
+			case SpcEnum:{
+				Spc* spc=NULL;
+				spc=new Spc();
+				spc->Demarshall(&marshalled_dataset);
+				dataset->AddObject(spc);}
+				break;
+			case PengridEnum:{
+				Pengrid* pengrid=NULL;
+				pengrid=new Pengrid();
+				pengrid->Demarshall(&marshalled_dataset);
+				dataset->AddObject(pengrid);}
+				break;
+			case PenpairEnum:{
+				Penpair* penpair=NULL;
+				penpair=new Penpair();
+				penpair->Demarshall(&marshalled_dataset);
+				dataset->AddObject(penpair);}
+				break;
+			case IcefrontEnum:{
+				Icefront* icefront=NULL;
+				icefront=new Icefront();
+				icefront->Demarshall(&marshalled_dataset);
+				dataset->AddObject(icefront);}
+				break;
+			case NumericalfluxEnum:{
+				Numericalflux* numericalflux=NULL;
+				numericalflux=new Numericalflux();
+				numericalflux->Demarshall(&marshalled_dataset);
+				dataset->AddObject(numericalflux);}
+				break;
+			case RiftfrontEnum:{
+				Riftfront* riftfront=NULL;
+				riftfront=new Riftfront();
+				riftfront->Demarshall(&marshalled_dataset);
+				dataset->AddObject(riftfront);}
+				break;
+			case DoubleInputEnum:{
+				DoubleInput* doubleinput=NULL;
+				doubleinput=new DoubleInput();
+				doubleinput->Demarshall(&marshalled_dataset);
+				dataset->AddObject(doubleinput);}
+				break;
+			case IntInputEnum:{
+				IntInput* intinput=NULL;
+				intinput=new IntInput();
+				intinput->Demarshall(&marshalled_dataset);
+				dataset->AddObject(intinput);}
+				break;
+			case BoolInputEnum:{
+				BoolInput* boolinput=NULL;
+				boolinput=new BoolInput();
+				boolinput->Demarshall(&marshalled_dataset);
+				dataset->AddObject(boolinput);}
+				break;
+			case IntParamEnum:{
+				IntParam* intparam=NULL;
+				intparam=new IntParam();
+				intparam->Demarshall(&marshalled_dataset);
+				dataset->AddObject(intparam);}
+				break;
+			case BoolParamEnum:{
+				BoolParam* boolparam=NULL;
+				boolparam=new BoolParam();
+				boolparam->Demarshall(&marshalled_dataset);
+				dataset->AddObject(boolparam);}
+				break;
+			case StringParamEnum:{
+				StringParam* stringparam=NULL;
+				stringparam=new StringParam();
+				stringparam->Demarshall(&marshalled_dataset);
+				dataset->AddObject(stringparam);}
+				break;
+			case DoubleVecExternalResultEnum:{
+				DoubleVecExternalResult* doublevecexternalresult=NULL;
+				doublevecexternalresult=new DoubleVecExternalResult();
+				doublevecexternalresult->Demarshall(&marshalled_dataset);
+				dataset->AddObject(doublevecexternalresult);}
+				break;
+			case DoubleExternalResultEnum:{
+				DoubleExternalResult* doubleexternalresult=NULL;
+				doubleexternalresult=new DoubleExternalResult();
+				doubleexternalresult->Demarshall(&marshalled_dataset);
+				dataset->AddObject(doubleexternalresult);}
+				break;
+			default:
+				ISSMERROR("could not recognize enum type: %i (%s)",enum_type,EnumToString(enum_type));
 		}
 
