Index: issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
===================================================================
--- issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 24240)
+++ issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 24335)
@@ -32,5 +32,5 @@
 }
 /*}}}*/
-void LevelsetAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+void LevelsetAnalysis::UpdateElements(Elements* elements,Inputs2* inputs2,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
 
 	/*Finite element type*/
@@ -43,12 +43,12 @@
 		if(iomodel->my_elements[i]){
 			Element* element=(Element*)elements->GetObjectByOffset(counter);
-			element->Update(i,iomodel,analysis_counter,analysis_type,finiteelement);
+			element->Update(inputs2,i,iomodel,analysis_counter,analysis_type,finiteelement);
 			counter++;
 		}
 	}
 
-	iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
-	iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum);
-	iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum);
+	iomodel->FetchDataToInput(inputs2,elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+	iomodel->FetchDataToInput(inputs2,elements,"md.initialization.vx",VxEnum);
+	iomodel->FetchDataToInput(inputs2,elements,"md.initialization.vy",VyEnum);
 
 	/*Get moving front parameters*/
@@ -57,26 +57,26 @@
 	switch(calvinglaw){
 		case DefaultCalvingEnum:
-			iomodel->FetchDataToInput(elements,"md.calving.calvingrate",CalvingCalvingrateEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.calving.calvingrate",CalvingCalvingrateEnum);
 			break;
 		case CalvingLevermannEnum:
-			iomodel->FetchDataToInput(elements,"md.calving.coeff",CalvinglevermannCoeffEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.calving.coeff",CalvinglevermannCoeffEnum);
 			break;
 		case CalvingVonmisesEnum:
-			iomodel->FetchDataToInput(elements,"md.calving.stress_threshold_groundedice",CalvingStressThresholdGroundediceEnum);
-			iomodel->FetchDataToInput(elements,"md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum);
-			iomodel->FetchDataToInput(elements,"md.geometry.bed",BedEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.calving.stress_threshold_groundedice",CalvingStressThresholdGroundediceEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.geometry.bed",BedEnum);
 			break;
 		case CalvingMinthicknessEnum:
-			iomodel->FetchDataToInput(elements,"md.geometry.bed",BedEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.geometry.bed",BedEnum);
 			break;
 		case CalvingHabEnum:
-			iomodel->FetchDataToInput(elements,"md.calving.flotation_fraction",CalvingHabFractionEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.calving.flotation_fraction",CalvingHabFractionEnum);
 			break;
 		case CalvingCrevasseDepthEnum:
-			iomodel->FetchDataToInput(elements,"md.calving.water_height",WaterheightEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.calving.water_height",WaterheightEnum);
 			break;
 		case CalvingDev2Enum:
-			iomodel->FetchDataToInput(elements,"md.calving.stress_threshold_groundedice",CalvingStressThresholdGroundediceEnum);
-			iomodel->FetchDataToInput(elements,"md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.calving.stress_threshold_groundedice",CalvingStressThresholdGroundediceEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum);
 			break;
 		default:
@@ -89,10 +89,10 @@
 	switch(melt_parameterization){
 		case FrontalForcingsDefaultEnum:
-			iomodel->FetchDataToInput(elements,"md.frontalforcings.meltingrate",CalvingMeltingrateEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.frontalforcings.meltingrate",CalvingMeltingrateEnum);
 			break;
 		case FrontalForcingsRignotEnum:
-			iomodel->FetchDataToInput(elements,"md.frontalforcings.basin",FrontalForcingsBasinIdEnum);
-			iomodel->FetchDataToInput(elements,"md.frontalforcings.subglacial_discharge",FrontalForcingsSubglacialDischargeEnum);
-			iomodel->FetchDataToInput(elements,"md.frontalforcings.thermalforcing",FrontalForcingsThermalForcingEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.frontalforcings.basin",FrontalForcingsBasinIdEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.frontalforcings.subglacial_discharge",FrontalForcingsSubglacialDischargeEnum);
+			iomodel->FetchDataToInput(inputs2,elements,"md.frontalforcings.thermalforcing",FrontalForcingsThermalForcingEnum);
 			break;
 		default:
@@ -226,28 +226,28 @@
 	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
 	basalelement->FindParam(&calvingmax,CalvingMaxEnum);
-	Input* vx_input           = NULL;
-	Input* vy_input           = NULL;
-	Input* calvingratex_input = NULL;
-	Input* calvingratey_input = NULL;
-	Input* lsf_slopex_input   = NULL;
-	Input* lsf_slopey_input   = NULL;
-	Input* calvingrate_input  = NULL;
-	Input* meltingrate_input  = NULL;
-	Input* gr_input           = NULL;
+	Input2* vx_input           = NULL;
+	Input2* vy_input           = NULL;
+	Input2* calvingratex_input = NULL;
+	Input2* calvingratey_input = NULL;
+	Input2* lsf_slopex_input   = NULL;
+	Input2* lsf_slopey_input   = NULL;
+	Input2* calvingrate_input  = NULL;
+	Input2* meltingrate_input  = NULL;
+	Input2* gr_input           = NULL;
 
 	/*Load velocities*/
 	switch(domaintype){
 		case Domain2DverticalEnum:
-			vx_input=basalelement->GetInput(VxEnum); _assert_(vx_input);
+			vx_input=basalelement->GetInput2(VxEnum); _assert_(vx_input);
 			break;
 		case Domain2DhorizontalEnum:
-			vx_input=basalelement->GetInput(VxEnum); _assert_(vx_input);
-			vy_input=basalelement->GetInput(VyEnum); _assert_(vy_input);
-			gr_input=basalelement->GetInput(MaskGroundediceLevelsetEnum); _assert_(gr_input);
+			vx_input=basalelement->GetInput2(VxEnum); _assert_(vx_input);
+			vy_input=basalelement->GetInput2(VyEnum); _assert_(vy_input);
+			gr_input=basalelement->GetInput2(MaskGroundediceLevelsetEnum); _assert_(gr_input);
 			break;
 		case Domain3DEnum:
-			vx_input=basalelement->GetInput(VxAverageEnum); _assert_(vx_input);
-			vy_input=basalelement->GetInput(VyAverageEnum); _assert_(vy_input);
-			gr_input=basalelement->GetInput(MaskGroundediceLevelsetEnum); _assert_(gr_input);
+			vx_input=basalelement->GetInput2(VxAverageEnum); _assert_(vx_input);
+			vy_input=basalelement->GetInput2(VyAverageEnum); _assert_(vy_input);
+			gr_input=basalelement->GetInput2(MaskGroundediceLevelsetEnum); _assert_(gr_input);
 			break;
 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
@@ -258,47 +258,47 @@
 		case DefaultCalvingEnum:
 		case CalvingVonmisesEnum:
-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
-			calvingrate_input = basalelement->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			lsf_slopex_input  = basalelement->GetInput2(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = basalelement->GetInput2(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			calvingrate_input = basalelement->GetInput2(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
+			meltingrate_input = basalelement->GetInput2(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
 			break;
 		case CalvingLevermannEnum:
 			switch(domaintype){
 				case Domain2DverticalEnum:
-					calvingratex_input=basalelement->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+					calvingratex_input=basalelement->GetInput2(CalvingratexEnum); _assert_(calvingratex_input);
 					break;
 				case Domain2DhorizontalEnum:
-					calvingratex_input=basalelement->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
-					calvingratey_input=basalelement->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+					calvingratex_input=basalelement->GetInput2(CalvingratexEnum); _assert_(calvingratex_input);
+					calvingratey_input=basalelement->GetInput2(CalvingrateyEnum); _assert_(calvingratey_input);
 					break;
 				case Domain3DEnum:
-					calvingratex_input=basalelement->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
-					calvingratey_input=basalelement->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
+					calvingratex_input=basalelement->GetInput2(CalvingratexAverageEnum); _assert_(calvingratex_input);
+					calvingratey_input=basalelement->GetInput2(CalvingrateyAverageEnum); _assert_(calvingratey_input);
 					break;
 				default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
 			}
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			meltingrate_input = basalelement->GetInput2(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
 			break;
 		case CalvingMinthicknessEnum:
-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			lsf_slopex_input  = basalelement->GetInput2(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = basalelement->GetInput2(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			meltingrate_input = basalelement->GetInput2(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
 			break;
 		case CalvingHabEnum:
-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			lsf_slopex_input  = basalelement->GetInput2(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = basalelement->GetInput2(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			meltingrate_input = basalelement->GetInput2(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
 			break;
 		case CalvingCrevasseDepthEnum:
-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			lsf_slopex_input  = basalelement->GetInput2(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = basalelement->GetInput2(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			meltingrate_input = basalelement->GetInput2(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
 			break;
 		case CalvingDev2Enum:
 			basalelement->FindParam(&calvinghaf,CalvingHeightAboveFloatationEnum);
-			lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
-			if(dim==2) lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
-			calvingrate_input = basalelement->GetInput(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
-			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
+			lsf_slopex_input  = basalelement->GetInput2(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
+			if(dim==2) lsf_slopey_input  = basalelement->GetInput2(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
+			calvingrate_input = basalelement->GetInput2(CalvingCalvingrateEnum);     _assert_(calvingrate_input);
+			meltingrate_input = basalelement->GetInput2(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
 			break;
 		default:
@@ -571,5 +571,5 @@
 		/*Retrieve all inputs and parameters*/
 		basalelement->GetVerticesCoordinates(&xyz_list);
-		Input* levelset_input     = basalelement->GetInput(MaskIceLevelsetEnum);                    _assert_(levelset_input);
+		Input2* levelset_input     = basalelement->GetInput2(MaskIceLevelsetEnum);                    _assert_(levelset_input);
 
 		/* Start  looping on the number of gaussian points: */
@@ -718,7 +718,7 @@
 			int      numnodes = element->GetNumberOfNodes();
 			Gauss*   gauss    = element->NewGauss();
-			Input*   H_input  = element->GetInput(ThicknessEnum); _assert_(H_input);
-			Input*   b_input = element->GetInput(BedEnum); _assert_(b_input);
-			Input*   sl_input = element->GetInput(SealevelEnum); _assert_(sl_input);
+			Input2*   H_input  = element->GetInput2(ThicknessEnum); _assert_(H_input);
+			Input2*   b_input = element->GetInput2(BedEnum); _assert_(b_input);
+			Input2*   sl_input = element->GetInput2(SealevelEnum); _assert_(sl_input);
 
 			/*Potentially constrain nodes of this element*/
@@ -746,5 +746,5 @@
 
 		/*Get the fraction of the flotation thickness at the terminus*/
-		femmodel->elements->InputDuplicate(MaskIceLevelsetEnum, DistanceToCalvingfrontEnum);
+		InputDuplicatex(femmodel,MaskIceLevelsetEnum,DistanceToCalvingfrontEnum);
 		femmodel->DistanceToFieldValue(MaskIceLevelsetEnum,0,DistanceToCalvingfrontEnum);
 
@@ -758,8 +758,8 @@
 			int      numnodes           = element->GetNumberOfNodes();
 			Gauss*   gauss              = element->NewGauss();
-			Input*   H_input            = element->GetInput(ThicknessEnum); _assert_(H_input);
-			Input*   bed_input          = element->GetInput(BedEnum); _assert_(bed_input);
-			Input*   hab_fraction_input = element->GetInput(CalvingHabFractionEnum); _assert_(hab_fraction_input);
-			Input*   ls_input           = element->GetInput(DistanceToCalvingfrontEnum); _assert_(ls_input);
+			Input2*   H_input            = element->GetInput2(ThicknessEnum); _assert_(H_input);
+			Input2*   bed_input          = element->GetInput2(BedEnum); _assert_(bed_input);
+			Input2*   hab_fraction_input = element->GetInput2(CalvingHabFractionEnum); _assert_(hab_fraction_input);
+			Input2*   ls_input           = element->GetInput2(DistanceToCalvingfrontEnum); _assert_(ls_input);
 
 			/*Potentially constrain nodes of this element*/
@@ -793,5 +793,5 @@
 
 		/*Get the DistanceToCalvingfront*/
-		femmodel->elements->InputDuplicate(MaskIceLevelsetEnum,DistanceToCalvingfrontEnum);
+		InputDuplicatex(femmodel,MaskIceLevelsetEnum,DistanceToCalvingfrontEnum);
 		femmodel->DistanceToFieldValue(MaskIceLevelsetEnum,0,DistanceToCalvingfrontEnum);
 
@@ -803,9 +803,9 @@
 			int      numnodes              = element->GetNumberOfNodes();
 			Gauss*   gauss                 = element->NewGauss();
-			Input*   crevassedepth_input   = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
-			Input*   bed_input             = element->GetInput(BedEnum); _assert_(bed_input);
-			Input*   surface_crevasse_input = element->GetInput(SurfaceCrevasseEnum); _assert_(surface_crevasse_input);
-			Input*   thickness_input       = element->GetInput(ThicknessEnum); _assert_(thickness_input);
-			Input*   surface_input         = element->GetInput(SurfaceEnum); _assert_(surface_input);
+			Input2*   crevassedepth_input   = element->GetInput2(CrevasseDepthEnum); _assert_(crevassedepth_input);
+			Input2*   bed_input             = element->GetInput2(BedEnum); _assert_(bed_input);
+			Input2*   surface_crevasse_input = element->GetInput2(SurfaceCrevasseEnum); _assert_(surface_crevasse_input);
+			Input2*   thickness_input       = element->GetInput2(ThicknessEnum); _assert_(thickness_input);
+			Input2*   surface_input         = element->GetInput2(SurfaceEnum); _assert_(surface_input);
 
 			/*First, look at ice front and figure out if any of the nodes will be calved*/
@@ -841,10 +841,10 @@
 				int      numnodes               = element->GetNumberOfNodes();
 				Gauss*   gauss                  = element->NewGauss();
-				Input*   levelset_input         = element->GetInput(DistanceToCalvingfrontEnum); _assert_(levelset_input);
-				Input*   crevassedepth_input    = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
-				Input*   bed_input              = element->GetInput(BedEnum); _assert_(bed_input);
-				Input*   surface_crevasse_input = element->GetInput(SurfaceCrevasseEnum); _assert_(surface_crevasse_input);
-				Input*   thickness_input        = element->GetInput(ThicknessEnum); _assert_(thickness_input);
-				Input*   surface_input          = element->GetInput(SurfaceEnum); _assert_(surface_input);
+				Input2*   levelset_input         = element->GetInput2(DistanceToCalvingfrontEnum); _assert_(levelset_input);
+				Input2*   crevassedepth_input    = element->GetInput2(CrevasseDepthEnum); _assert_(crevassedepth_input);
+				Input2*   bed_input              = element->GetInput2(BedEnum); _assert_(bed_input);
+				Input2*   surface_crevasse_input = element->GetInput2(SurfaceCrevasseEnum); _assert_(surface_crevasse_input);
+				Input2*   thickness_input        = element->GetInput2(ThicknessEnum); _assert_(thickness_input);
+				Input2*   surface_input          = element->GetInput2(SurfaceEnum); _assert_(surface_input);
 
 				/*Is this element connected to a node that should be calved*/
