Index: issm/trunk/src/c/objects/Bamg/BamgMesh.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/BamgMesh.cpp	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/BamgMesh.cpp	(revision 5573)
@@ -17,7 +17,7 @@
 	this->CrackedEdgesSize[0]=0,              this->CrackedEdgesSize[1]=0;             this->CrackedEdges=NULL;
 
-	this->VerticesOnGeometricVertexSize[0]=0, this->VerticesOnGeometricVertexSize[1]=0;this->VerticesOnGeometricVertex=NULL;
-	this->VerticesOnGeometricEdgeSize[0]=0,   this->VerticesOnGeometricEdgeSize[1]=0;  this->VerticesOnGeometricEdge=NULL;
-	this->EdgesOnGeometricEdgeSize[0]=0,      this->EdgesOnGeometricEdgeSize[1]=0;     this->EdgesOnGeometricEdge=NULL;
+	this->VerticesOnGeomVertexSize[0]=0, this->VerticesOnGeomVertexSize[1]=0;this->VerticesOnGeomVertex=NULL;
+	this->VerticesOnGeomEdgeSize[0]=0,   this->VerticesOnGeomEdgeSize[1]=0;  this->VerticesOnGeomEdge=NULL;
+	this->EdgesOnGeomEdgeSize[0]=0,      this->EdgesOnGeomEdgeSize[1]=0;     this->EdgesOnGeomEdge=NULL;
 
 	this->IssmEdgesSize[0]=0,                 this->IssmEdgesSize[1]=0;                this->IssmEdges=NULL;
@@ -47,7 +47,7 @@
 	FetchData(&this->CrackedEdges,            &this->CrackedEdgesSize[0],              &this->CrackedEdgesSize[1],             mxGetField(matlab_struct,0,"CrackedEdges"));
 
-	FetchData(&this->VerticesOnGeometricEdge,  &this->VerticesOnGeometricEdgeSize[0],  &this->VerticesOnGeometricEdgeSize[1],  mxGetField(matlab_struct,0,"VerticesOnGeometricEdge"));
-	FetchData(&this->VerticesOnGeometricVertex,&this->VerticesOnGeometricVertexSize[0],&this->VerticesOnGeometricVertexSize[1],mxGetField(matlab_struct,0,"VerticesOnGeometricVertex"));
-	FetchData(&this->EdgesOnGeometricEdge,     &this->EdgesOnGeometricEdgeSize[0],     &this->EdgesOnGeometricEdgeSize[1],     mxGetField(matlab_struct,0,"EdgesOnGeometricEdge"));
+	FetchData(&this->VerticesOnGeomEdge,  &this->VerticesOnGeomEdgeSize[0],  &this->VerticesOnGeomEdgeSize[1],  mxGetField(matlab_struct,0,"VerticesOnGeomEdge"));
+	FetchData(&this->VerticesOnGeomVertex,&this->VerticesOnGeomVertexSize[0],&this->VerticesOnGeomVertexSize[1],mxGetField(matlab_struct,0,"VerticesOnGeomVertex"));
+	FetchData(&this->EdgesOnGeomEdge,     &this->EdgesOnGeomEdgeSize[0],     &this->EdgesOnGeomEdgeSize[1],     mxGetField(matlab_struct,0,"EdgesOnGeomEdge"));
 
 	this->IssmEdgesSize[0]=0,                 this->IssmEdgesSize[1]=0;                this->IssmEdges=NULL;
@@ -74,7 +74,7 @@
 	xfree((void**)&this->CrackedEdges);
 
-	xfree((void**)&this->VerticesOnGeometricVertex);
-	xfree((void**)&this->VerticesOnGeometricEdge);
-	xfree((void**)&this->EdgesOnGeometricEdge);
+	xfree((void**)&this->VerticesOnGeomVertex);
+	xfree((void**)&this->VerticesOnGeomEdge);
+	xfree((void**)&this->EdgesOnGeomEdge);
 
 	xfree((void**)&this->IssmEdges);
@@ -110,7 +110,7 @@
 	fnames[i++] = "IssmEdges";
 	fnames[i++] = "Quadrilaterals";
-	fnames[i++] = "VerticesOnGeometricVertex";
-	fnames[i++] = "VerticesOnGeometricEdge";
-	fnames[i++] = "EdgesOnGeometricEdge";
+	fnames[i++] = "VerticesOnGeomVertex";
+	fnames[i++] = "VerticesOnGeomEdge";
+	fnames[i++] = "EdgesOnGeomEdge";
 	fnames[i++] = "SubDomains";
 	fnames[i++] = "SubDomainsFromGeom";
@@ -133,7 +133,7 @@
 	i++; SetMatlabStructureField(output,"IssmEdges",                this->IssmEdgesSize[0],                this->IssmEdgesSize[1],                 this->IssmEdges);
 	i++; SetMatlabStructureField(output,"Quadrilaterals",           this->QuadrilateralsSize[0],           this->QuadrilateralsSize[1],            this->Quadrilaterals);
-	i++; SetMatlabStructureField(output,"VerticesOnGeometricVertex",this->VerticesOnGeometricVertexSize[0],this->VerticesOnGeometricVertexSize[1], this->VerticesOnGeometricVertex);
-	i++; SetMatlabStructureField(output,"VerticesOnGeometricEdge",  this->VerticesOnGeometricEdgeSize[0],  this->VerticesOnGeometricEdgeSize[1],   this->VerticesOnGeometricEdge);
-	i++; SetMatlabStructureField(output,"EdgesOnGeometricEdge",     this->EdgesOnGeometricEdgeSize[0],     this->EdgesOnGeometricEdgeSize[1],      this->EdgesOnGeometricEdge);
+	i++; SetMatlabStructureField(output,"VerticesOnGeomVertex",this->VerticesOnGeomVertexSize[0],this->VerticesOnGeomVertexSize[1], this->VerticesOnGeomVertex);
+	i++; SetMatlabStructureField(output,"VerticesOnGeomEdge",  this->VerticesOnGeomEdgeSize[0],  this->VerticesOnGeomEdgeSize[1],   this->VerticesOnGeomEdge);
+	i++; SetMatlabStructureField(output,"EdgesOnGeomEdge",     this->EdgesOnGeomEdgeSize[0],     this->EdgesOnGeomEdgeSize[1],      this->EdgesOnGeomEdge);
 	i++; SetMatlabStructureField(output,"SubDomains",               this->SubDomainsSize[0],               this->SubDomainsSize[1],                this->SubDomains);
 	i++; SetMatlabStructureField(output,"SubDomainsFromGeom",       this->SubDomainsFromGeomSize[0],       this->SubDomainsFromGeomSize[1],        this->SubDomainsFromGeom);
Index: issm/trunk/src/c/objects/Bamg/BamgMesh.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/BamgMesh.h	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/BamgMesh.h	(revision 5573)
@@ -22,10 +22,10 @@
 		double* Quadrilaterals;
 
-		int     VerticesOnGeometricVertexSize[2];
-		double* VerticesOnGeometricVertex;
-		int     VerticesOnGeometricEdgeSize[2];
-		double* VerticesOnGeometricEdge;
-		int     EdgesOnGeometricEdgeSize[2];
-		double* EdgesOnGeometricEdge;
+		int     VerticesOnGeomVertexSize[2];
+		double* VerticesOnGeomVertex;
+		int     VerticesOnGeomEdgeSize[2];
+		double* VerticesOnGeomEdge;
+		int     EdgesOnGeomEdgeSize[2];
+		double* EdgesOnGeomEdge;
 
 		int     SubDomainsSize[2];
Index: issm/trunk/src/c/objects/Bamg/BamgVertex.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/BamgVertex.h	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/BamgVertex.h	(revision 5573)
@@ -31,5 +31,5 @@
 				long          color;
 				BamgVertex   *MeshVertexHook;         // used in geometry BamgVertex to know the Mesh Vertex associated
-				VertexOnGeom *GeometricalEdgeHook;    // if IndexInTriangle == 8; // set with Mesh::SetVertexFieldOn()
+				VertexOnGeom *GeomEdgeHook;    // if IndexInTriangle == 8; // set with Mesh::SetVertexFieldOn()
 				BamgVertex   *BackgroundVertexHook;   // if IndexInTriangle == 16 on Background vertex Mesh::SetVertexFieldOnBTh()
 				VertexOnEdge *BackgroundEdgeHook;     // if IndexInTriangle == 32 on Background edge
Index: issm/trunk/src/c/objects/Bamg/CrackedEdge.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/CrackedEdge.h	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/CrackedEdge.h	(revision 5573)
@@ -8,5 +8,5 @@
 	//classes
 	class Triangle;
-	class GeometricalEdge;
+	class GeomEdge;
 	class Edge;
 
@@ -16,5 +16,5 @@
 			Triangle* a;
 			Triangle* b; 
-			GeometricalEdge* E;
+			GeomEdge* E;
 			Edge* e1;
 			Edge* e2;
Index: issm/trunk/src/c/objects/Bamg/Curve.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/Curve.h	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/Curve.h	(revision 5573)
@@ -7,5 +7,5 @@
 
 	//classes
-	class GeometricalEdge;
+	class GeomEdge;
 	class Curve;
 	class Geometry;
@@ -13,6 +13,6 @@
 	class Curve {
 		public:
-			GeometricalEdge *FirstEdge; //First edge of the curve
-			GeometricalEdge *LastEdge;  //Last edge of the curve
+			GeomEdge *FirstEdge; //First edge of the curve
+			GeomEdge *LastEdge;  //Last edge of the curve
 			int FirstVertexIndex;       //Last vertex index in the last edge
 			int LastVertexIndex;        //First Vertex index in the first edge
Index: issm/trunk/src/c/objects/Bamg/Edge.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/Edge.cpp	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/Edge.cpp	(revision 5573)
@@ -18,6 +18,6 @@
 		v[0] = ThNew.vertices + Th.GetId(v[0]);    
 		v[1] = ThNew.vertices + Th.GetId(v[1]);
-		if (GeometricalEdgeHook) 
-		 GeometricalEdgeHook =  ThNew.Gh.edges+Th.Gh.GetId(GeometricalEdgeHook);
+		if (GeomEdgeHook) 
+		 GeomEdgeHook =  ThNew.Gh.edges+Th.Gh.GetId(GeomEdgeHook);
 		if (adj[0]) adj[0] =   ThNew.edges +   Th.GetId(adj[0]);
 		if (adj[1]) adj[1] =   ThNew.edges +   Th.GetId(adj[1]);
@@ -29,5 +29,5 @@
 		printf("   pointers towards two vertices: %p %p\n",v[0],v[1]);
 		printf("   ReferenceNumber = %i\n",ReferenceNumber);
-		printf("   GeometricalEdgeHook = %p\n",GeometricalEdgeHook);
+		printf("   GeomEdgeHook = %p\n",GeomEdgeHook);
 		printf("   two adjacent edges on the same curve: %p %p\n",adj[0],adj[1]);
 	}
Index: issm/trunk/src/c/objects/Bamg/Edge.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/Edge.h	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/Edge.h	(revision 5573)
@@ -6,5 +6,5 @@
 #include "../../include/include.h"
 #include "../../shared/Exceptions/exceptions.h"
-#include "./GeometricalEdge.h"
+#include "./GeomEdge.h"
 
 namespace bamg {
@@ -18,5 +18,5 @@
 			BamgVertex      *v[2];
 			long             ReferenceNumber;
-			GeometricalEdge *GeometricalEdgeHook;
+			GeomEdge *GeomEdgeHook;
 			Edge            *adj[2];       // the 2 adj edges if on the same curve
 
Index: issm/trunk/src/c/objects/Bamg/GeomEdge.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeomEdge.cpp	(revision 5573)
+++ issm/trunk/src/c/objects/Bamg/GeomEdge.cpp	(revision 5573)
@@ -0,0 +1,190 @@
+#include <cstdio>
+#include <string.h>
+#include <cmath>
+
+#include "../../include/include.h"
+#include "../../shared/Exceptions/exceptions.h"
+
+#include "GeomEdge.h"
+#include "Geometry.h"
+
+using namespace std;
+
+namespace bamg {
+
+	/*Constructor/Destructor*/
+
+	/*Methods*/
+	/*FUNCTION GeomEdge::Cracked{{{1*/
+	int    GeomEdge::Cracked() const  {
+		return type &1;  
+	}/*}}}*/
+	/*FUNCTION GeomEdge::F{{{1*/
+	R2 GeomEdge::F(double theta) const{
+		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/F)*/
+		// parametrization of the curve edge
+
+	   R2 A=v[0]->r,B=v[1]->r;
+		double ca,cb,cta,ctb;
+
+		//Check that theta is in [0 1]
+		ISSMASSERT(theta>-1e-12 && theta<1+1e-12);
+
+		if (TgA()){ 
+			if (TgB()){ //Hermite interpolation
+				cb =  theta*theta*(3-2*theta);
+				ca =  1-cb;     
+				cta = (1-theta)*(1-theta)*theta;
+				ctb = (theta-1)*theta*theta ;
+			}
+			else {
+				double t = theta;
+				cb = t*t;
+				ca = 1-cb;
+				cta= t-cb;
+				ctb=0;    
+			}
+		}
+		else{
+			if (TgB()){
+				double t = 1-theta;
+				ca = t*t;
+				cb = 1-ca;
+				ctb= -t+ca;
+				cta=0;    
+			}
+			else { // lagrange P1
+				ca =(1-theta);
+				cb = theta;
+				cta=ctb=0;
+			}
+		}
+		return A*ca + B*cb + tg[0]*cta + tg[1]*ctb;
+	  }
+	/*}}}1*/
+	/*FUNCTION GeomEdge::Mark{{{1*/
+	int    GeomEdge::Mark()    const  {
+		return type &16; 
+	}/*}}}*/
+	/*FUNCTION GeomEdge::R1tg{{{1*/
+	double GeomEdge::R1tg(double theta,R2 & t) const{
+		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/R1tg)*/
+		// 1/R of radius of cuvature
+
+		R2 A=v[0]->r,B=v[1]->r;
+		double dca,dcb,dcta,dctb;
+		double ddca,ddcb,ddcta,ddctb;
+		double tt = theta*theta;
+
+		//check theta
+		ISSMASSERT(theta>=0 && theta<=1);
+
+		if (TgA()){ 
+			if (TgB()){
+				// Tangent A and B provided:
+				// interpolation d'hermite
+				dcb = 6*theta*(1-theta);
+				ddcb = 6*(1-2*theta);
+				dca = -dcb;
+				ddca = -ddcb;
+				dcta =  (3*theta - 4)*theta + 1;
+				ddcta=6*theta-4;
+				dctb = 3*tt - 2*theta;
+				ddctb = 6*theta-2;
+			}
+			else {
+				//Tangent A provided but tangent B not provided
+				// 1-t*t, t-t*t, t*t
+				double t = theta;
+				dcb = 2*t;
+				ddcb = 2;
+				dca = -dcb;
+				ddca = -2;
+				dcta = 1-dcb;
+				ddcta = -ddcb;
+				dctb=0;    
+				ddctb=0;    
+			}
+		}
+		else{
+			if (TgB()){
+				//Tangent B provided but tangent A not provided
+				double t = 1-theta;
+				dca = -2*t;
+				ddca = 2;
+				dcb = -dca;
+				ddcb = -2;
+				dctb = 1+dca;
+				ddctb= ddca;
+				dcta =0;
+				ddcta =0;
+			}
+			else {
+				//Neither thangent A nor tangent B provided
+				// lagrange P1
+				t=B-A;
+				return 0;
+			} 
+		}
+		R2 d  =  A*dca  + B*dcb  + tg[0]* dcta  + tg[1] * dctb;
+		R2 dd =  A*ddca + B*ddcb + tg[0]* ddcta + tg[1] * ddctb;
+		double d2=(d,d);
+		double sd2 = sqrt(d2);
+		t=d;
+		if(d2>1.0e-20){
+			t/=sd2;
+			return Abs(Det(d,dd))/(d2*sd2);
+		}
+		else return 0;
+	}
+	/*}}}1*/
+	/*FUNCTION GeomEdge::Required{{{1*/
+	int    GeomEdge::Required()       {
+		return type &64; 
+	}/*}}}*/
+	/*FUNCTION GeomEdge::Set {{{1*/
+	void GeomEdge::Set(const GeomEdge & rec,const Geometry & Gh ,Geometry & GhNew){ 
+		*this = rec;
+		v[0] = GhNew.vertices + Gh.GetId(v[0]);    
+		v[1] = GhNew.vertices + Gh.GetId(v[1]); 
+		if (Adj[0]) Adj[0] =  GhNew.edges + Gh.GetId(Adj[0]);     
+		if (Adj[1]) Adj[1] =  GhNew.edges + Gh.GetId(Adj[1]);     
+	}
+	/*}}}*/
+	/*FUNCTION GeomEdge::SetCracked{{{1*/
+	void   GeomEdge::SetCracked()     { 
+		type |= 1;/*=>1st digit to 1*/
+	}/*}}}*/
+	/*FUNCTION GeomEdge::SetTgA{{{1*/
+	void   GeomEdge::SetTgA()         { 
+		type |=4; /*=>2d digit to 1*/
+	}/*}}}*/
+	/*FUNCTION GeomEdge::SetTgB{{{1*/
+	void   GeomEdge::SetTgB()         { 
+		type |=8; /*=> 3d digit to 1*/
+	}/*}}}*/
+	/*FUNCTION GeomEdge::SetMark{{{1*/
+	void   GeomEdge::SetMark()        { 
+		type |=16;/*=> 4th digiy to 1*/
+	}/*}}}*/
+	/*FUNCTION GeomEdge::SetUnMark{{{1*/
+	void   GeomEdge::SetUnMark()      { 
+		type &= 1007 /* 1023-16 = 000111110111 => 4th digit to 0*/;
+	}/*}}}*/
+	/*FUNCTION GeomEdge::SetRequired{{{1*/
+	void   GeomEdge::SetRequired()    { 
+		type |= 64;/*=>6th digit to 1*/ 
+	}/*}}}*/
+	  /*FUNCTION GeomEdge::Tg{{{1*/
+	int    GeomEdge::Tg(int i) const  {
+		return i==0 ? TgA() : TgB();
+	}/*}}}*/
+	/*FUNCTION GeomEdge::TgA{{{1*/
+	int    GeomEdge::TgA()     const  {
+		return type &4;  
+	}/*}}}*/
+	/*FUNCTION GeomEdge::TgB{{{1*/
+	int    GeomEdge::TgB()     const  {
+		return type &8;  
+	}/*}}}*/
+}
Index: issm/trunk/src/c/objects/Bamg/GeomEdge.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeomEdge.h	(revision 5573)
+++ issm/trunk/src/c/objects/Bamg/GeomEdge.h	(revision 5573)
@@ -0,0 +1,47 @@
+#ifndef _GEOMETRICALEDGE_H_
+#define _GEOMETRICALEDGE_H_
+
+#include "./include.h"
+
+namespace bamg {
+
+	//classes
+	class GeomVertex;
+	class Geometry;
+
+	class GeomEdge {
+
+		public:
+			GeomVertex *v[2];
+			long               ReferenceNumber;
+			long               CurveNumber;
+			R2                 tg[2];              // the 2 tangentes (tg[0] =0 => no continuity)
+			GeomEdge   *Adj[2];
+			int                AdjVertexIndex[2]; // for a given vertex, this gives the index of the vertex in the adjacent edge (0 or 1)
+			int                type;
+
+			//Operators
+			GeomVertex       & operator[](int i){return *v[i];};
+			const GeomVertex & operator[](int i) const { return *v[i];};
+			GeomVertex       * operator()(int i){return v[i];};  
+
+			//Methods
+			R2     F(double theta) const ; // parametrization of the curve edge
+			double R1tg(double theta,R2 &t) const ; // 1/radius of curvature + tangente
+			int    Tg(int i) const;
+			int    Cracked() const;
+			int    TgA()     const;
+			int    TgB()     const;
+			int    Mark()    const;
+			int    Required();
+			void   SetCracked();
+			void   SetTgA();
+			void   SetTgB();
+			void   SetMark();
+			void   SetUnMark();
+			void   SetRequired();
+			void   Set(const GeomEdge & rec,const Geometry & Th ,Geometry & ThNew);
+	};
+
+}
+#endif
Index: issm/trunk/src/c/objects/Bamg/GeomSubDomain.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeomSubDomain.cpp	(revision 5573)
+++ issm/trunk/src/c/objects/Bamg/GeomSubDomain.cpp	(revision 5573)
@@ -0,0 +1,20 @@
+#include <cstdio>
+#include <cstring>
+#include <cmath>
+#include <ctime>
+
+#include "GeomSubDomain.h"
+#include "Geometry.h"
+
+namespace bamg {
+
+	/*Constructors/Destructors*/
+
+	/*Methods*/
+	/*FUNCTION GeomSubDomain::Set {{{1*/
+	void GeomSubDomain::Set(const GeomSubDomain & rec,const Geometry & Gh ,const Geometry & GhNew){
+		*this = rec;
+		edge = Gh.GetId(edge) + GhNew.edges;
+	}/*}}}*/
+
+} 
Index: issm/trunk/src/c/objects/Bamg/GeomSubDomain.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeomSubDomain.h	(revision 5573)
+++ issm/trunk/src/c/objects/Bamg/GeomSubDomain.h	(revision 5573)
@@ -0,0 +1,23 @@
+#ifndef _GEOMETRICALSUBDOMAIN_H_
+#define _GEOMETRICALSUBDOMAIN_H_
+
+#include "./include.h"
+
+namespace bamg {
+
+	//classes
+	class GeomEdge;
+	class Geometry;
+
+	class GeomSubDomain {
+		public:
+			GeomEdge *edge;
+			int              direction;   // -1 or 1
+			long             ReferenceNumber;
+
+			//Methods
+			void Set(const GeomSubDomain &,const Geometry & ,const Geometry &);
+	};
+
+}
+#endif
Index: issm/trunk/src/c/objects/Bamg/GeomVertex.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeomVertex.cpp	(revision 5573)
+++ issm/trunk/src/c/objects/Bamg/GeomVertex.cpp	(revision 5573)
@@ -0,0 +1,38 @@
+#include <cstdio>
+#include <cstring>
+#include <cmath>
+#include <ctime>
+
+#include "GeomVertex.h"
+#include "../../include/include.h"
+#include "../../shared/Exceptions/exceptions.h"
+
+namespace bamg {
+
+	/*Constructors/Destructors*/
+	//See header file
+
+	/*Methods*/
+	/*FUNCTION GeomVertex::Corner {{{1*/
+	int  GeomVertex::Corner() const {
+		return type & 4;
+	}
+	/*}}}*/
+	/*FUNCTION GeomVertex::Required {{{1*/
+	int  GeomVertex::Required()const {
+		// a corner is required
+		return type & 6;
+	}
+	/*}}}*/
+	/*FUNCTION GeomVertex::SetCorner {{{1*/
+	void GeomVertex::SetCorner(){
+		type |= 4;
+	}
+	/*}}}*/
+	/*FUNCTION GeomVertex::SetRequired {{{1*/
+	void GeomVertex::SetRequired(){
+		type |= 2;
+	}
+	/*}}}*/
+
+} 
Index: issm/trunk/src/c/objects/Bamg/GeomVertex.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeomVertex.h	(revision 5573)
+++ issm/trunk/src/c/objects/Bamg/GeomVertex.h	(revision 5573)
@@ -0,0 +1,30 @@
+#ifndef _GEOMETRICALVERTEX_H_
+#define _GEOMETRICALVERTEX_H_
+
+#include "./include.h"
+#include "BamgVertex.h"
+
+namespace bamg {
+
+	class Geometry;
+
+	class GeomVertex : public BamgVertex { 
+
+		public:
+			friend class Geometry;
+
+			int type;
+
+			//Constructors
+			GeomVertex():type(0){};
+
+			//Methods
+			int  Corner() const;
+			int  Required()const;
+			void SetCorner();
+			void SetRequired();
+
+	};
+
+}
+#endif
Index: issm/trunk/src/c/objects/Bamg/GeometricalEdge.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeometricalEdge.cpp	(revision 5572)
+++ 	(revision )
@@ -1,190 +1,0 @@
-#include <cstdio>
-#include <string.h>
-#include <cmath>
-
-#include "../../include/include.h"
-#include "../../shared/Exceptions/exceptions.h"
-
-#include "GeometricalEdge.h"
-#include "Geometry.h"
-
-using namespace std;
-
-namespace bamg {
-
-	/*Constructor/Destructor*/
-
-	/*Methods*/
-	/*FUNCTION GeometricalEdge::Cracked{{{1*/
-	int    GeometricalEdge::Cracked() const  {
-		return type &1;  
-	}/*}}}*/
-	/*FUNCTION GeometricalEdge::F{{{1*/
-	R2 GeometricalEdge::F(double theta) const{
-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/F)*/
-		// parametrization of the curve edge
-
-	   R2 A=v[0]->r,B=v[1]->r;
-		double ca,cb,cta,ctb;
-
-		//Check that theta is in [0 1]
-		ISSMASSERT(theta>-1e-12 && theta<1+1e-12);
-
-		if (TgA()){ 
-			if (TgB()){ //Hermite interpolation
-				cb =  theta*theta*(3-2*theta);
-				ca =  1-cb;     
-				cta = (1-theta)*(1-theta)*theta;
-				ctb = (theta-1)*theta*theta ;
-			}
-			else {
-				double t = theta;
-				cb = t*t;
-				ca = 1-cb;
-				cta= t-cb;
-				ctb=0;    
-			}
-		}
-		else{
-			if (TgB()){
-				double t = 1-theta;
-				ca = t*t;
-				cb = 1-ca;
-				ctb= -t+ca;
-				cta=0;    
-			}
-			else { // lagrange P1
-				ca =(1-theta);
-				cb = theta;
-				cta=ctb=0;
-			}
-		}
-		return A*ca + B*cb + tg[0]*cta + tg[1]*ctb;
-	  }
-	/*}}}1*/
-	/*FUNCTION GeometricalEdge::Mark{{{1*/
-	int    GeometricalEdge::Mark()    const  {
-		return type &16; 
-	}/*}}}*/
-	/*FUNCTION GeometricalEdge::R1tg{{{1*/
-	double GeometricalEdge::R1tg(double theta,R2 & t) const{
-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/R1tg)*/
-		// 1/R of radius of cuvature
-
-		R2 A=v[0]->r,B=v[1]->r;
-		double dca,dcb,dcta,dctb;
-		double ddca,ddcb,ddcta,ddctb;
-		double tt = theta*theta;
-
-		//check theta
-		ISSMASSERT(theta>=0 && theta<=1);
-
-		if (TgA()){ 
-			if (TgB()){
-				// Tangent A and B provided:
-				// interpolation d'hermite
-				dcb = 6*theta*(1-theta);
-				ddcb = 6*(1-2*theta);
-				dca = -dcb;
-				ddca = -ddcb;
-				dcta =  (3*theta - 4)*theta + 1;
-				ddcta=6*theta-4;
-				dctb = 3*tt - 2*theta;
-				ddctb = 6*theta-2;
-			}
-			else {
-				//Tangent A provided but tangent B not provided
-				// 1-t*t, t-t*t, t*t
-				double t = theta;
-				dcb = 2*t;
-				ddcb = 2;
-				dca = -dcb;
-				ddca = -2;
-				dcta = 1-dcb;
-				ddcta = -ddcb;
-				dctb=0;    
-				ddctb=0;    
-			}
-		}
-		else{
-			if (TgB()){
-				//Tangent B provided but tangent A not provided
-				double t = 1-theta;
-				dca = -2*t;
-				ddca = 2;
-				dcb = -dca;
-				ddcb = -2;
-				dctb = 1+dca;
-				ddctb= ddca;
-				dcta =0;
-				ddcta =0;
-			}
-			else {
-				//Neither thangent A nor tangent B provided
-				// lagrange P1
-				t=B-A;
-				return 0;
-			} 
-		}
-		R2 d  =  A*dca  + B*dcb  + tg[0]* dcta  + tg[1] * dctb;
-		R2 dd =  A*ddca + B*ddcb + tg[0]* ddcta + tg[1] * ddctb;
-		double d2=(d,d);
-		double sd2 = sqrt(d2);
-		t=d;
-		if(d2>1.0e-20){
-			t/=sd2;
-			return Abs(Det(d,dd))/(d2*sd2);
-		}
-		else return 0;
-	}
-	/*}}}1*/
-	/*FUNCTION GeometricalEdge::Required{{{1*/
-	int    GeometricalEdge::Required()       {
-		return type &64; 
-	}/*}}}*/
-	/*FUNCTION GeometricalEdge::Set {{{1*/
-	void GeometricalEdge::Set(const GeometricalEdge & rec,const Geometry & Gh ,Geometry & GhNew){ 
-		*this = rec;
-		v[0] = GhNew.vertices + Gh.GetId(v[0]);    
-		v[1] = GhNew.vertices + Gh.GetId(v[1]); 
-		if (Adj[0]) Adj[0] =  GhNew.edges + Gh.GetId(Adj[0]);     
-		if (Adj[1]) Adj[1] =  GhNew.edges + Gh.GetId(Adj[1]);     
-	}
-	/*}}}*/
-	/*FUNCTION GeometricalEdge::SetCracked{{{1*/
-	void   GeometricalEdge::SetCracked()     { 
-		type |= 1;/*=>1st digit to 1*/
-	}/*}}}*/
-	/*FUNCTION GeometricalEdge::SetTgA{{{1*/
-	void   GeometricalEdge::SetTgA()         { 
-		type |=4; /*=>2d digit to 1*/
-	}/*}}}*/
-	/*FUNCTION GeometricalEdge::SetTgB{{{1*/
-	void   GeometricalEdge::SetTgB()         { 
-		type |=8; /*=> 3d digit to 1*/
-	}/*}}}*/
-	/*FUNCTION GeometricalEdge::SetMark{{{1*/
-	void   GeometricalEdge::SetMark()        { 
-		type |=16;/*=> 4th digiy to 1*/
-	}/*}}}*/
-	/*FUNCTION GeometricalEdge::SetUnMark{{{1*/
-	void   GeometricalEdge::SetUnMark()      { 
-		type &= 1007 /* 1023-16 = 000111110111 => 4th digit to 0*/;
-	}/*}}}*/
-	/*FUNCTION GeometricalEdge::SetRequired{{{1*/
-	void   GeometricalEdge::SetRequired()    { 
-		type |= 64;/*=>6th digit to 1*/ 
-	}/*}}}*/
-	  /*FUNCTION GeometricalEdge::Tg{{{1*/
-	int    GeometricalEdge::Tg(int i) const  {
-		return i==0 ? TgA() : TgB();
-	}/*}}}*/
-	/*FUNCTION GeometricalEdge::TgA{{{1*/
-	int    GeometricalEdge::TgA()     const  {
-		return type &4;  
-	}/*}}}*/
-	/*FUNCTION GeometricalEdge::TgB{{{1*/
-	int    GeometricalEdge::TgB()     const  {
-		return type &8;  
-	}/*}}}*/
-}
Index: issm/trunk/src/c/objects/Bamg/GeometricalEdge.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeometricalEdge.h	(revision 5572)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#ifndef _GEOMETRICALEDGE_H_
-#define _GEOMETRICALEDGE_H_
-
-#include "./include.h"
-
-namespace bamg {
-
-	//classes
-	class GeometricalVertex;
-	class Geometry;
-
-	class GeometricalEdge {
-
-		public:
-			GeometricalVertex *v[2];
-			long               ReferenceNumber;
-			long               CurveNumber;
-			R2                 tg[2];              // the 2 tangentes (tg[0] =0 => no continuity)
-			GeometricalEdge   *Adj[2];
-			int                AdjVertexIndex[2]; // for a given vertex, this gives the index of the vertex in the adjacent edge (0 or 1)
-			int                type;
-
-			//Operators
-			GeometricalVertex       & operator[](int i){return *v[i];};
-			const GeometricalVertex & operator[](int i) const { return *v[i];};
-			GeometricalVertex       * operator()(int i){return v[i];};  
-
-			//Methods
-			R2     F(double theta) const ; // parametrization of the curve edge
-			double R1tg(double theta,R2 &t) const ; // 1/radius of curvature + tangente
-			int    Tg(int i) const;
-			int    Cracked() const;
-			int    TgA()     const;
-			int    TgB()     const;
-			int    Mark()    const;
-			int    Required();
-			void   SetCracked();
-			void   SetTgA();
-			void   SetTgB();
-			void   SetMark();
-			void   SetUnMark();
-			void   SetRequired();
-			void   Set(const GeometricalEdge & rec,const Geometry & Th ,Geometry & ThNew);
-	};
-
-}
-#endif
Index: issm/trunk/src/c/objects/Bamg/GeometricalSubDomain.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeometricalSubDomain.cpp	(revision 5572)
+++ 	(revision )
@@ -1,20 +1,0 @@
-#include <cstdio>
-#include <cstring>
-#include <cmath>
-#include <ctime>
-
-#include "GeometricalSubDomain.h"
-#include "Geometry.h"
-
-namespace bamg {
-
-	/*Constructors/Destructors*/
-
-	/*Methods*/
-	/*FUNCTION GeometricalSubDomain::Set {{{1*/
-	void GeometricalSubDomain::Set(const GeometricalSubDomain & rec,const Geometry & Gh ,const Geometry & GhNew){
-		*this = rec;
-		edge = Gh.GetId(edge) + GhNew.edges;
-	}/*}}}*/
-
-} 
Index: issm/trunk/src/c/objects/Bamg/GeometricalSubDomain.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeometricalSubDomain.h	(revision 5572)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#ifndef _GEOMETRICALSUBDOMAIN_H_
-#define _GEOMETRICALSUBDOMAIN_H_
-
-#include "./include.h"
-
-namespace bamg {
-
-	//classes
-	class GeometricalEdge;
-	class Geometry;
-
-	class GeometricalSubDomain {
-		public:
-			GeometricalEdge *edge;
-			int              direction;   // -1 or 1
-			long             ReferenceNumber;
-
-			//Methods
-			void Set(const GeometricalSubDomain &,const Geometry & ,const Geometry &);
-	};
-
-}
-#endif
Index: issm/trunk/src/c/objects/Bamg/GeometricalVertex.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeometricalVertex.cpp	(revision 5572)
+++ 	(revision )
@@ -1,38 +1,0 @@
-#include <cstdio>
-#include <cstring>
-#include <cmath>
-#include <ctime>
-
-#include "GeometricalVertex.h"
-#include "../../include/include.h"
-#include "../../shared/Exceptions/exceptions.h"
-
-namespace bamg {
-
-	/*Constructors/Destructors*/
-	//See header file
-
-	/*Methods*/
-	/*FUNCTION GeometricalVertex::Corner {{{1*/
-	int  GeometricalVertex::Corner() const {
-		return type & 4;
-	}
-	/*}}}*/
-	/*FUNCTION GeometricalVertex::Required {{{1*/
-	int  GeometricalVertex::Required()const {
-		// a corner is required
-		return type & 6;
-	}
-	/*}}}*/
-	/*FUNCTION GeometricalVertex::SetCorner {{{1*/
-	void GeometricalVertex::SetCorner(){
-		type |= 4;
-	}
-	/*}}}*/
-	/*FUNCTION GeometricalVertex::SetRequired {{{1*/
-	void GeometricalVertex::SetRequired(){
-		type |= 2;
-	}
-	/*}}}*/
-
-} 
Index: issm/trunk/src/c/objects/Bamg/GeometricalVertex.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/GeometricalVertex.h	(revision 5572)
+++ 	(revision )
@@ -1,30 +1,0 @@
-#ifndef _GEOMETRICALVERTEX_H_
-#define _GEOMETRICALVERTEX_H_
-
-#include "./include.h"
-#include "BamgVertex.h"
-
-namespace bamg {
-
-	class Geometry;
-
-	class GeometricalVertex : public BamgVertex { 
-
-		public:
-			friend class Geometry;
-
-			int type;
-
-			//Constructors
-			GeometricalVertex():type(0){};
-
-			//Methods
-			int  Corner() const;
-			int  Required()const;
-			void SetCorner();
-			void SetRequired();
-
-	};
-
-}
-#endif
Index: issm/trunk/src/c/objects/Bamg/Geometry.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/Geometry.cpp	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/Geometry.cpp	(revision 5573)
@@ -33,8 +33,8 @@
 		NbRef =0;
 		quadtree=0;
-		vertices = nbv ? new GeometricalVertex[nbv] : NULL;
-		edges = nbe ? new GeometricalEdge[nbe]:NULL;
+		vertices = nbv ? new GeomVertex[nbv] : NULL;
+		edges = nbe ? new GeomEdge[nbe]:NULL;
 		curves= nbcurves ? new Curve[nbcurves]:NULL;
-		subdomains = nbsubdomains ? new GeometricalSubDomain[nbsubdomains]:NULL;
+		subdomains = nbsubdomains ? new GeomSubDomain[nbsubdomains]:NULL;
 		for (i=0;i<nbe;i++)
 		 edges[i].Set(Gh.edges[i],Gh,*this);
@@ -83,5 +83,5 @@
 			if(verbose>5) printf("      processing Vertices\n");
 			if (bamggeom->VerticesSize[1]!=3) ISSMERROR("Vertices should have 3 columns");
-			vertices = new GeometricalVertex[nbv];
+			vertices = new GeomVertex[nbv];
 			for (i=0;i<nbv;i++) {
 				vertices[i].r.x=(double)bamggeom->Vertices[i*3+0];
@@ -128,5 +128,5 @@
 			if(verbose>5) printf("      processing Edges\n");
 			if (bamggeom->EdgesSize[1]!=3) ISSMERROR("Edges should have 3 columns");
-			edges = new GeometricalEdge[nbe];
+			edges = new GeomEdge[nbe];
 
 			//initialize verticeslength (sum of the lengths of the edges holding vertex)
@@ -265,5 +265,5 @@
 			if (bamggeom->SubDomainsSize[1]!=4) ISSMERROR("SubDomains should have 4 columns");
 			nbsubdomains=bamggeom->SubDomainsSize[0];
-			subdomains = new GeometricalSubDomain[nbsubdomains];
+			subdomains = new GeomSubDomain[nbsubdomains];
 			for (i=0;i<nbsubdomains;i++){
 				i0=(int)bamggeom->SubDomains[i*4+0];
@@ -449,18 +449,18 @@
 		return Max(pmax.x-pmin.x,pmax.y-pmin.y);
 	}/*}}}*/
-	/*FUNCTION Geometry::GetId(const GeometricalVertex &t){{{1*/
-	long Geometry::GetId(const GeometricalVertex & t) const  {
+	/*FUNCTION Geometry::GetId(const GeomVertex &t){{{1*/
+	long Geometry::GetId(const GeomVertex & t) const  {
 		return &t - vertices;
 	}/*}}}*/
-	/*FUNCTION Geometry::GetId(const GeometricalVertex * t){{{1*/
-	long Geometry::GetId(const GeometricalVertex * t) const  {
+	/*FUNCTION Geometry::GetId(const GeomVertex * t){{{1*/
+	long Geometry::GetId(const GeomVertex * t) const  {
 		return t - vertices;
 	}/*}}}*/
-	/*FUNCTION Geometry::GetId(const GeometricalEdge & t){{{1*/
-	long Geometry::GetId(const GeometricalEdge & t) const  {
+	/*FUNCTION Geometry::GetId(const GeomEdge & t){{{1*/
+	long Geometry::GetId(const GeomEdge & t) const  {
 		return &t - edges;
 	}/*}}}*/
-	/*FUNCTION Geometry::GetId(const GeometricalEdge * t){{{1*/
-	long Geometry::GetId(const GeometricalEdge * t) const  {
+	/*FUNCTION Geometry::GetId(const GeomEdge * t){{{1*/
+	long Geometry::GetId(const GeomEdge * t) const  {
 		return t - edges;
 	}/*}}}*/
@@ -470,8 +470,8 @@
 	}/*}}}*/
 	/*FUNCTION Geometry::Containing{{{1*/
-	GeometricalEdge* Geometry::Containing(const R2 P,  GeometricalEdge * start) const {
+	GeomEdge* Geometry::Containing(const R2 P,  GeomEdge * start) const {
 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Contening)*/
 
-		GeometricalEdge* on =start,* pon=0;
+		GeomEdge* on =start,* pon=0;
 		// walk with the cos on geometry
 		int counter=0;
@@ -507,5 +507,5 @@
 		QuadTree           quadtree; // build quadtree to find duplicates
 		BamgVertex        *v0       = vertices;
-		GeometricalVertex *v0g      = (GeometricalVertex*) (void*)v0;
+		GeomVertex *v0g      = (GeomVertex*) (void*)v0;
 
 		k=0;
@@ -755,5 +755,5 @@
 				for (i=0;i<nbe;i++){
 
-					GeometricalEdge & ei=edges[i];   
+					GeomEdge & ei=edges[i];   
 					for(j=0;j<2;j++){
 						/*If current edge ei is unmarked and (level=1 or vertex i is required (corner)):
@@ -761,6 +761,6 @@
 						if (!ei.Mark() && (level || ei[j].Required())) { 
 							int k0=j,k1;
-							GeometricalEdge   *e=&ei;
-							GeometricalVertex *a=(*e)(k0); // begin 
+							GeomEdge   *e=&ei;
+							GeomVertex *a=(*e)(k0); // begin 
 							if(curves){
 								curves[nbcurves].FirstEdge=e;
@@ -774,5 +774,5 @@
 								nb_marked_edges++;
 								e->CurveNumber=nbcurves;
-								GeometricalVertex *b=(*e)(k1);
+								GeomVertex *b=(*e)(k1);
 
 								//break if we have reached the other end of the curve
@@ -809,5 +809,5 @@
 	/*}}}1*/
 	/*FUNCTION Geometry::ProjectOnCurve {{{1*/
-	GeometricalEdge* Geometry::ProjectOnCurve(const Edge &e,double s,BamgVertex &V,VertexOnGeom &GV) const {
+	GeomEdge* Geometry::ProjectOnCurve(const Edge &e,double s,BamgVertex &V,VertexOnGeom &GV) const {
 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/ProjectOnCurve)*/
 		/*Add a vertex on an existing geometrical edge according to the metrics of the two vertices constituting the edge*/
@@ -819,9 +819,9 @@
 
 		s=save_s;
-		GeometricalEdge* on=e.GeometricalEdgeHook;
+		GeomEdge* on=e.GeomEdgeHook;
 		if (!on){
 			ISSMERROR("ProjectOnCurve error message: edge provided should be on geometry");
 		}
-		if (!e[0].GeometricalEdgeHook ||  !e[1].GeometricalEdgeHook){
+		if (!e[0].GeomEdgeHook ||  !e[1].GeomEdgeHook){
 			ISSMERROR("ProjectOnCurve error message: at least one of the vertex of the edge provided is not on geometry");
 		}
@@ -835,8 +835,8 @@
 
 		//Get geometrical vertices corresponding to v0 and v1
-		VertexOnGeom  vg0=*v0.GeometricalEdgeHook,  vg1=*v1.GeometricalEdgeHook;
+		VertexOnGeom  vg0=*v0.GeomEdgeHook,  vg1=*v1.GeomEdgeHook;
 
 		//build two pointers towrad current geometrical edge
-		GeometricalEdge *eg0=on, *eg1=on;
+		GeomEdge *eg0=on, *eg1=on;
 
 		//Get edge direction and swap v0 and v1 if necessary
@@ -850,12 +850,12 @@
 
 		const int mxe=100;
-		GeometricalEdge* ge[mxe+1];
+		GeomEdge* ge[mxe+1];
 		int     directionge[mxe+1];
 		double  lge[mxe+1];
 		int bge=mxe/2,tge=bge;
-		ge[bge] = e.GeometricalEdgeHook;
+		ge[bge] = e.GeomEdgeHook;
 		directionge[bge]=1;
 
-		while (eg0!=(GeometricalEdge*)vg0 && (*eg0)(direction0)!=(GeometricalVertex*)vg0){ 
+		while (eg0!=(GeomEdge*)vg0 && (*eg0)(direction0)!=(GeomVertex*)vg0){ 
 			if (bge<=0) {
 				if(NbTry) {
@@ -870,10 +870,10 @@
 				goto retry;
 			}
-			GeometricalEdge* tmpge = eg0;
+			GeomEdge* tmpge = eg0;
 			ge[--bge] =eg0 = eg0->Adj[direction0];
 			ISSMASSERT(bge>=0 && bge<=mxe);
 			direction0 = 1-( directionge[bge] = tmpge->AdjVertexIndex[direction0]);
 		}
-		while (eg1 != (GeometricalEdge*) vg1  &&  (*eg1)(direction1) != (GeometricalVertex*) vg1) { 
+		while (eg1 != (GeomEdge*) vg1  &&  (*eg1)(direction1) != (GeomVertex*) vg1) { 
 			if(tge>=mxe ) { 
 				printf("WARNING: on the class Mesh before call Geometry::ProjectOnCurve is having issues (isn't it Eric?)\n");
@@ -887,5 +887,5 @@
 				ISSMERROR("see above");
 			}
-			GeometricalEdge* tmpge = eg1;
+			GeomEdge* tmpge = eg1;
 			ge[++tge] =eg1 = eg1->Adj[direction1];
 			directionge[tge]= direction1 = 1-tmpge->AdjVertexIndex[direction1];
@@ -894,8 +894,8 @@
 
 
-		if ((*eg0)(direction0)==(GeometricalVertex*)vg0)
+		if ((*eg0)(direction0)==(GeomVertex*)vg0)
 		 vg0=VertexOnGeom(*(BamgVertex*) vg0,*eg0,direction0); //vg0 = absisce
 
-		if ((*eg1)(direction1)==(GeometricalVertex*)vg1)
+		if ((*eg1)(direction1)==(GeomVertex*)vg1)
 		 vg1=VertexOnGeom(*(BamgVertex*) vg1,*eg1,direction1);
 
Index: issm/trunk/src/c/objects/Bamg/Geometry.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/Geometry.h	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/Geometry.h	(revision 5573)
@@ -5,6 +5,6 @@
 #include "./BamgGeom.h"
 #include "./BamgOpts.h"
-#include "./GeometricalVertex.h"
-#include "./GeometricalEdge.h"
+#include "./GeomVertex.h"
+#include "./GeomEdge.h"
 #include "./Curve.h"
 
@@ -13,5 +13,5 @@
 	class Triangle;
 	class QuadTree;
-	class GeometricalSubDomain;
+	class GeomSubDomain;
 	class Edge;
 
@@ -25,8 +25,8 @@
 			long                  nbsubdomains;
 			long                  nbcurves;
-			GeometricalVertex    *vertices;
-			GeometricalEdge      *edges;
+			GeomVertex    *vertices;
+			GeomEdge      *edges;
 			QuadTree             *quadtree;
-			GeometricalSubDomain *subdomains;
+			GeomSubDomain *subdomains;
 			Curve                *curves;
 			R2                    pmin,pmax;                     // domain extrema coordinates
@@ -41,8 +41,8 @@
 
 			//Operators
-			const GeometricalVertex &operator[](long i) const { return vertices[i]; };
-			GeometricalVertex       &operator[](long i) { return vertices[i];       };
-			const GeometricalEdge   &operator()(long i) const { return edges[i];    };
-			GeometricalEdge         &operator()(long  i) { return edges[i];                };
+			const GeomVertex &operator[](long i) const { return vertices[i]; };
+			GeomVertex       &operator[](long i) { return vertices[i];       };
+			const GeomEdge   &operator()(long i) const { return edges[i];    };
+			GeomEdge         &operator()(long  i) { return edges[i];                };
 
 			//Methods
@@ -54,12 +54,12 @@
 			void             Init(void);
 			void             PostRead();
-			long             GetId(const GeometricalVertex &t) const;
-			long             GetId(const GeometricalVertex *t) const;
-			long             GetId(const GeometricalEdge &t) const;
-			long             GetId(const GeometricalEdge *t) const;
+			long             GetId(const GeomVertex &t) const;
+			long             GetId(const GeomVertex *t) const;
+			long             GetId(const GeomEdge &t) const;
+			long             GetId(const GeomEdge *t) const;
 			long             GetId(const Curve *c) const;
 			void             UnMarkEdges();
-			GeometricalEdge *ProjectOnCurve(const Edge &,double,BamgVertex &,VertexOnGeom &) const;
-			GeometricalEdge *Containing(const R2 P, GeometricalEdge *start) const;
+			GeomEdge *ProjectOnCurve(const Edge &,double,BamgVertex &,VertexOnGeom &) const;
+			GeomEdge *Containing(const R2 P, GeomEdge *start) const;
 			void             WriteGeometry(BamgGeom *bamggeom, BamgOpts*bamgopts);
 	};
Index: issm/trunk/src/c/objects/Bamg/ListofIntersectionTriangles.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/ListofIntersectionTriangles.cpp	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/ListofIntersectionTriangles.cpp	(revision 5573)
@@ -180,5 +180,5 @@
 	/*}}}1*/
 	/*FUNCTION ListofIntersectionTriangles::NewSubSeg{{{1*/
-	void  ListofIntersectionTriangles::NewSubSeg(GeometricalEdge *e,double s0,double s1){ 
+	void  ListofIntersectionTriangles::NewSubSeg(GeomEdge *e,double s0,double s1){ 
 		long int verbosity=0;
 		if (NbSeg>=MaxNbSeg) {
Index: issm/trunk/src/c/objects/Bamg/ListofIntersectionTriangles.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/ListofIntersectionTriangles.h	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/ListofIntersectionTriangles.h	(revision 5573)
@@ -25,5 +25,5 @@
 
 			public:
-				GeometricalEdge *e;
+				GeomEdge *e;
 				double           sBegin  ,sEnd; // abscisse of the seg on edge parameter
 				double           lBegin  ,lEnd; // length abscisse set in ListofIntersectionTriangles::Length
@@ -66,5 +66,5 @@
 			double Length();
 			long   NewPoints(BamgVertex *,long &nbv,long maxnbv);
-			void   NewSubSeg(GeometricalEdge *e,double s0,double s1);
+			void   NewSubSeg(GeomEdge *e,double s0,double s1);
 			void   ReShape();
 	};
Index: issm/trunk/src/c/objects/Bamg/Mesh.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/Mesh.cpp	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/Mesh.cpp	(revision 5573)
@@ -380,28 +380,28 @@
 		}
 
-		//VerticesOnGeometricEdge
-		if(bamgmesh->VerticesOnGeometricEdge){
-			if(verbose>5) printf("      processing VerticesOnGeometricEdge\n");
-			NbVerticesOnGeomEdge=bamgmesh->VerticesOnGeometricEdgeSize[0];
+		//VerticesOnGeomEdge
+		if(bamgmesh->VerticesOnGeomEdge){
+			if(verbose>5) printf("      processing VerticesOnGeomEdge\n");
+			NbVerticesOnGeomEdge=bamgmesh->VerticesOnGeomEdgeSize[0];
 			VerticesOnGeomEdge= new  VertexOnGeom[NbVerticesOnGeomEdge] ;
 			for (i=0;i<NbVerticesOnGeomEdge;i++){
 				long  i1,i2;
 				double s;
-				i1=(long)  bamgmesh->VerticesOnGeometricEdge[i*3+0]-1; //for C indexing
-				i2=(long)  bamgmesh->VerticesOnGeometricEdge[i*3+1]-1; //for C indexing
-				s =(double)bamgmesh->VerticesOnGeometricEdge[i*3+2];
+				i1=(long)  bamgmesh->VerticesOnGeomEdge[i*3+0]-1; //for C indexing
+				i2=(long)  bamgmesh->VerticesOnGeomEdge[i*3+1]-1; //for C indexing
+				s =(double)bamgmesh->VerticesOnGeomEdge[i*3+2];
 				VerticesOnGeomEdge[i]=VertexOnGeom(vertices[i1],Gh.edges[i2],s);
 			}
 		}
 
-		//VerticesOnGeometricVertex
-		if(bamgmesh->VerticesOnGeometricVertexSize[0]){
-			if(verbose>5) printf("      processing VerticesOnGeometricVertex\n");
-			NbVerticesOnGeomVertex=bamgmesh->VerticesOnGeometricVertexSize[0];
+		//VerticesOnGeomVertex
+		if(bamgmesh->VerticesOnGeomVertexSize[0]){
+			if(verbose>5) printf("      processing VerticesOnGeomVertex\n");
+			NbVerticesOnGeomVertex=bamgmesh->VerticesOnGeomVertexSize[0];
 			VerticesOnGeomVertex  = new  VertexOnGeom[NbVerticesOnGeomVertex] ;
 			for (i=0;i<NbVerticesOnGeomVertex;i++){
 				long  i1,i2;
-				i1=(long)bamgmesh->VerticesOnGeometricVertex[i*2+0]-1; //for C indexing
-				i2=(long)bamgmesh->VerticesOnGeometricVertex[i*2+1]-1; //for C indexing
+				i1=(long)bamgmesh->VerticesOnGeomVertex[i*2+0]-1; //for C indexing
+				i2=(long)bamgmesh->VerticesOnGeomVertex[i*2+1]-1; //for C indexing
 				VerticesOnGeomVertex[i]=VertexOnGeom(vertices[i1],Gh.vertices[i2]);
 			}
@@ -471,17 +471,17 @@
 		}
 
-		//EdgeOnGeometricEdge
-		if(bamgmesh->EdgesOnGeometricEdge){
-			if(verbose>5) printf("      processing EdgesOnGeometricEdge\n");
+		//EdgeOnGeomEdge
+		if(bamgmesh->EdgesOnGeomEdge){
+			if(verbose>5) printf("      processing EdgesOnGeomEdge\n");
 			int i1,i2,i,j;
-			i2=bamgmesh->EdgesOnGeometricEdgeSize[0];
+			i2=bamgmesh->EdgesOnGeomEdgeSize[0];
 			for (i1=0;i1<i2;i1++) {
-				i=(int)bamgmesh->EdgesOnGeometricEdge[i1*2+0]-1; //C indexing
-				j=(int)bamgmesh->EdgesOnGeometricEdge[i1*2+1]-1; //C indexing
+				i=(int)bamgmesh->EdgesOnGeomEdge[i1*2+0]-1; //C indexing
+				j=(int)bamgmesh->EdgesOnGeomEdge[i1*2+1]-1; //C indexing
 				//Check value
 				if(!(i>=0 && j>=0 && i<nbe && j<Gh.nbe)) {
-					ISSMERROR("ReadMesh error: EdgesOnGeometricEdge edge provided (line %i: [%i %i]) is incorrect (must be positive, [0<i<nbe=%i 0<j<Gh.nbe=%i]",i1+1,i+1,j+1,nbe,Gh.nbe);
-				}
-				edges[i].GeometricalEdgeHook=Gh.edges+j;
+					ISSMERROR("ReadMesh error: EdgesOnGeomEdge edge provided (line %i: [%i %i]) is incorrect (must be positive, [0<i<nbe=%i 0<j<Gh.nbe=%i]",i1+1,i+1,j+1,nbe,Gh.nbe);
+				}
+				edges[i].GeomEdgeHook=Gh.edges+j;
 			}
 		}
@@ -582,5 +582,5 @@
 				bamgmesh->Edges[i*3+1]=GetId(edges[i][1])+1; //back to M indexing
 				bamgmesh->Edges[i*3+2]=edges[i].ReferenceNumber;
-				if(edges[i].GeometricalEdgeHook){
+				if(edges[i].GeomEdgeHook){
 					NumIssmSegments++;
 				}
@@ -651,5 +651,5 @@
 		num=0;
 		for (i=0;i<nbe;i++){
-			if(edges[i].GeometricalEdgeHook){
+			if(edges[i].GeomEdgeHook){
 				//build segment
 				int i1=GetId(edges[i][0]);
@@ -758,49 +758,49 @@
 
 		/*VerticesOnGeomVertex*/
-		if(verbose>5) printf("      writing VerticesOnGeometricVertex\n");
-		bamgmesh->VerticesOnGeometricVertexSize[0]=NbVerticesOnGeomVertex;
-		bamgmesh->VerticesOnGeometricVertexSize[1]=2;
+		if(verbose>5) printf("      writing VerticesOnGeomVertex\n");
+		bamgmesh->VerticesOnGeomVertexSize[0]=NbVerticesOnGeomVertex;
+		bamgmesh->VerticesOnGeomVertexSize[1]=2;
 		if (NbVerticesOnGeomVertex){
-			bamgmesh->VerticesOnGeometricVertex=(double*)xmalloc(2*NbVerticesOnGeomVertex*sizeof(double));
+			bamgmesh->VerticesOnGeomVertex=(double*)xmalloc(2*NbVerticesOnGeomVertex*sizeof(double));
 			for (i=0;i<NbVerticesOnGeomVertex;i++){
 				VertexOnGeom &v=VerticesOnGeomVertex[i];
 				ISSMASSERT(v.OnGeomVertex());
-				bamgmesh->VerticesOnGeometricVertex[i*2+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing
-				bamgmesh->VerticesOnGeometricVertex[i*2+1]=Gh.GetId((GeometricalVertex*)v)+1; //back to Matlab indexing
-			}
-		}
-
-		/*VertexOnGeometricEdge*/
-		if(verbose>5) printf("      writing VerticesOnGeometricEdge\n");
-		bamgmesh->VerticesOnGeometricEdgeSize[0]=NbVerticesOnGeomEdge;
-		bamgmesh->VerticesOnGeometricEdgeSize[1]=3;
+				bamgmesh->VerticesOnGeomVertex[i*2+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing
+				bamgmesh->VerticesOnGeomVertex[i*2+1]=Gh.GetId((GeomVertex*)v)+1; //back to Matlab indexing
+			}
+		}
+
+		/*VertexOnGeomEdge*/
+		if(verbose>5) printf("      writing VerticesOnGeomEdge\n");
+		bamgmesh->VerticesOnGeomEdgeSize[0]=NbVerticesOnGeomEdge;
+		bamgmesh->VerticesOnGeomEdgeSize[1]=3;
 		if (NbVerticesOnGeomEdge){
-			bamgmesh->VerticesOnGeometricEdge=(double*)xmalloc(3*NbVerticesOnGeomEdge*sizeof(double));
+			bamgmesh->VerticesOnGeomEdge=(double*)xmalloc(3*NbVerticesOnGeomEdge*sizeof(double));
 			for (i=0;i<NbVerticesOnGeomEdge;i++){
 				const VertexOnGeom &v=VerticesOnGeomEdge[i];
 				if (!v.OnGeomEdge()){
-					ISSMERROR("A vertices supposed to be OnGeometricEdge is actually not");
-				}
-				bamgmesh->VerticesOnGeometricEdge[i*3+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing
-				bamgmesh->VerticesOnGeometricEdge[i*3+1]=Gh.GetId((const GeometricalEdge*)v)+1; //back to Matlab indexing
-				bamgmesh->VerticesOnGeometricEdge[i*3+2]=(double)v; //absisce
-			}
-		}
-
-		/*EdgesOnGeometricEdge*/
-		if(verbose>5) printf("      writing EdgesOnGeometricEdge\n");
+					ISSMERROR("A vertices supposed to be OnGeomEdge is actually not");
+				}
+				bamgmesh->VerticesOnGeomEdge[i*3+0]=GetId((BamgVertex*)v)+1; //back to Matlab indexing
+				bamgmesh->VerticesOnGeomEdge[i*3+1]=Gh.GetId((const GeomEdge*)v)+1; //back to Matlab indexing
+				bamgmesh->VerticesOnGeomEdge[i*3+2]=(double)v; //absisce
+			}
+		}
+
+		/*EdgesOnGeomEdge*/
+		if(verbose>5) printf("      writing EdgesOnGeomEdge\n");
 		k=0;
 		for (i=0;i<nbe;i++){
-			if (edges[i].GeometricalEdgeHook) k=k+1;
-		}
-		bamgmesh->EdgesOnGeometricEdgeSize[0]=k;
-		bamgmesh->EdgesOnGeometricEdgeSize[1]=2;
+			if (edges[i].GeomEdgeHook) k=k+1;
+		}
+		bamgmesh->EdgesOnGeomEdgeSize[0]=k;
+		bamgmesh->EdgesOnGeomEdgeSize[1]=2;
 		if (k){
-			bamgmesh->EdgesOnGeometricEdge=(double*)xmalloc(2*(int)k*sizeof(double));
+			bamgmesh->EdgesOnGeomEdge=(double*)xmalloc(2*(int)k*sizeof(double));
 			int count=0;
 			for (i=0;i<nbe;i++){
-				if (edges[i].GeometricalEdgeHook){
-					bamgmesh->EdgesOnGeometricEdge[count*2+0]=(double)i+1; //back to Matlab indexing
-					bamgmesh->EdgesOnGeometricEdge[count*2+1]=(double)Gh.GetId(edges[i].GeometricalEdgeHook)+1; //back to Matlab indexing
+				if (edges[i].GeomEdgeHook){
+					bamgmesh->EdgesOnGeomEdge[count*2+0]=(double)i+1; //back to Matlab indexing
+					bamgmesh->EdgesOnGeomEdge[count*2+1]=(double)Gh.GetId(edges[i].GeomEdgeHook)+1; //back to Matlab indexing
 					count=count+1;
 				}
@@ -1015,5 +1015,5 @@
 				Gh.ProjectOnCurve(edges[i],ss[j],V,GV);
 
-				GeometricalEdge* eg = GV;
+				GeomEdge* eg = GV;
 				double s = GV;
 				R2 tg;
@@ -1386,9 +1386,9 @@
 					edges[add].v[0] = &triangles[it][VerticesOfTriangularEdge[j][0]];
 					edges[add].v[1] = &triangles[it][VerticesOfTriangularEdge[j][1]];
-					edges[add].GeometricalEdgeHook=NULL; 
+					edges[add].GeomEdgeHook=NULL; 
 					//if already existed
 					if (i<nbeold){
 						edges[add].ReferenceNumber=edgessave[i].ReferenceNumber; 		      
-						edges[add].GeometricalEdgeHook=edgessave[i].GeometricalEdgeHook; //  HACK to get required edges
+						edges[add].GeomEdgeHook=edgessave[i].GeomEdgeHook; //  HACK to get required edges
 						printf("oh no...\n");
 					}
@@ -1553,8 +1553,8 @@
 		Gh.nbv=k;
 		Gh.nbe = nbe;
-		Gh.vertices = new GeometricalVertex[k];
-		Gh.edges = new GeometricalEdge[nbe];
+		Gh.vertices = new GeomVertex[k];
+		Gh.edges = new GeomEdge[nbe];
 		Gh.nbsubdomains = nbsubdomains;
-		Gh.subdomains = new GeometricalSubDomain[nbsubdomains];
+		Gh.subdomains = new GeomSubDomain[nbsubdomains];
 		if (verbose>3) printf("   number of vertices = %i\n   number of edges = %i\n",Gh.nbv,Gh.nbe);
 		NbVerticesOnGeomVertex = Gh.nbv;
@@ -1618,7 +1618,7 @@
 			Gh.edges[i].tg[1]=R2();
 
-			bool required= edges[i].GeometricalEdgeHook; 
+			bool required= edges[i].GeomEdgeHook; 
 			if(required) kreq++;
-			edges[i].GeometricalEdgeHook =  Gh.edges + i;
+			edges[i].GeomEdgeHook =  Gh.edges + i;
 			if(required){
 				Gh.edges[i].v[0]->SetRequired();
@@ -2195,5 +2195,5 @@
 		//  computed the number of cracked edge
 		for (k=i=0;i<nbe;i++){
-			if(edges[i].GeometricalEdgeHook->Cracked()) k++;
+			if(edges[i].GeomEdgeHook->Cracked()) k++;
 		}
 
@@ -2214,8 +2214,8 @@
 
 		for (i=0;i<nbe;i++){
-			if(edges[i].GeometricalEdgeHook->Cracked()){
+			if(edges[i].GeomEdgeHook->Cracked()){
 
 				//Fill edges fields of CrackedEdges
-				CrackedEdges[k  ].E =edges[i].GeometricalEdgeHook;
+				CrackedEdges[k  ].E =edges[i].GeomEdgeHook;
 				CrackedEdges[k++].e1=&edges[i];
 
@@ -2563,5 +2563,5 @@
 				CreateSingleVertexToTriangleConnectivity();
 				long * mark = new long[nbt];
-				Edge **GeometricalEdgetoEdge = MakeGeometricalEdgeToEdge();
+				Edge **GeomEdgetoEdge = MakeGeomEdgeToEdge();
 
 				for (it=0;it<nbt;it++)
@@ -2569,10 +2569,10 @@
 				long inew =0;
 				for (int i=0;i<nbsubdomains;i++) {
-					GeometricalEdge &eg = *Gh.subdomains[i].edge;
+					GeomEdge &eg = *Gh.subdomains[i].edge;
 					subdomains[i].ReferenceNumber = Gh.subdomains[i].ReferenceNumber;
 					int ssdlab = subdomains[i].ReferenceNumber;
-					// by carefull is not easy to find a edge create from a GeometricalEdge 
-					// see routine MakeGeometricalEdgeToEdge
-					Edge &e = *GeometricalEdgetoEdge[Gh.GetId(eg)];
+					// by carefull is not easy to find a edge create from a GeomEdge 
+					// see routine MakeGeomEdgeToEdge
+					Edge &e = *GeomEdgetoEdge[Gh.GetId(eg)];
 					ISSMASSERT(&e);
 					BamgVertex * v0 =  e(0),*v1 = e(1);
@@ -2632,5 +2632,5 @@
 					 if ( mark[it] ==-1 ) 
 					  nbtout++,triangles[it].link =0;
-					delete [] GeometricalEdgetoEdge;
+					delete [] GeomEdgetoEdge;
 					delete [] mark;
 
@@ -2954,7 +2954,7 @@
 	}
 	/*}}}1*/
-	/*FUNCTION Mesh::MakeGeometricalEdgeToEdge{{{1*/
-	Edge** Mesh::MakeGeometricalEdgeToEdge() {
-		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeGeometricalEdgeToEdge)*/
+	/*FUNCTION Mesh::MakeGeomEdgeToEdge{{{1*/
+	Edge** Mesh::MakeGeomEdgeToEdge() {
+		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeGeomEdgeToEdge)*/
 
 		if (!Gh.nbe){
@@ -2969,17 +2969,17 @@
 		  { 
 			Edge * ei = edges+i;
-			GeometricalEdge *GeometricalEdgeHook = ei->GeometricalEdgeHook; 
-			e[Gh.GetId(GeometricalEdgeHook)] = ei;    
+			GeomEdge *GeomEdgeHook = ei->GeomEdgeHook; 
+			e[Gh.GetId(GeomEdgeHook)] = ei;    
 		  }
 		for ( i=0;i<nbe ; i++) 
 		 for (int ii=0;ii<2;ii++) { 
 			 Edge * ei = edges+i;
-			 GeometricalEdge *GeometricalEdgeHook = ei->GeometricalEdgeHook;
+			 GeomEdge *GeomEdgeHook = ei->GeomEdgeHook;
 			 int j= ii;
-			 while (!(*GeometricalEdgeHook)[j].Required()) { 
-				 Adj(GeometricalEdgeHook,j); // next geom edge
+			 while (!(*GeomEdgeHook)[j].Required()) { 
+				 Adj(GeomEdgeHook,j); // next geom edge
 				 j=1-j;
-				 if (e[Gh.GetId(GeometricalEdgeHook)])  break; // optimisation
-				 e[Gh.GetId(GeometricalEdgeHook)] = ei; 
+				 if (e[Gh.GetId(GeomEdgeHook)])  break; // optimisation
+				 e[Gh.GetId(GeomEdgeHook)] = ei; 
 			 }
 		 }
@@ -3161,5 +3161,5 @@
 			for (i=0;i<Bh.nbv;i++){ 
 				BamgVertex &bv=Bh[i];
-				if (!bv.GeometricalEdgeHook){
+				if (!bv.GeomEdgeHook){
 					vertices[nbv].r   = bv.r;
 					vertices[nbv++].m = bv.m;
@@ -3266,5 +3266,5 @@
 	/*}}}1*/
 	/*FUNCTION Mesh::ProjectOnCurve{{{1*/
-	GeometricalEdge*   Mesh::ProjectOnCurve( Edge & BhAB, BamgVertex &  vA, BamgVertex & vB,
+	GeomEdge*   Mesh::ProjectOnCurve( Edge & BhAB, BamgVertex &  vA, BamgVertex & vB,
 				double theta,BamgVertex & R,VertexOnEdge &  BR,VertexOnGeom & GR) {
 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshQuad.cpp/ProjectOnCurve)*/
@@ -3676,5 +3676,5 @@
 	for (i=0;i<nbe;i++){
  	/*If the current mesh edge is on Geometry*/
-		if(edges[i].GeometricalEdgeHook){
+		if(edges[i].GeomEdgeHook){
 			for(int j=0;j<2;j++){
 				/*Go through the edges adjacent to current edge (if on the same curve)*/
@@ -3682,13 +3682,13 @@
 					/*The edge is on Geometry and does not have 2 adjacent edges... (not on a closed curve)*/
 					/*Check that the 2 vertices are on geometry AND required*/
-					if(!edges[i][j].GeometricalEdgeHook->IsRequiredVertex()){
+					if(!edges[i][j].GeomEdgeHook->IsRequiredVertex()){
 						printf("ReconstructExistingMesh error message: problem with the edge number %i: [%i %i]\n",i+1,GetId(edges[i][0])+1,GetId(edges[i][1])+1);
-						printf("This edge is on geometrical edge number %i\n",Gh.GetId(edges[i].GeometricalEdgeHook)+1);
-						if (edges[i][j].GeometricalEdgeHook->OnGeomVertex())
-						 printf("the vertex number %i of this edge is a geometric BamgVertex number %i\n",GetId(edges[i][j])+1,Gh.GetId(edges[i][j].GeometricalEdgeHook->gv)+1);
-						else if (edges[i][j].GeometricalEdgeHook->OnGeomEdge())
-						 printf("the vertex number %i of this edge is a geometric Edge number %i\n",GetId(edges[i][j])+1,Gh.GetId(edges[i][j].GeometricalEdgeHook->ge)+1);
+						printf("This edge is on geometrical edge number %i\n",Gh.GetId(edges[i].GeomEdgeHook)+1);
+						if (edges[i][j].GeomEdgeHook->OnGeomVertex())
+						 printf("the vertex number %i of this edge is a geometric BamgVertex number %i\n",GetId(edges[i][j])+1,Gh.GetId(edges[i][j].GeomEdgeHook->gv)+1);
+						else if (edges[i][j].GeomEdgeHook->OnGeomEdge())
+						 printf("the vertex number %i of this edge is a geometric Edge number %i\n",GetId(edges[i][j])+1,Gh.GetId(edges[i][j].GeomEdgeHook->ge)+1);
 						else
-						 printf("Its pointer is %p\n",edges[i][j].GeometricalEdgeHook);
+						 printf("Its pointer is %p\n",edges[i][j].GeomEdgeHook);
 
 						printf("This edge is on geometry and has no adjacent edge (open curve) and one of the tip is not required\n");
@@ -4174,5 +4174,5 @@
 		Triangle * lastT = triangles + nbt;
 		for (i=0;i<nbe;i++)
-		 if(edges[i].GeometricalEdgeHook) NbEdgeOnGeom++;
+		 if(edges[i].GeomEdgeHook) NbEdgeOnGeom++;
 		long newnbe=nbe+nbe;
 		//  long newNbVerticesOnGeomVertex=NbVerticesOnGeomVertex;
@@ -4198,12 +4198,12 @@
 		Edge ** edgesGtoB=0;
 		if (withBackground)
-		 edgesGtoB= BTh.MakeGeometricalEdgeToEdge();
+		 edgesGtoB= BTh.MakeGeomEdgeToEdge();
 		long ferr=0;
 		for (i=0;i<nbe;i++)
-		 newedges[ie].GeometricalEdgeHook=0;
+		 newedges[ie].GeomEdgeHook=0;
 
 		for (i=0;i<nbe;i++)
 		  {
-			GeometricalEdge *ong =  edges[i].GeometricalEdgeHook;
+			GeomEdge *ong =  edges[i].GeomEdgeHook;
 
 			newedges[ie]=edges[i];
@@ -4224,5 +4224,5 @@
 						ISSMERROR("!edgesGtoB");
 					}
-					ong= ProjectOnCurve(*edgesGtoB[Gh.GetId(edges[i].GeometricalEdgeHook)],
+					ong= ProjectOnCurve(*edgesGtoB[Gh.GetId(edges[i].GeomEdgeHook)],
 								edges[i][0],edges[i][1],0.5,vertices[k],
 								newVertexOnBThEdge[kvb],
@@ -4253,5 +4253,5 @@
 				vertices[k].r = ((R2) edges[i][0] + (R2)  edges[i][1] )*0.5;
 				vertices[k].m =  Metric(0.5,edges[i][0],0.5,edges[i][1]);
-				vertices[k].GeometricalEdgeHook = 0;
+				vertices[k].GeomEdgeHook = 0;
 			  }
 			//vertices[k].i = R2ToI2( vertices[k].r);
@@ -4262,5 +4262,5 @@
 			vertices[k].DirOfSearch = NoDirOfSearch;
 
-			newedges[ie].GeometricalEdgeHook = Gh.Containing(AA,ong);
+			newedges[ie].GeomEdgeHook = Gh.Containing(AA,ong);
 			newedges[ie++].v[1]=vertices+k;
 
@@ -4268,5 +4268,5 @@
 			newedges[ie].adj[0]=newedges + ie -1;
 			newedges[ie].adj[1]=newedges+(edges[i].adj[1]-edges) ;
-			newedges[ie].GeometricalEdgeHook =  Gh.Containing(BB,ong);
+			newedges[ie].GeomEdgeHook =  Gh.Containing(BB,ong);
 			newedges[ie++].v[0]=vertices+k;
 			k++;
@@ -4664,5 +4664,5 @@
 				  BamgVertex &v0 = t[VerticesOfTriangularEdge[j][0]];
 				  BamgVertex &v1 = t[VerticesOfTriangularEdge[j][1]];
-				  if (v0.GeometricalEdgeHook && v1.GeometricalEdgeHook){
+				  if (v0.GeomEdgeHook && v1.GeomEdgeHook){
 					  R2 P= ((R2) v0 + (R2) v1)*0.5;
 					  if ( nbv<maxnbv) {
@@ -4884,7 +4884,7 @@
 
 		R2                 AB;
-		GeometricalVertex *a, *b;
+		GeomVertex *a, *b;
 		BamgVertex        *va, *vb;
-		GeometricalEdge   *e;
+		GeomEdge   *e;
 
 		// add a ref to GH to make sure that it is not destroyed by mistake
@@ -4951,5 +4951,5 @@
 
 				//ei = current Geometrical edge
-				GeometricalEdge &ei=Gh.edges[i];   
+				GeomEdge &ei=Gh.edges[i];   
 
 				//loop over the two vertices of the edge ei
@@ -4978,5 +4978,5 @@
 									edges[nbe].v[1]=b->MeshVertexHook;;
 									edges[nbe].ReferenceNumber = e->ReferenceNumber;
-									edges[nbe].GeometricalEdgeHook = e;
+									edges[nbe].GeomEdgeHook = e;
 									edges[nbe].adj[0] = 0;
 									edges[nbe].adj[1] = 0;
@@ -5087,5 +5087,5 @@
 										edges[nbe].v[1]=vb;
 										edges[nbe].ReferenceNumber =e->ReferenceNumber;
-										edges[nbe].GeometricalEdgeHook = e;
+										edges[nbe].GeomEdgeHook = e;
 										edges[nbe].adj[0] = PreviousNewEdge;
 										if(PreviousNewEdge) PreviousNewEdge->adj[1]=&edges[nbe];
@@ -5124,5 +5124,5 @@
 								edges[nbe].v[1]=vb;
 								edges[nbe].ReferenceNumber = e->ReferenceNumber;
-								edges[nbe].GeometricalEdgeHook = e;
+								edges[nbe].GeomEdgeHook = e;
 								edges[nbe].adj[0] = PreviousNewEdge;
 								edges[nbe].adj[1] = 0;
@@ -5191,6 +5191,6 @@
 		 * We need the abcisse of the background mesh vertices on geometry
 		 * so a vertex is 
-		 * 0 on GeometricalVertex ;
-		 * 1 on GeometricalEdge + abcisse
+		 * 0 on GeomVertex ;
+		 * 1 on GeomEdge + abcisse
 		 * 2 internal 
 		 *************************************************************************/
@@ -5238,5 +5238,5 @@
 			VertexOnGeom &vog=BTh.VerticesOnGeomVertex[i];
 			if (vog.IsRequiredVertex()){
-				GeometricalVertex* gv=vog;
+				GeomVertex* gv=vog;
 				BamgVertex *bv = vog;
 				ISSMASSERT(gv->MeshVertexHook); // use of Geom -> Th
@@ -5262,22 +5262,22 @@
 
 				/* If one of the vertex is required we are in a new curve*/
-				if (ei[je].GeometricalEdgeHook->IsRequiredVertex()){ 
+				if (ei[je].GeomEdgeHook->IsRequiredVertex()){ 
 
 					/*Get curve number*/
-					int nc=ei.GeometricalEdgeHook->CurveNumber;
+					int nc=ei.GeomEdgeHook->CurveNumber;
 					
 					//printf("Dealing with curve number %i\n",nc);
-					//printf("edge on geometry is same as GhCurve? %s\n",(ei.GeometricalEdgeHook==Gh.curves[nc].FirstEdge || ei.GeometricalEdgeHook==Gh.curves[nc].LastEdge)?"yes":"no");
-					//if(ei.GeometricalEdgeHook==Gh.curves[nc].FirstEdge || ei.GeometricalEdgeHook==Gh.curves[nc].LastEdge){
-					//	printf("Do we have the right extremity? curve first vertex -> %s\n",((GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex])?"yes":"no");
-					//	printf("Do we have the right extremity? curve last  vertex -> %s\n",((GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex])?"yes":"no");
+					//printf("edge on geometry is same as GhCurve? %s\n",(ei.GeomEdgeHook==Gh.curves[nc].FirstEdge || ei.GeomEdgeHook==Gh.curves[nc].LastEdge)?"yes":"no");
+					//if(ei.GeomEdgeHook==Gh.curves[nc].FirstEdge || ei.GeomEdgeHook==Gh.curves[nc].LastEdge){
+					//	printf("Do we have the right extremity? curve first vertex -> %s\n",((GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex])?"yes":"no");
+					//	printf("Do we have the right extremity? curve last  vertex -> %s\n",((GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex])?"yes":"no");
 					//}
 					//BUG FIX from original bamg
 					/*Check that we are on the same edge and right vertex (0 or 1) */
-					if(ei.GeometricalEdgeHook==Gh.curves[nc].FirstEdge  && (GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex]){
+					if(ei.GeomEdgeHook==Gh.curves[nc].FirstEdge  && (GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex]){
 						bcurve[nc]=iedge*2+je;
 						bfind++;	
 					}
-					else if ((ei.GeometricalEdgeHook==Gh.curves[nc].LastEdge  && (GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex]) && bcurve[nc]==-1){
+					else if ((ei.GeomEdgeHook==Gh.curves[nc].LastEdge  && (GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex]) && bcurve[nc]==-1){
 						bcurve[nc]=iedge*2+je;
 						bfind++;	
@@ -5335,10 +5335,10 @@
 					int k0equi=jedgeequi,k1equi;		  
 					Edge * peequi= BTh.edges+iedgeequi;
-					GeometricalEdge *ongequi = peequi->GeometricalEdgeHook;
+					GeomEdge *ongequi = peequi->GeomEdgeHook;
 
 					double sNew=Lstep;// abscisse of the new points (phase==1) 
 					L=0;// length of the curve
 					long i=0;// index of new points on the curve
-					register GeometricalVertex * GA0 = *(*peequi)[k0equi].GeometricalEdgeHook;
+					register GeomVertex * GA0 = *(*peequi)[k0equi].GeomEdgeHook;
 					BamgVertex *A0;
 					A0 = GA0->MeshVertexHook;  // the vertex in new mesh
@@ -5350,5 +5350,5 @@
 					ISSMASSERT(A0-vertices>=0 && A0-vertices<nbv);
 					if(ongequi->Required()){
-						GeometricalVertex *GA1 = *(*peequi)[1-k0equi].GeometricalEdgeHook;
+						GeomVertex *GA1 = *(*peequi)[1-k0equi].GeomEdgeHook;
 						A1 = GA1->MeshVertexHook;  //
 					}       
@@ -5359,6 +5359,6 @@
 							k1 = 1-k0; // next vertex of the edge 
 							k1equi= 1 - k0equi;
-							ISSMASSERT(pe && ee.GeometricalEdgeHook);
-							ee.GeometricalEdgeHook->SetMark();
+							ISSMASSERT(pe && ee.GeomEdgeHook);
+							ee.GeomEdgeHook->SetMark();
 							BamgVertex & v0=ee[0], & v1=ee[1];
 							R2 AB=(R2)v1-(R2)v0;
@@ -5396,5 +5396,5 @@
 									A1->ReferenceNumber = eeequi.ReferenceNumber;
 									A1->DirOfSearch =NoDirOfSearch;
-									e->GeometricalEdgeHook = ongequi;
+									e->GeomEdgeHook = ongequi;
 									e->v[0]=A0;
 									e->v[1]=A1;
@@ -5411,8 +5411,8 @@
 
 							//some checks
-							ISSMASSERT(ee.GeometricalEdgeHook->CurveNumber==ei.GeometricalEdgeHook->CurveNumber);
-							if (ee[k1].GeometricalEdgeHook->IsRequiredVertex()) {
-								ISSMASSERT(eeequi[k1equi].GeometricalEdgeHook->IsRequiredVertex());
-								register GeometricalVertex * GA1 = *eeequi[k1equi].GeometricalEdgeHook;
+							ISSMASSERT(ee.GeomEdgeHook->CurveNumber==ei.GeomEdgeHook->CurveNumber);
+							if (ee[k1].GeomEdgeHook->IsRequiredVertex()) {
+								ISSMASSERT(eeequi[k1equi].GeomEdgeHook->IsRequiredVertex());
+								register GeomVertex * GA1 = *eeequi[k1equi].GeomEdgeHook;
 								A1=GA1->MeshVertexHook;// the vertex in new mesh
 								ISSMASSERT(A1-vertices>=0 && A1-vertices<nbv);
@@ -5432,5 +5432,5 @@
 					if (phase){ // construction of the last edge
 						Edge* e=edges + nbe++;
-						e->GeometricalEdgeHook  = ongequi;
+						e->GeomEdgeHook  = ongequi;
 						e->v[0]=A0;
 						e->v[1]=A1;
Index: issm/trunk/src/c/objects/Bamg/Mesh.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/Mesh.h	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/Mesh.h	(revision 5573)
@@ -89,5 +89,5 @@
 			void BoundAnisotropy(double anisomax,double hminaniso= 1e-100) ;
 			void MaxSubDivision(double maxsubdiv);
-			Edge** MakeGeometricalEdgeToEdge();
+			Edge** MakeGeomEdgeToEdge();
 			long SplitInternalEdgeWithBorderVertices();
 			void MakeQuadrangles(double costheta);
@@ -100,5 +100,5 @@
 			void SmoothingVertex(int =3,double=0.3);
 			Metric MetricAt (const R2 &) const;
-			GeometricalEdge* ProjectOnCurve( Edge & AB, BamgVertex &  A, BamgVertex & B,double theta, BamgVertex & R,VertexOnEdge & BR,VertexOnGeom & GR);
+			GeomEdge* ProjectOnCurve( Edge & AB, BamgVertex &  A, BamgVertex & B,double theta, BamgVertex & R,VertexOnEdge & BR,VertexOnGeom & GR);
 			long GetId(const Triangle & t) const;
 			long GetId(const Triangle * t) const;
@@ -134,10 +134,10 @@
 			  }
 			inline  void  SetVertexFieldOn(){
-				for (int i=0;i<nbv;i++)                    vertices[i].GeometricalEdgeHook=NULL;
+				for (int i=0;i<nbv;i++)                    vertices[i].GeomEdgeHook=NULL;
 				for (int j=0;j<NbVerticesOnGeomVertex;j++) VerticesOnGeomVertex[j].SetOn();
 				for (int k=0;k<NbVerticesOnGeomEdge;k++ )  VerticesOnGeomEdge[k].SetOn();
 			}	       
 			inline  void   SetVertexFieldOnBTh(){
-				for (int i=0;i<nbv;i++)                 vertices[i].GeometricalEdgeHook=NULL;
+				for (int i=0;i<nbv;i++)                 vertices[i].GeomEdgeHook=NULL;
 				for (int j=0;j<NbVertexOnBThVertex;j++) VertexOnBThVertex[j].SetOnBTh();
 				for (int k=0;k<NbVertexOnBThEdge;k++ )  VertexOnBThEdge[k].SetOnBTh();
@@ -169,5 +169,5 @@
 		return  a.Adj();
 	}
-	inline void Adj(GeometricalEdge * & on,int &i){
+	inline void Adj(GeomEdge * & on,int &i){
 		int j=i;i=on->AdjVertexIndex[i];on=on->Adj[j];
 	}
Index: issm/trunk/src/c/objects/Bamg/VertexOnGeom.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/VertexOnGeom.cpp	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/VertexOnGeom.cpp	(revision 5573)
@@ -18,6 +18,6 @@
 	} 
 	/*}}}*/
-	/*FUNCTION VertexOnGeom::VertexOnGeom(BamgVertex & m,GeometricalVertex &g){{{1*/
-	VertexOnGeom::VertexOnGeom(BamgVertex & m,GeometricalVertex &g){
+	/*FUNCTION VertexOnGeom::VertexOnGeom(BamgVertex & m,GeomVertex &g){{{1*/
+	VertexOnGeom::VertexOnGeom(BamgVertex & m,GeomVertex &g){
 		meshvertex=&m;
 		curvilincoord=-1;
@@ -25,6 +25,6 @@
 	}
 	/*}}}*/
-	/*FUNCTION VertexOnGeom::VertexOnGeom(BamgVertex & m,GeometricalEdge &g,double s){{{1*/
-	VertexOnGeom::VertexOnGeom(BamgVertex & m,GeometricalEdge &g,double s){
+	/*FUNCTION VertexOnGeom::VertexOnGeom(BamgVertex & m,GeomEdge &g,double s){{{1*/
+	VertexOnGeom::VertexOnGeom(BamgVertex & m,GeomEdge &g,double s){
 		meshvertex=&m;
 		curvilincoord=s;
@@ -63,5 +63,5 @@
 	/*FUNCTION VertexOnGeom::SetOn{{{1*/
 	void VertexOnGeom::SetOn(){
-		meshvertex->GeometricalEdgeHook=this;
+		meshvertex->GeomEdgeHook=this;
 		meshvertex->IndexInTriangle=IsVertexOnGeom;
 	}
Index: issm/trunk/src/c/objects/Bamg/VertexOnGeom.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/VertexOnGeom.h	(revision 5572)
+++ issm/trunk/src/c/objects/Bamg/VertexOnGeom.h	(revision 5573)
@@ -3,5 +3,5 @@
 
 #include "./include.h"
-#include "./GeometricalVertex.h"
+#include "./GeomVertex.h"
 
 namespace bamg {
@@ -10,5 +10,5 @@
 	class Mesh;
 	class BamgVertex;
-	class GeometricalEdge;
+	class GeomEdge;
 
 	class VertexOnGeom{
@@ -19,17 +19,17 @@
 			double curvilincoord;  
 			union{ 
-				GeometricalVertex* gv; // if curvilincoord <0; 
-				GeometricalEdge*   ge; // if curvilincoord in [0..1]
+				GeomVertex* gv; // if curvilincoord <0; 
+				GeomEdge*   ge; // if curvilincoord in [0..1]
 			};
 
 			//Constructors/Destructors
 			VertexOnGeom();
-			VertexOnGeom(BamgVertex & m,GeometricalVertex &g);
-			VertexOnGeom(BamgVertex & m,GeometricalEdge &g,double s);
+			VertexOnGeom(BamgVertex & m,GeomVertex &g);
+			VertexOnGeom(BamgVertex & m,GeomEdge &g,double s);
 
 			//Operators
 			operator BamgVertex*() const  {return meshvertex;}
-			operator GeometricalVertex * () const  {return gv;}
-			operator GeometricalEdge * () const  {return ge;}
+			operator GeomVertex * () const  {return gv;}
+			operator GeomEdge * () const  {return ge;}
 			operator const double & () const {return curvilincoord;}
 
