Changeset 5400


Ignore:
Timestamp:
08/19/10 09:28:10 (15 years ago)
Author:
Mathieu Morlighem
Message:

As usual renaming of Bamg routines and fields

Location:
issm/trunk/src/c
Files:
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Makefile.am

    r5378 r5400  
    5353                                        ./objects/Bamg/ListofIntersectionTriangles.cpp\
    5454                                        ./objects/Bamg/ListofIntersectionTriangles.h\
    55                                         ./objects/Bamg/MatVVP2x2.cpp\
     55                                        ./objects/Bamg/EigenMetric.cpp\
    5656                                        ./objects/Bamg/Metric.cpp\
    5757                                        ./objects/Bamg/Metric.h\
     
    605605                                        ./objects/Bamg/ListofIntersectionTriangles.cpp\
    606606                                        ./objects/Bamg/ListofIntersectionTriangles.h\
    607                                         ./objects/Bamg/MatVVP2x2.cpp\
     607                                        ./objects/Bamg/EigenMetric.cpp\
    608608                                        ./objects/Bamg/Metric.cpp\
    609609                                        ./objects/Bamg/Metric.h\
  • issm/trunk/src/c/modules/Bamgx/Bamgx.cpp

    r5187 r5400  
    5353                for(i=0;i<Gh.nbv;i++){
    5454                        Metric M=Gh[i];
    55                         MatVVP2x2 Vp(M/coef);
     55                        EigenMetric Vp(M/coef);
    5656                        Vp.Maxh(bamgopts->hmax);
    5757                        Vp.Minh(bamgopts->hmin);
     
    131131                                if (!isnan(bamgopts->hminVertices[i])){
    132132                                        Metric M=BTh.vertices[i].m;
    133                                         MatVVP2x2 Vp(M/coef);
     133                                        EigenMetric Vp(M/coef);
    134134                                        Vp.Minh(bamgopts->hminVertices[i]);
    135135                                        BTh.vertices[i].m=Vp;
     
    144144                                if (!isnan(bamgopts->hmaxVertices[i])){
    145145                                        Metric M=BTh.vertices[i].m;
    146                                         MatVVP2x2 Vp(M/coef);
     146                                        EigenMetric Vp(M/coef);
    147147                                        Vp.Minh(bamgopts->hmaxVertices[i]);
    148148                                        BTh.vertices[i].m=Vp;
  • issm/trunk/src/c/objects/Bamg/BamgVertex.cpp

    r5180 r5400  
    8383
    8484                //Get eigen values and vectors of Miv
    85                 MatVVP2x2 Vp(Miv);
     85                EigenMetric Vp(Miv);
    8686
    8787                //move eigen valuse to their absolute values
  • issm/trunk/src/c/objects/Bamg/Curve.cpp

    r5397 r5400  
    1111        /*Constructors/Destructors*/
    1212        /*FUNCTION Curve::Curve(){{{1*/
    13         Curve::Curve():be(0),ee(0),kb(0),ke(0),next(0){
    14 
     13        Curve::Curve(){
     14                FirstEdge=NULL;
     15                LastEdge=NULL;
     16                FirstVertexIndex=0;
     17                LastVertexIndex=0;
     18                next=NULL;
    1519        }
    1620        /*}}}*/
     
    2024        void Curve::Reverse() {
    2125                /*reverse the direction of the curve */
    22                 Exchange(be,ee);
    23                 Exchange(kb,ke);
     26                Exchange(FirstEdge,LastEdge);
     27                Exchange(FirstVertexIndex,LastVertexIndex);
    2428        }
    2529        /*}}}*/
     
    2731        void Curve::Set(const Curve & rec,const Geometry & Gh ,Geometry & GhNew){
    2832                *this = rec;
    29                 be = GhNew.edges + Gh.GetId(be);   
    30                 ee = GhNew.edges + Gh.GetId(ee);
     33                FirstEdge = GhNew.edges + Gh.GetId(FirstEdge);   
     34                LastEdge = GhNew.edges + Gh.GetId(LastEdge);
    3135                if(next) next= GhNew.curves + Gh.GetId(next);
    3236        }
  • issm/trunk/src/c/objects/Bamg/Curve.h

    r5397 r5400  
    1313        class Curve {
    1414                public:
    15                         GeometricalEdge *be,*ee; // begin et end edge
    16                         int kb,ke;  //  begin vetex and end vertex
     15                        GeometricalEdge *FirstEdge; //First edge of the curve
     16                        GeometricalEdge *LastEdge;  //Last edge of the curve
     17                        int FirstVertexIndex;       //Last vertex index in the last edge
     18                        int LastVertexIndex;        //First Vertex index in the first edge
    1719                        Curve* next; // next curve equi to this
    1820
  • issm/trunk/src/c/objects/Bamg/EigenMetric.cpp

    r5397 r5400  
    99
    1010        /*Constructor*/
    11         /*FUNCTION MatVVP2x2::MatVVP2x2(const Metric M){{{1*/
    12         MatVVP2x2::MatVVP2x2(const Metric M){
     11        /*FUNCTION EigenMetric::EigenMetric(const Metric M){{{1*/
     12        EigenMetric::EigenMetric(const Metric M){
    1313                /*From a metric (a11,a21,a22), get eigen values lambda1 and lambda2 and one eigen vector v*/
    1414
     
    8989        }
    9090        /*}}}1*/
    91         /*FUNCTION MatVVP2x2::MatVVP2x2(double r1,double r2,const D2 vp1){{{1*/
    92         MatVVP2x2::MatVVP2x2(double r1,double r2,const D2 vp1): lambda1(r1),lambda2(r2),v(vp1){
     91        /*FUNCTION EigenMetric::EigenMetric(double r1,double r2,const D2 vp1){{{1*/
     92        EigenMetric::EigenMetric(double r1,double r2,const D2 vp1): lambda1(r1),lambda2(r2),v(vp1){
    9393
    9494        }/*}}}*/
    9595
    9696        /*Methods*/
    97         /*FUNCTION MatVVP2x2::Abs{{{1*/
    98         void   MatVVP2x2::Abs(){
     97        /*FUNCTION EigenMetric::Abs{{{1*/
     98        void   EigenMetric::Abs(){
    9999                lambda1=bamg::Abs(lambda1),lambda2=bamg::Abs(lambda2);
    100100        }/*}}}*/
    101         /*FUNCTION MatVVP2x2::Aniso{{{1*/
    102         double MatVVP2x2::Aniso() const  {
     101        /*FUNCTION EigenMetric::Aniso{{{1*/
     102        double EigenMetric::Aniso() const  {
    103103                return sqrt( Aniso2());
    104104        }/*}}}*/
    105         /*FUNCTION MatVVP2x2::Aniso2{{{1*/
    106         double MatVVP2x2::Aniso2() const  {
     105        /*FUNCTION EigenMetric::Aniso2{{{1*/
     106        double EigenMetric::Aniso2() const  {
    107107                return lmax()/lmin();
    108108        }/*}}}*/
    109         /*FUNCTION MatVVP2x2::BoundAniso{{{1*/
    110         void   MatVVP2x2::BoundAniso(const double c){
     109        /*FUNCTION EigenMetric::BoundAniso{{{1*/
     110        void   EigenMetric::BoundAniso(const double c){
    111111                BoundAniso2(1/(c*c));
    112112        }/*}}}*/
    113         /*FUNCTION MatVVP2x2::Echo {{{1*/
    114         void MatVVP2x2::Echo(void){
     113        /*FUNCTION EigenMetric::Echo {{{1*/
     114        void EigenMetric::Echo(void){
    115115
    116                 printf("MatVVP2x2:\n");
     116                printf("EigenMetric:\n");
    117117                printf("   lambda1: %g\n",lambda1);
    118118                printf("   lambda2: %g\n",lambda2);
     
    123123        }
    124124        /*}}}*/
    125         /*FUNCTION MatVVP2x2::hmin{{{1*/
    126         double MatVVP2x2::hmin() const {
     125        /*FUNCTION EigenMetric::hmin{{{1*/
     126        double EigenMetric::hmin() const {
    127127                return sqrt(1/bamg::Max3(lambda1,lambda2,1e-30));
    128128        }/*}}}*/
    129         /*FUNCTION MatVVP2x2::hmax{{{1*/
    130         double MatVVP2x2::hmax() const {
     129        /*FUNCTION EigenMetric::hmax{{{1*/
     130        double EigenMetric::hmax() const {
    131131                return sqrt(1/bamg::Max(bamg::Min(lambda1,lambda2),1e-30));
    132132        }/*}}}*/
    133         /*FUNCTION MatVVP2x2::Isotrope{{{1*/
    134         void   MatVVP2x2::Isotrope() {
     133        /*FUNCTION EigenMetric::Isotrope{{{1*/
     134        void   EigenMetric::Isotrope() {
    135135                lambda1=lambda2=bamg::Max(lambda1,lambda2);
    136136        }/*}}}*/
    137         /*FUNCTION MatVVP2x2::lmax{{{1*/
    138         double MatVVP2x2::lmax() const {
     137        /*FUNCTION EigenMetric::lmax{{{1*/
     138        double EigenMetric::lmax() const {
    139139                return bamg::Max3(lambda1,lambda2,1e-30);
    140140        }/*}}}*/
    141         /*FUNCTION MatVVP2x2::lmin{{{1*/
    142         double MatVVP2x2::lmin() const {
     141        /*FUNCTION EigenMetric::lmin{{{1*/
     142        double EigenMetric::lmin() const {
    143143                return bamg::Max(bamg::Min(lambda1,lambda2),1e-30);
    144144        }/*}}}*/
    145         /*FUNCTION MatVVP2x2::Min{{{1*/
    146         void   MatVVP2x2::Min(double a) {
     145        /*FUNCTION EigenMetric::Min{{{1*/
     146        void   EigenMetric::Min(double a) {
    147147                lambda1=bamg::Min(a,lambda1); lambda2=bamg::Min(a,lambda2) ;
    148148        }/*}}}*/
    149         /*FUNCTION MatVVP2x2::Max{{{1*/
    150         void   MatVVP2x2::Max(double a) {
     149        /*FUNCTION EigenMetric::Max{{{1*/
     150        void   EigenMetric::Max(double a) {
    151151                lambda1=bamg::Max(a,lambda1); lambda2=bamg::Max(a,lambda2) ;
    152152        }/*}}}*/
    153         /*FUNCTION MatVVP2x2::Minh{{{1*/
    154         void   MatVVP2x2::Minh(double h) {
     153        /*FUNCTION EigenMetric::Minh{{{1*/
     154        void   EigenMetric::Minh(double h) {
    155155                Min(1.0/(h*h));
    156156        }/*}}}*/
    157         /*FUNCTION MatVVP2x2::Maxh{{{1*/
    158         void   MatVVP2x2::Maxh(double h) {
     157        /*FUNCTION EigenMetric::Maxh{{{1*/
     158        void   EigenMetric::Maxh(double h) {
    159159                Max(1.0/(h*h));
    160160        }/*}}}*/
    161         /*FUNCTION MatVVP2x2::pow{{{1*/
    162         void   MatVVP2x2::pow(double p){
     161        /*FUNCTION EigenMetric::pow{{{1*/
     162        void   EigenMetric::pow(double p){
    163163                lambda1=::pow(lambda1,p);lambda2=::pow(lambda2,p);
    164164        }/*}}}*/
  • issm/trunk/src/c/objects/Bamg/Geometry.cpp

    r5397 r5400  
    400400
    401401        /*Methods*/
     402        /*FUNCTION Geometry::Echo {{{1*/
     403        void Geometry::Echo(void){
     404
     405                printf("Geometry:\n");
     406                printf("   nbv  (number of vertices) : %i\n",nbv);
     407                printf("   nbe  (number of edges)    : %i\n",nbe);
     408                printf("   nbsubdomains: %i\n",nbsubdomains);
     409                printf("   nbcurves: %i\n",nbcurves);
     410                printf("   vertices: %p\n",vertices);
     411                printf("   edges: %p\n",edges);
     412                printf("   quadtree: %p\n",quadtree);
     413                printf("   subdomains: %p\n",subdomains);
     414                printf("   curves: %p\n",curves);
     415                printf("   pmin (x,y): (%g %g)\n",pmin.x,pmin.y);
     416                printf("   pmax (x,y): (%g %g)\n",pmax.x,pmax.y);
     417                printf("   coefIcoor: %g\n",coefIcoor);
     418                printf("   MaxCornerAngle: %g\n",MaxCornerAngle);
     419
     420                return;
     421        }
     422        /*}}}*/
     423        /*FUNCTION Geometry::Init{{{1*/
     424        void Geometry::Init(void){
     425                /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/EmptyGeometry)*/
     426
     427                NbRef=0;
     428                nbv=0;
     429                nbe=0;
     430                quadtree=NULL;
     431                curves=NULL;
     432                edges=NULL;
     433                vertices=NULL;
     434                nbsubdomains=0;
     435                nbcurves=0;
     436                subdomains=NULL;
     437                MaxCornerAngle = 10*Pi/180; //default is 10 degres
     438        }
     439        /*}}}1*/
     440        /*FUNCTION Geometry::MinimalHmin{{{1*/
     441        double Geometry::MinimalHmin() {
     442                /* coeffIcoor = (2^30-1)/D
     443                 * We cannot go beyond hmin = D/2^30 because of the quadtree
     444                 * hmin is therefore approximately 2/coeffIcoor */
     445                return 2.0/coefIcoor;
     446        }/*}}}*/
     447        /*FUNCTION Geometry::MaximalHmax{{{1*/
     448        double Geometry::MaximalHmax() {
     449                return Max(pmax.x-pmin.x,pmax.y-pmin.y);
     450        }/*}}}*/
     451        /*FUNCTION Geometry::GetId(const GeometricalVertex &t){{{1*/
     452        long Geometry::GetId(const GeometricalVertex & t) const  {
     453                return &t - vertices;
     454        }/*}}}*/
     455        /*FUNCTION Geometry::GetId(const GeometricalVertex * t){{{1*/
     456        long Geometry::GetId(const GeometricalVertex * t) const  {
     457                return t - vertices;
     458        }/*}}}*/
     459        /*FUNCTION Geometry::GetId(const GeometricalEdge & t){{{1*/
     460        long Geometry::GetId(const GeometricalEdge & t) const  {
     461                return &t - edges;
     462        }/*}}}*/
     463        /*FUNCTION Geometry::GetId(const GeometricalEdge * t){{{1*/
     464        long Geometry::GetId(const GeometricalEdge * t) const  {
     465                return t - edges;
     466        }/*}}}*/
     467        /*FUNCTION Geometry::GetId(const Curve * c){{{1*/
     468        long Geometry::GetId(const Curve * c) const  {
     469                return c - curves;
     470        }/*}}}*/
     471        /*FUNCTION Geometry::Containing{{{1*/
     472        GeometricalEdge* Geometry::Containing(const R2 P,  GeometricalEdge * start) const {
     473                /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Contening)*/
     474
     475                GeometricalEdge* on =start,* pon=0;
     476                // walk with the cos on geometry
     477                int counter=0;
     478                while(pon != on){ 
     479                        counter++;
     480                        ISSMASSERT(counter<100);
     481                        pon = on;
     482                        R2 A= (*on)[0];
     483                        R2 B= (*on)[1];
     484                        R2 AB = B-A;
     485                        R2 AP = P-A;
     486                        R2 BP = P-B;
     487                        if ( (AB,AP) < 0)
     488                         on = on->Adj[0];
     489                        else if ( (AB,BP)  > 0)
     490                         on = on->Adj[1];
     491                        else
     492                         return on;
     493                }
     494                return on;
     495        }
     496        /*}}}1*/
    402497        /*FUNCTION Geometry::PostRead{{{1*/
    403498        void Geometry::PostRead(){
     
    420515
    421516                        /*build integer coordinates (non unique)
    422                         these coordinates are used by the quadtree to group
    423                         the vertices by groups of 5:
    424                         All the coordinates are transformed to ]0,1[^2
    425                         then, the integer coordinates are computed using
    426                         the transformation ]0,1[^2 -> [0 2^30-1[^2 for a quadtree of depth 30*/
     517                          these coordinates are used by the quadtree to group
     518                          the vertices by groups of 5:
     519                          All the coordinates are transformed to ]0,1[^2
     520                          then, the integer coordinates are computed using
     521                          the transformation ]0,1[^2 -> [0 2^30-1[^2 for a quadtree of depth 30*/
    427522                        vertices[i].i=R2ToI2(vertices[i].r);
    428523
     
    669764                                                        GeometricalVertex *a=(*e)(k0); // begin
    670765                                                        if(curves){
    671                                                                 curves[nbcurves].be=e;
    672                                                                 curves[nbcurves].kb=k0;
     766                                                                curves[nbcurves].FirstEdge=e;
     767                                                                curves[nbcurves].FirstVertexIndex=k0;
    673768                                                        }
    674769                                                        int nee=0;
     
    679774                                                                nb_marked_edges++;
    680775                                                                e->CurveNumber=nbcurves;
    681                                                                 if(curves){
    682                                                                         curves[nbcurves].ee=e;
    683                                                                         curves[nbcurves].ke=k1;
    684                                                                 }
    685 
    686776                                                                GeometricalVertex *b=(*e)(k1);
    687777
    688778                                                                //break if we have reached the other end of the curve
    689779                                                                if (a==b || b->Required()){
     780                                                                        if(curves){
     781                                                                                curves[nbcurves].LastEdge=e;
     782                                                                                curves[nbcurves].LastVertexIndex=k1;
     783                                                                        }
    690784                                                                        break;
    691785                                                                }
     
    706800                        if(step==0) curves=new Curve[nbcurves];
    707801                }
    708                 for(int i=0;i<nbcurves ;i++){
    709                         GeometricalEdge * be=curves[i].be, *eqbe=be;
    710                         //GeometricalEdge * ee=curves[i].ee, *eqee=be;
    711                 }
    712802
    713803                /*clean up*/
     
    716806                delete [] eangle;
    717807
    718         }
    719         /*}}}1*/
    720         /*FUNCTION Geometry::Echo {{{1*/
    721         void Geometry::Echo(void){
    722 
    723                 printf("Geometry:\n");
    724                 printf("   nbv  (number of vertices) : %i\n",nbv);
    725                 printf("   nbe  (number of edges)    : %i\n",nbe);
    726                 printf("   nbsubdomains: %i\n",nbsubdomains);
    727                 printf("   nbcurves: %i\n",nbcurves);
    728                 printf("   vertices: %p\n",vertices);
    729                 printf("   edges: %p\n",edges);
    730                 printf("   quadtree: %p\n",quadtree);
    731                 printf("   subdomains: %p\n",subdomains);
    732                 printf("   curves: %p\n",curves);
    733                 printf("   pmin (x,y): (%g %g)\n",pmin.x,pmin.y);
    734                 printf("   pmax (x,y): (%g %g)\n",pmax.x,pmax.y);
    735                 printf("   coefIcoor: %g\n",coefIcoor);
    736                 printf("   MaxCornerAngle: %g\n",MaxCornerAngle);
    737 
    738                 return;
    739         }
    740         /*}}}*/
    741         /*FUNCTION Geometry::Init{{{1*/
    742         void Geometry::Init(void){
    743                 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/EmptyGeometry)*/
    744 
    745                 NbRef=0;
    746                 nbv=0;
    747                 nbe=0;
    748                 quadtree=NULL;
    749                 curves=NULL;
    750                 edges=NULL;
    751                 vertices=NULL;
    752                 nbsubdomains=0;
    753                 nbcurves=0;
    754                 subdomains=NULL;
    755                 MaxCornerAngle = 10*Pi/180; //default is 10 degres
    756         }
    757         /*}}}1*/
    758         /*FUNCTION Geometry::MinimalHmin{{{1*/
    759         double Geometry::MinimalHmin() {
    760                 /* coeffIcoor = (2^30-1)/D
    761                  * We cannot go beyond hmin = D/2^30 because of the quadtree
    762                  * hmin is therefore approximately 2/coeffIcoor */
    763                 return 2.0/coefIcoor;
    764         }/*}}}*/
    765         /*FUNCTION Geometry::MaximalHmax{{{1*/
    766         double Geometry::MaximalHmax() {
    767                 return Max(pmax.x-pmin.x,pmax.y-pmin.y);
    768         }/*}}}*/
    769         /*FUNCTION Geometry::GetId(const GeometricalVertex &t){{{1*/
    770         long Geometry::GetId(const GeometricalVertex & t) const  {
    771                 return &t - vertices;
    772         }/*}}}*/
    773         /*FUNCTION Geometry::GetId(const GeometricalVertex * t){{{1*/
    774         long Geometry::GetId(const GeometricalVertex * t) const  {
    775                 return t - vertices;
    776         }/*}}}*/
    777         /*FUNCTION Geometry::GetId(const GeometricalEdge & t){{{1*/
    778         long Geometry::GetId(const GeometricalEdge & t) const  {
    779                 return &t - edges;
    780         }/*}}}*/
    781         /*FUNCTION Geometry::GetId(const GeometricalEdge * t){{{1*/
    782         long Geometry::GetId(const GeometricalEdge * t) const  {
    783                 return t - edges;
    784         }/*}}}*/
    785         /*FUNCTION Geometry::GetId(const Curve * c){{{1*/
    786         long Geometry::GetId(const Curve * c) const  {
    787                 return c - curves;
    788         }/*}}}*/
    789         /*FUNCTION Geometry::Containing{{{1*/
    790         GeometricalEdge* Geometry::Containing(const R2 P,  GeometricalEdge * start) const {
    791                 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Contening)*/
    792 
    793                 GeometricalEdge* on =start,* pon=0;
    794                 // walk with the cos on geometry
    795                 int counter=0;
    796                 while(pon != on){ 
    797                         counter++;
    798                         ISSMASSERT(counter<100);
    799                         pon = on;
    800                         R2 A= (*on)[0];
    801                         R2 B= (*on)[1];
    802                         R2 AB = B-A;
    803                         R2 AP = P-A;
    804                         R2 BP = P-B;
    805                         if ( (AB,AP) < 0)
    806                          on = on->Adj[0];
    807                         else if ( (AB,BP)  > 0)
    808                          on = on->Adj[1];
    809                         else
    810                          return on;
    811                 }
    812                 return on;
    813808        }
    814809        /*}}}1*/
  • issm/trunk/src/c/objects/Bamg/Mesh.cpp

    r5397 r5400  
    957957                                        c=bamgopts->metric[i*3+2];
    958958                                        Metric M(a,b,c);
    959                                         MatVVP2x2 Vp(M/coef);
     959                                        EigenMetric Vp(M/coef);
    960960
    961961                                        Vp.Maxh(hmax);
     
    10281028                                        ISSMERROR("ht<=0 || hn<=0");
    10291029                                }
    1030                                 MatVVP2x2 Vp(1/(ht*ht),1/(hn*hn),tg);
     1030                                EigenMetric Vp(1/(ht*ht),1/(hn*hn),tg);
    10311031                                Metric MVp(Vp);
    10321032                                edges[i][j].m.IntersectWith(MVp);
     
    12121212                //loop over all vertices
    12131213                for (int i=0;i<nbv;i++){
    1214                         MatVVP2x2 Vp(vertices[i]);
     1214                        EigenMetric Vp(vertices[i]);
    12151215                        double lmax=Vp.lmax();
    12161216                        Vp*=Min(lminaniso,lmax)/lmax;
     
    21092109                                                // Compute the matrix with abs(eigen value)
    21102110                                                Metric M(dxdx[iv], dxdy[iv], dydy[iv]);
    2111                                                 MatVVP2x2 Vp(M);
     2111                                                EigenMetric Vp(M);
    21122112                                                Vp.Abs();
    21132113                                                M = Vp;
     
    39353935                 D2xD2 B1B1 = B1K.t()*B1K;
    39363936                 Metric MK(B1B1.x.x,B1B1.x.y,B1B1.y.y);
    3937                  MatVVP2x2 VMK(MK);
     3937                 EigenMetric VMK(MK);
    39383938                 alpha2 = Max(alpha2,Max(VMK.lambda1/VMK.lambda2,VMK.lambda2/VMK.lambda1));
    39393939                 double betaK=0;
     
    39503950                         D2xD2 BMB = BK.t()*M*BK;
    39513951                         Metric M1(BMB.x.x,BMB.x.y,BMB.y.y);
    3952                          MatVVP2x2 VM1(M1);
     3952                         EigenMetric VM1(M1);
    39533953                         gammamn=Min3(gammamn,VM1.lambda1,VM1.lambda2);
    39543954                         gammamx=Max3(gammamx,VM1.lambda1,VM1.lambda2);         
     
    52785278                                       
    52795279                                        //printf("Dealing with curve number %i\n",nc);
    5280                                         //printf("edge on geometry is same as GhCurve? %s\n",(ei.GeometricalEdgeHook==Gh.curves[nc].be || ei.GeometricalEdgeHook==Gh.curves[nc].ee)?"yes":"no");
    5281                                         //if(ei.GeometricalEdgeHook==Gh.curves[nc].be || ei.GeometricalEdgeHook==Gh.curves[nc].ee){
    5282                                         //      printf("Do we have the right extremity? curve first vertex -> %s\n",((GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].be)[Gh.curves[nc].kb])?"yes":"no");
    5283                                         //      printf("Do we have the right extremity? curve last  vertex -> %s\n",((GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].ee)[Gh.curves[nc].ke])?"yes":"no");
     5280                                        //printf("edge on geometry is same as GhCurve? %s\n",(ei.GeometricalEdgeHook==Gh.curves[nc].FirstEdge || ei.GeometricalEdgeHook==Gh.curves[nc].LastEdge)?"yes":"no");
     5281                                        //if(ei.GeometricalEdgeHook==Gh.curves[nc].FirstEdge || ei.GeometricalEdgeHook==Gh.curves[nc].LastEdge){
     5282                                        //      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");
     5283                                        //      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");
    52845284                                        //}
    52855285                                        //BUG FIX from original bamg
    52865286                                        /*Check that we are on the same edge and right vertex (0 or 1) */
    5287                                         if(ei.GeometricalEdgeHook==Gh.curves[nc].be  && (GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].be)[Gh.curves[nc].kb]){
     5287                                        if(ei.GeometricalEdgeHook==Gh.curves[nc].FirstEdge  && (GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex]){
    52885288                                                bcurve[nc]=iedge*2+je;
    52895289                                                bfind++;       
    52905290                                        }
    5291                                         else if ((ei.GeometricalEdgeHook==Gh.curves[nc].ee  && (GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].ee)[Gh.curves[nc].ke]) && bcurve[nc]==-1){
     5291                                        else if ((ei.GeometricalEdgeHook==Gh.curves[nc].LastEdge  && (GeometricalVertex *)*ei[je].GeometricalEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex]) && bcurve[nc]==-1){
    52925292                                                bcurve[nc]=iedge*2+je;
    52935293                                                bfind++;       
  • issm/trunk/src/c/objects/Bamg/Metric.cpp

    r5397 r5400  
    3434                                        a[0]*m0.a22 + a[1]*m1.a22 + a[2]*m2.a22);
    3535
    36                 MatVVP2x2 vab(mab);
     36                EigenMetric vab(mab);
    3737
    3838                R2 v1(vab.v.x,vab.v.y);
     
    4949        /*FUNCTION Metric::Metric(double  a,const  Metric ma, double  b,const  Metric mb){{{1*/
    5050        Metric::Metric(double  a,const  Metric ma, double  b,const  Metric mb) {
    51                 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/MatVVP2x2)*/
     51                /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/EigenMetric)*/
    5252
    5353                Metric mab(a*ma.a11+b*mb.a11,a*ma.a21+b*mb.a21,a*ma.a22+b*mb.a22);
    54                 MatVVP2x2 vab(mab);
     54                EigenMetric vab(mab);
    5555
    5656                R2 v1(vab.v.x,vab.v.y);
  • issm/trunk/src/c/objects/Bamg/Metric.h

    r5151 r5400  
    1212
    1313        class Metric;
    14         class MatVVP2x2;
     14        class EigenMetric;
    1515
    1616        class Metric{
     
    2222
    2323                        //friends
    24                         friend class MatVVP2x2;
     24                        friend class EigenMetric;
    2525
    2626                        //functions
    2727                        Metric();
    28                         Metric(const MatVVP2x2);
     28                        Metric(const EigenMetric);
    2929                        Metric(double a);
    3030                        Metric(double a,double b,double c);
     
    5151        };
    5252
    53         class MatVVP2x2{
     53        class EigenMetric{
    5454                public:
    5555
     
    6262
    6363                        //functions
    64                         MatVVP2x2(const Metric );
    65                         MatVVP2x2(double r1,double r2,const D2 vp1);
     64                        EigenMetric(const Metric );
     65                        EigenMetric(double r1,double r2,const D2 vp1);
    6666                        void   Echo();
    6767                        void   Abs();
     
    100100
    101101        //inlines
    102         inline void  MatVVP2x2::BoundAniso2(const double coef){
     102        inline void  EigenMetric::BoundAniso2(const double coef){
    103103                if (coef<=1.00000000001){
    104104                        if (lambda1 < lambda2)
     
    114114                }
    115115        }
    116         inline Metric::Metric(const MatVVP2x2 M) {
     116        inline Metric::Metric(const EigenMetric M) {
    117117                double v00=M.v.x*M.v.x;
    118118                double v11=M.v.y*M.v.y;
Note: See TracChangeset for help on using the changeset viewer.