Index: /issm/trunk/src/c/Bamgx/Bamgx.cpp
===================================================================
--- /issm/trunk/src/c/Bamgx/Bamgx.cpp	(revision 2913)
+++ /issm/trunk/src/c/Bamgx/Bamgx.cpp	(revision 2914)
@@ -37,8 +37,6 @@
 	double hmin,hmax;
 	double err,errg,coef;
-	double cutoff;
 	int    verbosity;
-	int    Hessiantype,NbSmooth;
-	double power;
+	int    NbSmooth;
 	double omega;
 
@@ -46,5 +44,5 @@
 	int noerr=1;
 	int i,j,num;
-	int AbsError=0,nbjacoby=1,allquad=0;
+	int allquad=0;
 	double costheta=2;
 	double anisomax = 1e6;
@@ -53,5 +51,4 @@
 	const double  boundmaxsubdiv = 10;
 	double  maxsubdiv=boundmaxsubdiv;
-	int Rescaling=1;
 
 	Triangles* Thr=NULL;
@@ -62,6 +59,4 @@
 	err=bamgopts->err;
 	errg=bamgopts->errg;
-	Hessiantype=bamgopts->Hessiantype;
-	power=bamgopts->power;
 	NbSmooth=bamgopts->NbSmooth;
 	omega=bamgopts->omega;
@@ -70,5 +65,4 @@
 	hmin=bamgopts->hmin;
 	hmax=bamgopts->hmax;
-	cutoff=bamgopts->cutoff;
 	verbosity=bamgopts->verbose;
 
@@ -150,5 +144,5 @@
 			if (bamgopts->field){
 				if (verbosity>1) printf("   Generating Metric from solution field...\n");
-				BTh.IntersectConsMetric(bamgopts->field,1,0,hmin,hmax,sqrt(err)*coef,1e30,AbsError?0.0:cutoff,nbjacoby,Rescaling,power,Hessiantype);
+				BTh.IntersectConsMetric(bamgopts);
 			}
 		}
Index: /issm/trunk/src/c/Bamgx/Mesh2.h
===================================================================
--- /issm/trunk/src/c/Bamgx/Mesh2.h	(revision 2913)
+++ /issm/trunk/src/c/Bamgx/Mesh2.h	(revision 2914)
@@ -794,10 +794,5 @@
 						 void ReadMetric(BamgOpts* bamgopts,const Real8 hmin,const Real8 hmax,const Real8 coef);
 						 void WriteMetric(BamgOpts* bamgopts);
-						 void IntersectConsMetric(const double * s,const Int4 nbsol,const int * typsols,
-									 const  Real8 hmin,const Real8 hmax, const Real8 coef,
-									 const Real8  anisomax,const Real8 CutOff=1.e-4,const int NbJacobi=1,
-									 const int DoNormalisation=1,
-									 const double power=1.0,
-									 const int choise=0);
+						 void IntersectConsMetric(BamgOpts* bamgopts);
 						 void IntersectGeomMetric(const Real8 err,const int iso);
 
Index: /issm/trunk/src/c/Bamgx/objects/Triangles.cpp
===================================================================
--- /issm/trunk/src/c/Bamgx/objects/Triangles.cpp	(revision 2913)
+++ /issm/trunk/src/c/Bamgx/objects/Triangles.cpp	(revision 2914)
@@ -2728,8 +2728,9 @@
 	/*}}}1*/
 /*FUNCTION Triangles::IntersectConsMetric{{{1*/
-void Triangles::IntersectConsMetric(const double* s,const Int4 nbsol,const int * typsols,
-			const  Real8 hmin1,const Real8 hmax1,const Real8 coef,
-			const Real8 anisomax ,const Real8 CutOff,const int NbJacobi,
-			const int DoNormalisation,const double power,const int choice){
+void Triangles::IntersectConsMetric(BamgOpts* bamgopts){
+	   /*const double* s,const Int4 nbsol,const int * typsols,
+		 *      const  Real8 hmin1,const Real8 hmax1,const Real8 coef,
+		 *           const Real8 anisomax ,const Real8 CutOff,const int NbJacobi,
+		 *                const int Rescaling,const double power,const int Hessiantype)*/
 	//  the array of solution s is store    
 	// sol0,sol1,...,soln    on vertex 0
@@ -2739,6 +2740,39 @@
 	//  otherwise  =>  H is computed from P2 on 4T 
 
+	/*Options*/
 	const int dim = 2;
-	long int verbosity=0;
+	int AbsError;
+	double* s;
+	Int4 nbsol;
+	int * typsols;
+	Real8 hmin1;
+	Real8 hmax1;
+	Real8 coef;
+	Real8 anisomax=1e30;
+	Real8 CutOff;
+	int NbJacobi;
+	int Rescaling;
+	double power;
+	int Hessiantype;
+	int verbosity;
+
+	/*Recover options*/
+	verbosity=bamgopts->verbose;
+	s=bamgopts->field;
+	nbsol=1;   //for now, only one field
+	typsols=0; // only one dof per node
+	AbsError=bamgopts->AbsError;   
+	CutOff=bamgopts->cutoff;
+	hmin1=bamgopts->hmin;
+	hmax1=bamgopts->hmax;
+	coef=bamgopts->coef;
+	NbJacobi=bamgopts->nbjacobi;
+	Rescaling=bamgopts->Rescaling; //do normalization
+	power=bamgopts->power;
+	Hessiantype=bamgopts->Hessiantype;
+
+	/*process options*/
+	if (AbsError) CutOff=0.0;
+	coef=sqrt(bamgopts->err)*coef;
 
 	int sizeoftype[] = { 1, dim ,dim * (dim+1) / 2, dim * dim } ; 
@@ -2823,5 +2857,5 @@
 		 Mmass[iC] += dett;
 
-		 if((nbb==0)|| !choice){
+		 if((nbb==0)|| !Hessiantype){
 			 Mmassxx[iA] += dett;
 			 Mmassxx[iB] += dett;
@@ -2859,5 +2893,5 @@
 		Real8 sdelta = smax-smin;
 		Real8 absmax=Max(Abs(smin),Abs(smax));
-		Real8 cnorm = DoNormalisation ? coef2/sdelta : coef2;
+		Real8 cnorm = Rescaling ? coef2/sdelta : coef2;
 
 		if(verbosity>2) printf("      Solution %i, Min = %g, Max = %g, Delta = %g, cnorm = %g, number of fields = %i\n",nusol,smin,smax,sdelta,cnorm,nbfield);
@@ -2905,5 +2939,5 @@
 
 				 R2 Grads = (nAB * sC + nBC * sA + nCA * sB ) /detT[i] ;
-				 if(choice){
+				 if(Hessiantype){
 					 int nbb = 0;
 					 Real8 dd = detT[i];
Index: /issm/trunk/src/c/objects/BamgOpts.h
===================================================================
--- /issm/trunk/src/c/objects/BamgOpts.h	(revision 2913)
+++ /issm/trunk/src/c/objects/BamgOpts.h	(revision 2914)
@@ -14,4 +14,7 @@
 	double  power;
 	int     NbSmooth;
+	int     Rescaling;
+	int     nbjacobi;
+	int     AbsError;
 	double  omega;
 	double  hmin;
Index: /issm/trunk/src/m/classes/public/bamg.m
===================================================================
--- /issm/trunk/src/m/classes/public/bamg.m	(revision 2913)
+++ /issm/trunk/src/m/classes/public/bamg.m	(revision 2914)
@@ -81,4 +81,7 @@
 bamg_options.coef=getfieldvalue(options,'coef',1);
 bamg_options.power=getfieldvalue(options,'power',1);
+bamg_options.Rescaling=getfieldvalue(options,'Rescaling',1);
+bamg_options.nbjacobi=getfieldvalue(options,'nbjacobi',1);
+bamg_options.AbsError=getfieldvalue(options,'AbsError',0);
 bamg_options.Hessiantype=getfieldvalue(options,'Hessiantype',0);
 bamg_options.NbSmooth=getfieldvalue(options,'NbSmooth',3);
Index: /issm/trunk/src/mex/Bamg/Bamg.cpp
===================================================================
--- /issm/trunk/src/mex/Bamg/Bamg.cpp	(revision 2913)
+++ /issm/trunk/src/mex/Bamg/Bamg.cpp	(revision 2914)
@@ -37,4 +37,5 @@
 	double power;
 	int    Hessiantype,NbSmooth;
+	int    Rescaling,nbjacobi,AbsError;
 	double omega;
 	double gradation;
@@ -118,4 +119,10 @@
 	FetchData(&power,mxGetField(BAMGOPTIONS,0,"power"));
 	bamgopts.power=power;
+	FetchData(&Rescaling,mxGetField(BAMGOPTIONS,0,"Rescaling"));
+	bamgopts.Rescaling=Rescaling;
+	FetchData(&nbjacobi,mxGetField(BAMGOPTIONS,0,"nbjacobi"));
+	bamgopts.nbjacobi=nbjacobi;
+	FetchData(&AbsError,mxGetField(BAMGOPTIONS,0,"AbsError"));
+	bamgopts.AbsError=AbsError;
 	FetchData(&NbSmooth,mxGetField(BAMGOPTIONS,0,"NbSmooth"));
 	bamgopts.NbSmooth=NbSmooth;
