Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 5145)
+++ /issm/trunk/src/c/Makefile.am	(revision 5146)
@@ -63,6 +63,6 @@
 					./objects/Bamg/SubDomain.h\
 					./objects/Bamg/SubDomain.cpp\
-					./objects/Bamg/TriangleAdjacent.h\
-					./objects/Bamg/TriangleAdjacent.cpp\
+					./objects/Bamg/AdjacentTriangle.h\
+					./objects/Bamg/AdjacentTriangle.cpp\
 					./objects/Bamg/Triangle.cpp\
 					./objects/Bamg/Triangle.h\
@@ -599,6 +599,6 @@
 					./objects/Bamg/SubDomain.h\
 					./objects/Bamg/SubDomain.cpp\
-					./objects/Bamg/TriangleAdjacent.h\
-					./objects/Bamg/TriangleAdjacent.cpp\
+					./objects/Bamg/AdjacentTriangle.h\
+					./objects/Bamg/AdjacentTriangle.cpp\
 					./objects/Bamg/Triangle.cpp\
 					./objects/Bamg/Triangle.h\
Index: /issm/trunk/src/c/modules/Bamgx/Bamgx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Bamgx/Bamgx.cpp	(revision 5145)
+++ /issm/trunk/src/c/modules/Bamgx/Bamgx.cpp	(revision 5146)
@@ -184,6 +184,6 @@
 		//display info
 		if(verbosity>0) {
-			if (Th.nbt-Th.NbOutT-Th.NbOfQuad*2){
-				printf("   new number of triangles = %i\n",(Th.nbt-Th.NbOutT-Th.NbOfQuad*2));
+			if (Th.nbt-Th.nbtout-Th.NbOfQuad*2){
+				printf("   new number of triangles = %i\n",(Th.nbt-Th.nbtout-Th.NbOfQuad*2));
 			}
 			if (Th.NbOfQuad ){
Index: /issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
===================================================================
--- /issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 5145)
+++ /issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp	(revision 5146)
@@ -103,5 +103,5 @@
 			else {
 				//Get closest adjacent triangle (inside the mesh)
-				TriangleAdjacent ta=CloseBoundaryEdge(I,&tb,aa,bb).Adj();
+				AdjacentTriangle ta=CloseBoundaryEdge(I,&tb,aa,bb).Adj();
 				int k=ta;
 				Triangle &tc=*(Triangle*)ta;
Index: /issm/trunk/src/c/objects/Bamg/GeometricalEdge.h
===================================================================
--- /issm/trunk/src/c/objects/Bamg/GeometricalEdge.h	(revision 5145)
+++ /issm/trunk/src/c/objects/Bamg/GeometricalEdge.h	(revision 5146)
@@ -19,5 +19,5 @@
 			GeometricalEdge   *Adj[2];
 			int                DirAdj[2];
-			int                flag;
+			int                type;
 
 			//Operators
@@ -30,15 +30,15 @@
 			double R1tg(double theta,R2 &t) const ; // 1/radius of curvature + tangente
 			int    Tg(int i) const{return i==0 ? TgA() : TgB();}
-			int    Cracked() const{return flag & 1;}
-			int    TgA()const{return flag & 4; }
-			int    TgB()const {return flag & 8;}
-			int    Mark()const {return flag & 16;}
-			int    Required() {return flag & 64;}
-			void   SetCracked()     { flag |= 1;}
-			void   SetTgA()         { flag |=4; }
-			void   SetTgB()         { flag |=8; }
-			void   SetMark()        { flag |=16;}
-			void   SetUnMark()      { flag &= 1007 /* 1023-16*/;}
-			void   SetRequired()    { flag |= 64; }
+			int    Cracked() const{return type & 1;}
+			int    TgA()const{return type & 4; }
+			int    TgB()const {return type & 8;}
+			int    Mark()const {return type & 16;}
+			int    Required() {return type & 64;}
+			void   SetCracked()     { type |= 1;}
+			void   SetTgA()         { type |=4; }
+			void   SetTgB()         { type |=8; }
+			void   SetMark()        { type |=16;}
+			void   SetUnMark()      { type &= 1007 /* 1023-16*/;}
+			void   SetRequired()    { type |= 64; }
 			void   Set(const GeometricalEdge & rec,const Geometry & Th ,Geometry & ThNew);
 	};
Index: /issm/trunk/src/c/objects/Bamg/Geometry.cpp
===================================================================
--- /issm/trunk/src/c/objects/Bamg/Geometry.cpp	(revision 5145)
+++ /issm/trunk/src/c/objects/Bamg/Geometry.cpp	(revision 5146)
@@ -152,5 +152,5 @@
 				edges[i].DirAdj[0] = edges[i].DirAdj[1] = -1;
 				edges[i].Adj[0] = edges[i].Adj[1] = NULL;
-				edges[i].flag = 0;
+				edges[i].type = 0;
 
 				//Cracked?
@@ -586,5 +586,5 @@
 				}
 				// if the ref a changing then is     SetRequired();
-				if (edges[i1].flag != edges[i2].flag || edges[i1].Required()){
+				if (edges[i1].type != edges[i2].type || edges[i1].Required()){
 					vertices[i].SetRequired();
 				}
Index: /issm/trunk/src/c/objects/Bamg/Mesh.cpp
===================================================================
--- /issm/trunk/src/c/objects/Bamg/Mesh.cpp	(revision 5145)
+++ /issm/trunk/src/c/objects/Bamg/Mesh.cpp	(revision 5146)
@@ -165,10 +165,9 @@
 		  Init(maxnbv_in);// to make the allocation 
 		  // copy of triangles
-		  nt=Th.nt;
 		  nbv = Th.nbv;
 		  nbt = Th.nbt;
 		  nbe = Th.nbe;
 		  NbSubDomains = Th.NbSubDomains;
-		  NbOutT = Th.NbOutT;
+		  nbtout = Th.nbtout;
 		  NbOfQuad =  Th.NbOfQuad ;
 		  NbOfSwapTriangle =0;
@@ -284,9 +283,9 @@
 			vertices[i].color=0;
 		}
-		nbtx=2*maxnbv-2; // for filling The Holes and quadrilaterals 
+		maxnbt=2*maxnbv-2; // for filling The Holes and quadrilaterals 
 
 		//Triangles
 		if (verbose) printf("Reading triangles (%i)\n",nbt);
-		triangles =new Triangle[nbtx]; //we cannot allocate only nbt triangles since 
+		triangles =new Triangle[maxnbt]; //we cannot allocate only nbt triangles since 
 		//other triangles will be added for each edge
 		for (i=0;i<nbt;i++){
@@ -336,5 +335,5 @@
 				vertices[i].color=0;
 			}
-			nbtx=2*maxnbv-2; // for filling The Holes and quadrilaterals 
+			maxnbt=2*maxnbv-2; // for filling The Holes and quadrilaterals 
 		}
 		else{
@@ -345,5 +344,5 @@
 		if(bamgmesh->Triangles){
 			if(verbose>5) printf("      processing Triangles\n");
-			triangles =new Triangle[nbtx]; //we cannot allocate only nbt triangles since 
+			triangles =new Triangle[maxnbt]; //we cannot allocate only nbt triangles since 
 			//other triangles will be added for each edge
 			for (i=0;i<nbt;i++){
@@ -825,8 +824,8 @@
 		/*Element Connectivity*/
 		if(verbose>5) printf("      writing Element connectivity\n");
-		bamgmesh->ElementConnectivitySize[0]=nbt-NbOutT;
+		bamgmesh->ElementConnectivitySize[0]=nbt-nbtout;
 		bamgmesh->ElementConnectivitySize[1]=3;
-		bamgmesh->ElementConnectivity=(double*)xmalloc(3*(nbt-NbOutT)*sizeof(double));
-		for (i=0;i<3*(nbt-NbOutT);i++) bamgmesh->ElementConnectivity[i]=NAN;
+		bamgmesh->ElementConnectivity=(double*)xmalloc(3*(nbt-nbtout)*sizeof(double));
+		for (i=0;i<3*(nbt-nbtout);i++) bamgmesh->ElementConnectivity[i]=NAN;
 		num=0;
 		for (i=0;i<nbt;i++){
@@ -835,5 +834,5 @@
 					k=Number(triangles[i].TriangleAdj(j));
 					if (reft[k]>=0){
-						ISSMASSERT(3*num+j<3*(nbt-NbOutT));
+						ISSMASSERT(3*num+j<3*(nbt-nbtout));
 						bamgmesh->ElementConnectivity[3*num+j]=k+1; // back to Matlab indexing
 					}
@@ -1167,5 +1166,5 @@
 		tt[2]= &triangles[nbt++];
 
-		if (nbt>nbtx) {
+		if (nbt>maxnbt) {
 			ISSMERROR("Not ebough triangles");
 		}
@@ -1628,5 +1627,5 @@
 			Gh.edges[i].v[1] = Gh.vertices +  j1;
 
-			Gh.edges[i].flag = 0;
+			Gh.edges[i].type = 0;
 
 			Gh.edges[i].tg[0]=R2();
@@ -2433,5 +2432,5 @@
 		// supression de tous les sous domaine infini <=>  contient le sommet NULL
 		it =0;
-		NbOutT = 0;
+		nbtout = 0;
 		while (it<nbt) {
 			if (triangles[it].link) 
@@ -2442,7 +2441,7 @@
 					NbSubDomTot --;
 					t=&triangles[it];
-					NbOutT--;  // on fait un coup de trop. 
+					nbtout--;  // on fait un coup de trop. 
 					while  (t){
-						NbOutT++;
+						nbtout++;
 						t1=t;
 						t=t->link;
@@ -2452,5 +2451,5 @@
 			  }   
 			it++;} // end while (it<nbt)
-			if (nbt == NbOutT ||  !NbSubDomTot) {
+			if (nbt == nbtout ||  !NbSubDomTot) {
 				ISSMERROR("The boundary is not close: all triangles are outside");
 			}
@@ -2525,5 +2524,5 @@
 								 t= subdomains[i].head;
 								 while (t){
-									 NbOutT++;
+									 nbtout++;
 									 t1=t;
 									 t=t->link;
@@ -2622,12 +2621,12 @@
 					for (it=0;it<nbt;it++)
 					 if ( mark[it] ==-1 ) 
-					  NbOutT++,triangles[it].link =0;
+					  nbtout++,triangles[it].link =0;
 					delete [] GeometricalEdgetoEdge;
 					delete [] mark;
 
 			  }
-			NbOutT=0;
+			nbtout=0;
 			for (it=0;it<nbt;it++) 
-			 if(!triangles[it].link)  NbOutT++;
+			 if(!triangles[it].link)  nbtout++;
 	}
 	/*}}}1*/
@@ -2646,5 +2645,5 @@
 		nbt=0;
 		NbOfQuad = 0;
-		nbtx=2*maxnbv_in-2;
+		maxnbt=2*maxnbv_in-2;
 		NbSubDomains=0;
 		NbVertexOnBThVertex=0;
@@ -2664,5 +2663,5 @@
 			ordre=new (BamgVertex* [maxnbv]);
 			ISSMASSERT(ordre);
-			triangles=new Triangle[nbtx];
+			triangles=new Triangle[maxnbt];
 			ISSMASSERT(triangles);
 		}
@@ -2671,5 +2670,5 @@
 			ordre=NULL;
 			triangles=NULL;
-			nbtx=0;
+			maxnbt=0;
 		} 
 
@@ -2993,6 +2992,6 @@
 			if (verbose>2){
 				printf("   number of quadrilaterals    = %i\n",NbOfQuad);
-				printf("   number of triangles         = %i\n",nbt-NbOutT- NbOfQuad*2);
-				printf("   number of outside triangles = %i\n",NbOutT);
+				printf("   number of triangles         = %i\n",nbt-nbtout- NbOfQuad*2);
+				printf("   number of outside triangles = %i\n",nbtout);
 			}
 			delete [] qq;
@@ -3099,5 +3098,5 @@
 		long Headt=0;
 		long next_t;
-		long* first_np_or_next_t=new long[nbtx];
+		long* first_np_or_next_t=new long[maxnbt];
 		Triangle* t=NULL;
 
@@ -3458,5 +3457,5 @@
 	Triangle* savetriangles=triangles;
 	long savenbt=nbt;
-	long savenbtx=nbtx;
+	long savemaxnbt=maxnbt;
 	SubDomain* savesubdomains=subdomains;
 	subdomains=0;
@@ -3467,5 +3466,5 @@
 
 	nbt=2;
-	nbtx= Nbtriafillhole;
+	maxnbt= Nbtriafillhole;
 
 	//Find a vertex that is not aligned with vertices 0 and 1
@@ -3571,5 +3570,5 @@
 		}
 	}
-	ISSMASSERT(savenbt+NbTfillHoll<=savenbtx);
+	ISSMASSERT(savenbt+NbTfillHoll<=savemaxnbt);
 
 	// copy of the outside triangles in saveMesh 
@@ -3601,5 +3600,5 @@
 	// restore triangles;
 	nbt=savenbt;
-	nbtx=savenbtx;
+	maxnbt=savemaxnbt;
 	delete [] triangles;
 	delete [] subdomains;
@@ -3711,5 +3710,4 @@
 			}
 		delete [] renu;
-		nt = nbt - NbOutT;
 
 	}
@@ -3870,7 +3868,5 @@
 	int nt=0;
 	for (int it=0;it<nbt;it++)
-	 if ( triangles[it].link) 
-		{
-		 nt++;
+	 if ( triangles[it].link){
 		 Triangle &K=triangles[it];
 		 double  area3= Area2((R2) K[0],(R2) K[1],(R2) K[2])/6.;
@@ -4113,9 +4109,9 @@
 		long nbvold = nbv;
 		long nbtold = nbt;
-		long NbOutTold  = NbOutT;
+		long nbtoutold  = nbtout;
 		long  NbEdgeOnGeom=0;
 		long i;
 
-		nbt = nbt - NbOutT; // remove all the  the ouside triangles 
+		nbt = nbt - nbtout; // remove all the  the ouside triangles 
 		long nbtsave = nbt;
 		Triangle * lastT = triangles + nbt;
@@ -4535,5 +4531,5 @@
 
 		ret = 2;
-		if (nbt>= nbtx) goto Error; // bug 
+		if (nbt>= maxnbt) goto Error; // bug 
 		if (nbv>= maxnbv) goto Error; // bug 
 		// generation of the new triangles 
@@ -4571,6 +4567,6 @@
 		if (verbose>2){
 			printf("   number of quadrilaterals    = %i\n",NbOfQuad);
-			printf("   number of triangles         = %i\n",nbt-NbOutT- NbOfQuad*2);
-			printf("   number of outside triangles = %i\n",NbOutT);
+			printf("   number of triangles         = %i\n",nbt-nbtout- NbOfQuad*2);
+			printf("   number of outside triangles = %i\n",nbtout);
 		}
 
@@ -4580,5 +4576,5 @@
 		nbv = nbvold;
 		nbt = nbtold;
-		NbOutT = NbOutTold;
+		nbtout = nbtoutold;
 		// cleaning memory ---
 		delete newedges;
Index: /issm/trunk/src/c/objects/Bamg/Mesh.h
===================================================================
--- /issm/trunk/src/c/objects/Bamg/Mesh.h	(revision 5145)
+++ /issm/trunk/src/c/objects/Bamg/Mesh.h	(revision 5146)
@@ -34,9 +34,9 @@
 			SubDomain                    *subdomains;
 			long                          NbRef;                 // counter of ref on the this class if 0 we can delete
-			long                          maxnbv,nbtx;           // nombre max de sommets , de triangles
-			long                          nt,nbv,nbt,nbe;        // nb of legal triangles, nb of vertex, of triangles, of edges with reference,
+			long                          maxnbv,maxnbt;           // nombre max de sommets , de triangles
+			long                          nbv,nbt,nbe;           // nb of vertices, of triangles, of edges 
 			long                          NbOfQuad;              // nb of quadrangle
 			long                          NbSubDomains;
-			long                          NbOutT;                // Nb of oudeside triangle
+			long                          nbtout;                // Nb of oudeside triangle
 			long                          NbOfTriangleSearchFind;
 			long                          NbOfSwapTriangle;
