Index: issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.cpp
===================================================================
--- issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 24686)
+++ issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 25836)
@@ -4,5 +4,5 @@
 #include "../shared/shared.h"
 #include "../modules/modules.h"
-#include "../classes/Inputs2/DatasetInput2.h"
+#include "../classes/Inputs/DatasetInput.h"
 
 /*Model processor*/
@@ -19,5 +19,5 @@
 	return 1;
 }/*}}}*/
-void AdjointBalancethicknessAnalysis::UpdateElements(Elements* elements,Inputs2* inputs2,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+void AdjointBalancethicknessAnalysis::UpdateElements(Elements* elements,Inputs* inputs,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
 	_error_("not implemented yet");
 }/*}}}*/
@@ -86,14 +86,13 @@
 	basalelement->FindParam(&num_responses,InversionNumCostFunctionsEnum);
 	basalelement->FindParam(&responses,NULL,InversionCostFunctionsEnum);
-	Input2* thickness_input    = basalelement->GetInput2(ThicknessEnum);                          _assert_(thickness_input);
-	Input2* thicknessobs_input = basalelement->GetInput2(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
-	DatasetInput2* weights_input      = basalelement->GetDatasetInput2(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
-	Input2* vx_input           = basalelement->GetInput2(VxEnum);                                 _assert_(vx_input);
-	Input2* vy_input           = basalelement->GetInput2(VyEnum);                                 _assert_(vy_input);
+	Input* thickness_input    = basalelement->GetInput(ThicknessEnum);                          _assert_(thickness_input);
+	Input* thicknessobs_input = basalelement->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
+	DatasetInput* weights_input      = basalelement->GetDatasetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+	Input* vx_input           = basalelement->GetInput(VxEnum);                                 _assert_(vx_input);
+	Input* vy_input           = basalelement->GetInput(VyEnum);                                 _assert_(vy_input);
 
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=basalelement->NewGauss(2);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
@@ -156,5 +155,5 @@
 	_error_("not implemented yet");
 }/*}}}*/
-void           AdjointBalancethicknessAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+void           AdjointBalancethicknessAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element*  element,int control_type,int control_interp,int control_index){/*{{{*/
 	/*The gradient of the cost function is calculated in 2 parts.
 	 *
@@ -194,8 +193,8 @@
 	/*Deal with second term*/
 	switch(control_type){
-		case BalancethicknessSpcthicknessEnum:   GradientJDirichlet(element,gradient,control_index); break;
-		case BalancethicknessThickeningRateEnum: GradientJDhDt(element,gradient,control_index); break;
-		case VxEnum:                             GradientJVx(  element,gradient,control_index); break;
-		case VyEnum:                             GradientJVy(  element,gradient,control_index); break;
+		case BalancethicknessSpcthicknessEnum:   GradientJDirichlet(element,gradient,control_interp,control_index); break;
+		case BalancethicknessThickeningRateEnum: GradientJDhDt(element,gradient,control_interp,control_index); break;
+		case VxEnum:                             GradientJVx(  element,gradient,control_interp,control_index); break;
+		case VyEnum:                             GradientJVy(  element,gradient,control_interp,control_index); break;
 		default: _error_("control type not supported yet: " << EnumToStringx(control_type));
 	}
@@ -205,5 +204,5 @@
 
 }/*}}}*/
-void           AdjointBalancethicknessAnalysis::GradientJDirichlet(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+void           AdjointBalancethicknessAnalysis::GradientJDirichlet(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
 
 	/*Fetch number of vertices for this finite element*/
@@ -242,5 +241,5 @@
 	delete Ke;
 }/*}}}*/
-void           AdjointBalancethicknessAnalysis::GradientJDhDt(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+void           AdjointBalancethicknessAnalysis::GradientJDhDt(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
 
 	/*Fetch number of vertices for this finite element*/
@@ -266,5 +265,5 @@
 	xDelete<int>(vertexpidlist);
 }/*}}}*/
-void           AdjointBalancethicknessAnalysis::GradientJVx(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+void           AdjointBalancethicknessAnalysis::GradientJVx(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
 
 	/*Intermediaries*/
@@ -283,11 +282,10 @@
 	element->GetVerticesCoordinates(&xyz_list);
 	element->GradientIndexing(&vertexpidlist[0],control_index);
-	Input2* thickness_input = element->GetInput2(ThicknessEnum); _assert_(thickness_input);
-	Input2* adjoint_input   = element->GetInput2(AdjointEnum);   _assert_(adjoint_input);
+	Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* adjoint_input   = element->GetInput(AdjointEnum);   _assert_(adjoint_input);
 
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(4);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		adjoint_input->GetInputDerivativeValue(&Dlambda[0],xyz_list,gauss);
@@ -313,5 +311,5 @@
 	delete gauss;
 }/*}}}*/
-void           AdjointBalancethicknessAnalysis::GradientJVy(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+void           AdjointBalancethicknessAnalysis::GradientJVy(Element* element,Vector<IssmDouble>* gradient,int control_interp,int control_index){/*{{{*/
 
 	/*Intermediaries*/
@@ -330,11 +328,10 @@
 	element->GetVerticesCoordinates(&xyz_list);
 	element->GradientIndexing(&vertexpidlist[0],control_index);
-	Input2* thickness_input = element->GetInput2(ThicknessEnum); _assert_(thickness_input);
-	Input2* adjoint_input   = element->GetInput2(AdjointEnum);   _assert_(adjoint_input);
+	Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* adjoint_input   = element->GetInput(AdjointEnum);   _assert_(adjoint_input);
 
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=element->NewGauss(4);
-	for(int ig=gauss->begin();ig<gauss->end();ig++){
-		gauss->GaussPoint(ig);
+	while(gauss->next()){
 
 		adjoint_input->GetInputDerivativeValue(&Dlambda[0],xyz_list,gauss);
