Index: /issm/trunk/src/c/Bamgx/Bamgx.cpp
===================================================================
--- /issm/trunk/src/c/Bamgx/Bamgx.cpp	(revision 2933)
+++ /issm/trunk/src/c/Bamgx/Bamgx.cpp	(revision 2934)
@@ -140,4 +140,12 @@
 			Metric Mhmax(hmax);
 			for (Int4 iv=0;iv<BTh.nbv;iv++) BTh[iv].m = Mhmax;
+			// change using hVertices if required
+			if (bamgmesh->hVertices){
+				for (i=0;i<BTh.nbv;i++){
+					if (!isnan(bamgmesh->hVertices[i])){
+						BTh[i].m=Metric((Real4)bamgmesh->hVertices[i]);
+					}
+				}
+			}
 
 			//use present fields to generate metric if present
Index: /issm/trunk/src/c/Bamgx/objects/Triangles.cpp
===================================================================
--- /issm/trunk/src/c/Bamgx/objects/Triangles.cpp	(revision 2933)
+++ /issm/trunk/src/c/Bamgx/objects/Triangles.cpp	(revision 2934)
@@ -869,6 +869,4 @@
 			MatVVP2x2 Vp(vertices[i]);
 			double lmax=Vp.lmax();
-			h1 =Min(h1,Vp.lmin());
-			h2 =Max(h2,Vp.lmax());
 			Vp*=Min(lminaniso,lmax)/lmax;
 			Vp.BoundAniso2(coef);
@@ -877,4 +875,6 @@
 			//info to be displayed
 			if (verbosity>2){
+				h1 =Min(h1,Vp.lmin());
+				h2 =Max(h2,Vp.lmax());
 				hn1=Min(hn1,Vp.lmin());
 				hn2=Max(hn2,Vp.lmax());
@@ -907,5 +907,5 @@
 		Real8 hmax1;
 		Real8 coef;
-		Real8 anisomax=1e30;
+		Real8 anisomax;
 		Real8 CutOff;
 		int NbJacobi;
@@ -924,4 +924,5 @@
 		Rescaling=bamgopts->Rescaling; //do normalization
 		power=bamgopts->power;
+		anisomax=bamgopts->anisomax;
 
 		/*process options*/
@@ -1331,5 +1332,5 @@
 		Real8 hmax1;
 		Real8 coef;
-		Real8 anisomax=1e30;
+		Real8 anisomax;
 		Real8 CutOff;
 		int NbJacobi;
@@ -1348,4 +1349,5 @@
 		Rescaling=bamgopts->Rescaling; //do normalization
 		power=bamgopts->power;
+		anisomax=bamgopts->anisomax;
 
 		/*process options*/
@@ -1823,11 +1825,21 @@
 		const int dim = 2;
 		double* s=NULL;
-		Int4 nbsol;
-		int* typsols=NULL;
-		int verbosity;
-		Real8 hmin1;
-		Real8 hmax1;
+		Int4   nbsol;
+		int*   typsols=NULL;
+		int    verbosity;
+		Real8  hmin1;
+		Real8  hmax1;
+		double power;
+		double anisomax;
+
 		int   i,j,k,iA,iB,iC;
 		int   iv,nbfield;
+		double coef;
+
+		/*Recover options*/
+		verbosity=bamgopts->verbose;
+		power=bamgopts->power;
+		hmin1=bamgopts->hmin;
+		hmax1=bamgopts->hmax;
 
 		/*Recover options*/
@@ -1835,9 +1847,5 @@
 		hmin1=bamgopts->hmin;
 		hmax1=bamgopts->hmax;
-
-		/*Recover options*/
-		verbosity=bamgopts->verbose;
-		hmin1=bamgopts->hmin;
-		hmax1=bamgopts->hmax;
+		anisomax=bamgopts->anisomax;
 
 		/*Get and process fields*/
@@ -2024,7 +2032,13 @@
 					Vp.Abs();
 
+					//Apply a power if requested by user
+					if(power!=1.0) Vp.pow(power);
+
 					//modify eigen values according to hmin and hmax
 					Vp.Maxh(hmax);
 					Vp.Minh(hmin);
+
+					//Bound anisotropy by 1/(anisomax)^2
+					Vp.BoundAniso2(1/(anisomax*anisomax));
 
 					//rebuild Metric from Vp
Index: /issm/trunk/src/c/objects/BamgOpts.h
===================================================================
--- /issm/trunk/src/c/objects/BamgOpts.h	(revision 2933)
+++ /issm/trunk/src/c/objects/BamgOpts.h	(revision 2934)
@@ -13,4 +13,5 @@
 	int     Hessiantype;
 	double  power;
+	double  anisomax;
 	int     NbSmooth;
 	int     Rescaling;
Index: /issm/trunk/src/m/classes/public/bamg.m
===================================================================
--- /issm/trunk/src/m/classes/public/bamg.m	(revision 2933)
+++ /issm/trunk/src/m/classes/public/bamg.m	(revision 2934)
@@ -91,4 +91,5 @@
 bamg_options.hmin=getfieldvalue(options,'hmin',10^-100);
 bamg_options.hmax=getfieldvalue(options,'hmax',10^100);
+bamg_options.anisomax=getfieldvalue(options,'anisomax',10^30);
 bamg_options.gradation=getfieldvalue(options,'gradation',1.5);
 bamg_options.cutoff=getfieldvalue(options,'cutoff',10^-5);
Index: /issm/trunk/src/mex/Bamg/Bamg.cpp
===================================================================
--- /issm/trunk/src/mex/Bamg/Bamg.cpp	(revision 2933)
+++ /issm/trunk/src/mex/Bamg/Bamg.cpp	(revision 2934)
@@ -33,5 +33,5 @@
 	/*Options inputs*/
 	int    iso,maxnbv,verbose,splitcorners;
-	double hmin,hmax;
+	double hmin,hmax,anisomax;
 	double err,errg,coef;
 	double power;
@@ -135,4 +135,6 @@
 	FetchData(&hmax,mxGetField(BAMGOPTIONS,0,"hmax"));
 	bamgopts.hmax=hmax;
+	FetchData(&anisomax,mxGetField(BAMGOPTIONS,0,"anisomax"));
+	bamgopts.anisomax=anisomax;
 	FetchData(&gradation,mxGetField(BAMGOPTIONS,0,"gradation"));
 	bamgopts.gradation=gradation;
