Changeset 2981


Ignore:
Timestamp:
02/08/10 12:17:27 (15 years ago)
Author:
Mathieu Morlighem
Message:

Moved MetricAnIso to Metric (no more MetricIso)

Location:
issm/trunk/src/c/Bamgx
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Bamgx/Bamgx.cpp

    r2942 r2981  
    8383                if (verbosity>1) printf("   Generating Metric...\n");
    8484                for(i=0;i<Gh.nbv;i++){
    85                         MetricAnIso M=Gh[i];
     85                        Metric M=Gh[i];
    8686                        MatVVP2x2 Vp(M/coef);
    8787                        Vp.Maxh(hmax);
  • issm/trunk/src/c/Bamgx/Mesh2.h

    r2970 r2981  
    2323namespace bamg {
    2424
    25         const  double Pi =  3.14159265358979323846264338328;
    26         const  float fPi =  3.14159265358979323846264338328;
    27 
    28         extern int hinterpole;
     25        //Some parameters
     26        const double Pi =3.141592653589793238462643383279502884197169399375105820974944592308;
     27        const float  fPi=3.141592653589793238462643383279502884197169399375105820974944592308;
    2928
    3029        inline int BinaryRand(){
     
    3736        }
    3837
     38        //typedef
    3939        typedef P2<Icoor1,Icoor2> I2;
    40         typedef P2xP2<Int2,Int4> I2xI2;
    41         typedef P2<Real8,Real8> R2;
    42         typedef P2<Real4,Real8> R2xR2;
     40        typedef P2xP2<Int2,Int4>  I2xI2;
     41        typedef P2<Real8,Real8>   R2;
     42        typedef P2<Real4,Real8>   R2xR2;
    4343}
    4444
  • issm/trunk/src/c/Bamgx/Metric.h

    r2933 r2981  
    11#ifndef TYPEMETRIX
    2 #define TYPEMETRIX MetricAnIso
     2#define TYPEMETRIX Metric
    33#endif
    44
     
    99        typedef P2xP2<double,double> D2xD2;
    1010
    11         class  MetricAnIso;
     11        class Metric;
    1212        class MatVVP2x2;
    13         class MetricIso;
    14 
    15         typedef TYPEMETRIX Metric;
    1613
    1714
    18         class MetricIso{
    19                 friend class MatVVP2x2;
    20                 Real4 h;
    21                 public:
    22                 MetricIso(Real4 a): h(a){}
    23                 MetricIso(const MetricAnIso M);// {MatVVP2x2 vp(M);h=1/sqrt(Max(vp.lambda1,vp.lambda2));}
    24                 MetricIso(Real8 a11,Real8 a21,Real8 a22);// {*this=MetricAnIso(a11,a21,a22));}
    25                 MetricIso(): h(1) {}; //
    26                 MetricIso(const Real8  a[3],const  MetricIso m0,
    27                                         const  MetricIso m1,const  MetricIso m2 )
    28                   : h(hinterpole
    29                                           ? (a[0]*m0.h+a[1]*m1.h+a[2]*m2.h)
    30                                           : 1/sqrt(a[0]/(m0.h*m0.h)+a[1]/(m1.h*m1.h)+a[2]/(m2.h*m2.h))) {}
    31                 MetricIso(const Real8  a,const  MetricIso ma,
    32                                         const Real8  b,const  MetricIso mb)
    33                   : h(hinterpole
    34                                           ? a*ma.h+b*mb.h
    35                                           :1/sqrt(a/(ma.h*ma.h)+b/(mb.h*mb.h))) {}
    36                 R2 Orthogonal(const R2 A)const {return R2(-h*A.y,h*A.x);}
    37                 R2 Orthogonal(const I2 A)const {return R2(-h*A.y,h*A.x);}
    38                 //  D2 Orthogonal(const D2 A)const {return D2(-h*A.y,h*A.x);}
    39                 Real8 operator()(R2 x) const { return sqrt((x,x))/h;};
    40                 Real8 operator()(R2 x,R2 y) const { return ((x,y))/(h*h);};
    41                 int  IntersectWith(MetricIso M) {int change=0;if (M.h<h) change=1,h=M.h;return change;}
    42                 MetricIso operator*(Real8 c) const {return  MetricIso(h/c);}
    43                 MetricIso operator/(Real8 c) const {return  MetricIso(h*c);}
    44                 Real8 det() const {return 1./(h*h*h*h);}   
    45                 operator D2xD2(){ return D2xD2(1/(h*h),0.,0.,1/(h*h));}
    46                 void     Box(Real4 & hx,Real4 & hy) { hx=h,hy=h;}
    47         };
    48 
    49 
    50         class MetricAnIso{ public:
     15        class Metric{ public:
    5116                friend class MatVVP2x2;
    5217                Real8 a11,a21,a22;
    53                 MetricAnIso(Real8 a): a11(1/(a*a)),a21(0),a22(1/(a*a)){}
    54                 MetricAnIso(Real8 a,Real8 b,Real8 c) :a11(a),a21(b),a22(c){}
    55                 MetricAnIso()  {}; //
    56                 MetricAnIso(const Real8  a[3],const  MetricAnIso m0,
    57                                         const  MetricAnIso m1,const  MetricAnIso m2 );
     18                Metric(Real8 a): a11(1/(a*a)),a21(0),a22(1/(a*a)){}
     19                Metric(Real8 a,Real8 b,Real8 c) :a11(a),a21(b),a22(c){}
     20                Metric()  {}; //
     21                Metric(const Real8  a[3],const  Metric m0,
     22                                        const  Metric m1,const  Metric m2 );
    5823                R2 mul(const R2 x)const {return R2(a11*x.x+a21*x.y,a21*x.x+a22*x.y);}
    5924                Real8 det() const {return a11*a22-a21*a21;} 
     
    6126                R2 Orthogonal(const I2 x){return R2(-(a21*x.x+a22*x.y),a11*x.x+a21*x.y);}
    6227                //  D2 Orthogonal(const D2 x){return D2(-(a21*x.x+a22*x.y),a11*x.x+a21*x.y);}
    63                 MetricAnIso( Real8  a,const  MetricAnIso ma,
    64                                         Real8  b,const  MetricAnIso mb);
    65                 int  IntersectWith(const MetricAnIso M2);
    66                 MetricAnIso operator*(Real8 c) const {Real8 c2=c*c;return  MetricAnIso(a11*c2,a21*c2,a22*c2);}
    67                 MetricAnIso operator/(Real8 c) const {Real8 c2=1/(c*c);return  MetricAnIso(a11*c2,a21*c2,a22*c2);}
     28                Metric( Real8  a,const  Metric ma,
     29                                        Real8  b,const  Metric mb);
     30                int  IntersectWith(const Metric M2);
     31                Metric operator*(Real8 c) const {Real8 c2=c*c;return  Metric(a11*c2,a21*c2,a22*c2);}
     32                Metric operator/(Real8 c) const {Real8 c2=1/(c*c);return  Metric(a11*c2,a21*c2,a22*c2);}
    6833                operator D2xD2(){ return D2xD2(a11,a21,a21,a22);}
    6934
     
    7237                Real8 operator()(R2 x,R2 y) const { return x.x*y.x*a11+(x.x*x.y+x.y*y.x)*a21+x.y*y.y*a22;};
    7338                inline void  Box(Real4 &hx,Real4 &hy) const ; 
    74                 MetricAnIso(const MatVVP2x2);
     39                Metric(const MatVVP2x2);
    7540                void  Echo();
    7641        };
    7742
    7843        class MatVVP2x2{
    79                 friend  class MetricAnIso;
    80                 friend  class MetricIso;
     44                friend  class Metric;
    8145                public:
    8246                double lambda1,lambda2;
     
    9458                void Maxh(double h) {Max(1.0/(h*h));}
    9559                void Isotrope() {lambda1=lambda2=bamg::Max(lambda1,lambda2);}
    96                 MatVVP2x2(const MetricAnIso );
    97                 MatVVP2x2(const MetricIso M) :  lambda1(1/(M.h*M.h)),lambda2(1/(M.h*M.h)),v(1,0) {}
     60                MatVVP2x2(const Metric );
    9861                Real8 hmin() const {return sqrt(1/bamg::Max3(lambda1,lambda2,1e-30));}
    9962                Real8 hmax() const {return sqrt(1/bamg::Max(bamg::Min(lambda1,lambda2),1e-30));}
     
    12285        }
    12386
    124         void  SimultaneousMatrixReduction( MetricAnIso M1,  MetricAnIso M2,D2xD2 &V);
     87        void  SimultaneousMatrixReduction( Metric M1,  Metric M2,D2xD2 &V);
    12588
    126         inline MetricAnIso::MetricAnIso(const MatVVP2x2 M) {
     89        inline Metric::Metric(const MatVVP2x2 M) {
    12790                //     recompose M in: M = V^t lambda V
    12891                //     V = ( v,v^\perp)
     
    13699          }
    137100
    138         inline   void  MetricAnIso::Box(Real4 &hx,Real4 &hy) const {
     101        inline   void  Metric::Box(Real4 &hx,Real4 &hy) const {
    139102                Real8 d=  a11*a22-a21*a21;
    140103                hx = sqrt(a22/d);
     
    142105        }
    143106
    144         inline MetricIso::MetricIso(const MetricAnIso M)
    145           {MatVVP2x2 vp(M);h=1/sqrt(Max(vp.lambda1,vp.lambda2));}
    146 
    147         inline  MetricIso::MetricIso(Real8 a11,Real8 a21,Real8 a22)
    148           {MatVVP2x2 vp(MetricAnIso(a11,a21,a22));h=1/sqrt(Max(vp.lambda1,vp.lambda2));}
    149 
    150 
    151 
    152107        class SaveMetricInterpole {
    153                 friend Real8 LengthInterpole(const MetricAnIso ,const  MetricAnIso , R2 );
    154                 friend Real8 abscisseInterpole(const MetricAnIso ,const  MetricAnIso , R2 ,Real8 ,int );
     108                friend Real8 LengthInterpole(const Metric ,const  Metric , R2 );
     109                friend Real8 abscisseInterpole(const Metric ,const  Metric , R2 ,Real8 ,int );
    155110                int opt;
    156111                Real8 lab;
     
    160115        extern SaveMetricInterpole  LastMetricInterpole; // for optimization
    161116
    162         Real8 LengthInterpole(const MetricAnIso Ma,const  MetricAnIso Mb, R2 AB);
    163         Real8 abscisseInterpole(const MetricAnIso Ma,const  MetricAnIso Mb, R2 AB,Real8 s,int optim=0);
     117        Real8 LengthInterpole(const Metric Ma,const  Metric Mb, R2 AB);
     118        Real8 abscisseInterpole(const Metric Ma,const  Metric Mb, R2 AB,Real8 s,int optim=0);
    164119
    165120        inline Real8 LengthInterpole(Real8 la,Real8 lb)
  • issm/trunk/src/c/Bamgx/QuadTree.h

    r2980 r2981  
    66
    77        const int MaxDeep = 30;
    8         typedef  long IntQuad;
     8        typedef long IntQuad;
    99        //long int 1, bitwise operation: 8L = 00001000 << 2L -> 00100000 shifted left by 2
    1010        const IntQuad MaxISize = ( 1L << MaxDeep);
     
    1616                                public:
    1717                                        long n;
     18                                        //contains only one object form the list (either Vertex or QuadTreeBox)
     19                                        // if n < 4 => Vertex else =>  QuadTreeBox;
    1820                                        union{
    19                                                 //contains only one object form the list (either Vertex or QuadTreeBox)
    20                                                 // if n < 4 => Vertex else =>  QuadTreeBox;
    2121                                                QuadTreeBox* b[4];
    2222                                                Vertex* v[4];
    2323                                        };
    24                         }; // end class
     24                        };
    2525                        class StorageQuadTreeBox {
    2626                                public:
     
    3434                                        }
    3535                                        long  SizeOf() const {return len*sizeof(QuadTreeBox)+sizeof(StorageQuadTreeBox)+ (n?n->SizeOf():0);}
    36                         }; // end class
     36                        };
    3737                        StorageQuadTreeBox* sb;
    38                         long  lenStorageQuadTreeBox;
     38                        long                lenStorageQuadTreeBox;
    3939
    4040                public:
     41
     42                        //fields
    4143                        QuadTreeBox* root;
    42                         Triangles* th;
    43                         long NbQuadTreeBox,NbVertices;
    44                         long NbQuadTreeBoxSearch,NbVerticesSearch;
     44                        Triangles*   th;
     45
     46                        //functions
     47                        ~QuadTree();
     48                        QuadTree(Triangles * t,long nbv=-1);
     49                        QuadTree();
     50                        long    NbQuadTreeBox,NbVertices;
     51                        long    NbQuadTreeBoxSearch,NbVerticesSearch;
    4552                        Vertex* NearestVertex(Icoor1 i,Icoor1 j);
    46                         Vertex*  NearestVertexWithNormal(Icoor1 i,Icoor1 j);
     53                        Vertex* NearestVertexWithNormal(Icoor1 i,Icoor1 j);
    4754                        Vertex* ToClose(Vertex & ,Real8 ,Icoor1,Icoor1);
    48                         long SizeOf() const {return sizeof(QuadTree)+sb->SizeOf();}
    49                         void  Add( Vertex & w);
     55                        long    SizeOf() const {return sizeof(QuadTree)+sb->SizeOf();}
     56                        void    Add( Vertex & w);
    5057                        QuadTreeBox* NewQuadTreeBox(){
    5158                                if(! (sb->bc<sb->be)) sb=new StorageQuadTreeBox(lenStorageQuadTreeBox,sb);
     
    5461                                return sb->bc++;
    5562                        }
    56                         ~QuadTree();
    57                         QuadTree(Triangles * t,long nbv=-1);
    58                         QuadTree();
    5963        };
    6064}
  • issm/trunk/src/c/Bamgx/R2.h

    r2932 r2981  
    11namespace bamg {
     2
    23        template <class R,class RR> class P2xP2;
    3 
    44        template <class R,class RR>
    55          class P2 {
     
    1515                          P2 (R a,R b)  :x(a),y(b)  {}
    1616                          P2 (P2 A,P2 B) : x(B.x-A.x),y(B.y-A.y) {}
    17                           P2<R,RR>   operator+(const P2<R,RR> & cc) const {return P2<R,RR>(x+cc.x,y+cc.y);}
    18                           P2<R,RR>   operator-(const P2<R,RR> & cc) const {return P2<R,RR>(x-cc.x,y-cc.y);}
    19                           P2<R,RR>   operator-()  const{return P2<R,RR>(-x,-y);}
    20                           RR   operator,(const P2<R,RR> & cc) const {return  (RR) x* (RR) cc.x+(RR) y* (RR) cc.y;} // produit scalaire
    21                           P2<R,RR>   operator*(R  cc) const {return P2<R,RR>(x*cc,y*cc);}
    22                           P2<R,RR>   operator/(R  cc) const {return P2<R,RR>(x/cc,y/cc);}
    23                           P2<R,RR>  operator+=(const  P2<R,RR> & cc) {x += cc.x;y += cc.y;return *this;}
    24                           P2<R,RR>  operator/=(const  R r) {x /= r;y /= r;return *this;}
    25                           P2<R,RR>  operator*=(const  R r) {x *= r;y *= r;return *this;}
    26                           P2<R,RR>  operator-=(const  P2<R,RR> & cc) {x -= cc.x;y -= cc.y;return *this;}
     17                          RR       operator,(const P2<R,RR> & cc) const {return  (RR) x* (RR) cc.x+(RR) y* (RR) cc.y;} //scalar product
     18                          P2<R,RR> operator+(const P2<R,RR> & cc) const {return P2<R,RR>(x+cc.x,y+cc.y);}
     19                          P2<R,RR> operator-(const P2<R,RR> & cc) const {return P2<R,RR>(x-cc.x,y-cc.y);}
     20                          P2<R,RR> operator-()  const{return P2<R,RR>(-x,-y);}
     21                          P2<R,RR> operator*(R  cc) const {return P2<R,RR>(x*cc,y*cc);}
     22                          P2<R,RR> operator/(R  cc) const {return P2<R,RR>(x/cc,y/cc);}
     23                          P2<R,RR> operator+=(const  P2<R,RR> & cc) {x += cc.x;y += cc.y;return *this;}
     24                          P2<R,RR> operator/=(const  R r) {x /= r;y /= r;return *this;}
     25                          P2<R,RR> operator*=(const  R r) {x *= r;y *= r;return *this;}
     26                          P2<R,RR> operator-=(const  P2<R,RR> & cc) {x -= cc.x;y -= cc.y;return *this;}
    2727          };
    2828
    2929        template <class R,class RR>
    30           class P2xP2 { // x ligne 1 y ligne2
    31 
    32                   friend P2<R,RR> operator*(P2<R,RR> c,P2xP2<R,RR> cc)
    33                          {return P2<R,RR>(c.x*cc.x.x + c.y*cc.y.x, c.x*cc.x.y + c.y*cc.y.y);}
    34 
    35 
     30          class P2xP2 {
     31                  friend P2<R,RR> operator*(P2<R,RR> c,P2xP2<R,RR> cc){
     32                          return P2<R,RR>(c.x*cc.x.x + c.y*cc.y.x, c.x*cc.x.y + c.y*cc.y.y);
     33                  }
    3634                  public:
    3735                  P2<R,RR> x,y;
     36
     37                  //functions
    3838                  void Echo(){
    3939                          printf("Member of P2xP2:\n");
     
    4545                  P2xP2 (P2<R,RR> a,P2<R,RR> b,P2<R,RR> c ): x(b-a),y(c-a) {}
    4646                  P2xP2 (R xx,R xy,R yx,R yy) :x(xx,xy),y(yx,yy) {}
    47                   P2<R,RR> operator*(const P2<R,RR> c) const {return P2<R,RR>(x.x*c.x + x.y*c.y, y.x*c.x + y.y*c.y);}
    48                   P2xP2<R,RR>  operator*(P2xP2<R,RR> c) const
    49                          { return  P2xP2<R,RR>(x.x*c.x.x + x.y*c.y.x,
     47                  RR          det() const {return (RR) x.x* (RR) y.y - (RR) x.y * (RR) y.x;}
     48                  P2xP2<R,RR> inv()  const{
     49                          RR d = (*this).det();
     50                          return P2xP2<R,RR>((R)( y.y /d) ,(R)(-x.y/d),(R)( -y.x/d) ,(R)( x.x/d) );
     51                         };
     52                  P2xP2<R,RR> t()  {return P2xP2<R,RR>(x.x,y.x,x.y,y.y);} //transposer
     53                  P2<R,RR>    tx() {return P2<R,RR>(x.x,y.x);}
     54                  P2<R,RR>    ty() {return P2<R,RR>(x.y,y.y);}
     55
     56                  //Operators
     57                  P2<R,RR>     operator*(const P2<R,RR> c) const {return P2<R,RR>(x.x*c.x + x.y*c.y, y.x*c.x + y.y*c.y);}
     58                  P2xP2<R,RR>  operator*(P2xP2<R,RR> c) const{
     59                          return  P2xP2<R,RR>(x.x*c.x.x + x.y*c.y.x,
    5060                                                 x.x*c.x.y + x.y*c.y.y,
    5161                                                 y.x*c.x.x + y.y*c.y.x,
    52                                                  y.x*c.x.y + y.y*c.y.y);}
    53                   RR det() const {return (RR) x.x* (RR) y.y - (RR) x.y * (RR) y.x;}
    54                   P2xP2<R,RR> inv()  const
    55                          { RR d = (*this).det();
    56                           return P2xP2<R,RR>((R)( y.y /d) ,(R)(-x.y/d),(R)( -y.x/d) ,(R)( x.x/d) );
    57                          };
    58                   P2xP2<R,RR> t() {return P2xP2<R,RR>(x.x,y.x,x.y,y.y);} //transposer
    59                   P2<R,RR>tx() {return P2<R,RR>(x.x,y.x);}
    60                   P2<R,RR>ty() {return P2<R,RR>(x.y,y.y);}
    61 
     62                                                 y.x*c.x.y + y.y*c.y.y);
     63                  }
    6264          }; 
    6365
     66        //inline functions
    6467        template  <class R,class RR> 
    6568          inline RR Det(const P2<R,RR> x,const P2<R,RR> y) {
    66                   return (RR) x.x * (RR) y.y - (RR) x.y * (RR) y.x ;}
     69                  return (RR) x.x * (RR) y.y - (RR) x.y * (RR) y.x ;
     70          }
    6771
    6872        template  <class R,class RR> 
    6973          inline RR Area2 (const P2<R,RR> a,const P2<R,RR> b,const P2<R,RR> c) {
    70                   return Det(b-a,c-a) ;}
     74                  return Det(b-a,c-a) ;
     75          }
    7176
    7277        template  <class R,class RR> 
    7378          inline R Norme1 (const P2<R,RR> x) {
    74                   return (Abs(x.x)+Abs(x.y)) ;}
     79                  return (Abs(x.x)+Abs(x.y)) ;
     80          }
    7581
    7682        template  <class R,class RR> 
    7783          inline R NormeInfini (const P2<R,RR> x) {
    78                   return Max(Abs(x.x),Abs(x.y)) ;}
     84                  return Max(Abs(x.x),Abs(x.y)) ;
     85          }
    7986
    8087        template  <class R,class RR> 
    8188          inline RR Norme2_2 (const P2<R,RR> x) {
    82                   return (RR)x.x*(RR)x.x + (RR)x.y*(RR)x.y ;}
     89                  return (RR)x.x*(RR)x.x + (RR)x.y*(RR)x.y ;
     90          }
    8391
    8492        template  <class R,class RR> 
    8593          inline RR Norme2 (const P2<R,RR> x) {
    86                   return sqrt((RR)x.x*(RR)x.x + (RR)x.y*(RR)x.y) ;}
     94                  return sqrt((RR)x.x*(RR)x.x + (RR)x.y*(RR)x.y) ;
     95          }
    8796
    8897        template  <class R,class RR> 
    8998          inline P2<R,RR> Orthogonal (const P2<R,RR> x) {
    90                   return  P2<R,RR>(-x.y,x.x);}
     99                  return  P2<R,RR>(-x.y,x.x);
     100          }
    91101}
  • issm/trunk/src/c/Bamgx/SetOfE4.h

    r2958 r2981  
    44namespace bamg {
    55
    6         class SetOfEdges4 ;
     6        class SetOfEdges4;
     7
    78        class Int4Edge{
    89                friend class SetOfEdges4;
     
    2829                Int4 j(Int4 k){return Edges[k].j;}
    2930                Int4 newarete(Int4 k){return NbOfEdges == k+1;}
     31
     32                //operators
    3033                Int4Edge & operator[](Int4 k){return  Edges[k];}
    3134        };
  • issm/trunk/src/c/Bamgx/objects/MatVVP2x2.cpp

    r2928 r2981  
    1818
    1919        /*Constructor*/
    20         /*FUNCTION MatVVP2x2::MatVVP2x2(const MetricAnIso M){{{1*/
    21         MatVVP2x2::MatVVP2x2(const MetricAnIso M){
     20        /*FUNCTION MatVVP2x2::MatVVP2x2(const Metric M){{{1*/
     21        MatVVP2x2::MatVVP2x2(const Metric M){
    2222                double a11=M.a11,a21=M.a21,a22=M.a22;
    2323                const double eps = 1.e-5;
  • issm/trunk/src/c/Bamgx/objects/MetricAnIso.cpp

    r2933 r2981  
    1313
    1414#undef __FUNCT__
    15 #define __FUNCT__ "MetricAnIso"
     15#define __FUNCT__ "Metric"
    1616
    1717using namespace std;
     
    2222
    2323        /*Constructor/Destructor*/
    24         /*FUNCTION MetricAnIso::MetricAnIso(const Real8  a[3],const  MetricAnIso m0, const  MetricAnIso m1,const  MetricAnIso  m2 ){{{1*/
    25         MetricAnIso::MetricAnIso(const Real8  a[3],const  MetricAnIso m0, const  MetricAnIso m1,const  MetricAnIso m2 ){
    26                 MetricAnIso mab(a[0]*m0.a11 + a[1]*m1.a11 + a[2]*m2.a11,
     24        /*FUNCTION Metric::Metric(const Real8  a[3],const  Metric m0, const  Metric m1,const  Metric  m2 ){{{1*/
     25        Metric::Metric(const Real8  a[3],const  Metric m0, const  Metric m1,const  Metric m2 ){
     26                Metric mab(a[0]*m0.a11 + a[1]*m1.a11 + a[2]*m2.a11,
    2727                                        a[0]*m0.a21 + a[1]*m1.a21 + a[2]*m2.a21,
    2828                                        a[0]*m0.a22 + a[1]*m1.a22 + a[2]*m2.a22);
     
    4141        }
    4242        /*}}}1*/
    43         /*FUNCTION MetricAnIso::MetricAnIso( Real8  a,const  MetricAnIso ma, Real8  b,const  MetricAnIso mb){{{1*/
    44         MetricAnIso::MetricAnIso( Real8  a,const  MetricAnIso ma, Real8  b,const  MetricAnIso mb) {
    45                 MetricAnIso mab(a*ma.a11+b*mb.a11,a*ma.a21+b*mb.a21,a*ma.a22+b*mb.a22);
     43        /*FUNCTION Metric::Metric( Real8  a,const  Metric ma, Real8  b,const  Metric mb){{{1*/
     44        Metric::Metric( Real8  a,const  Metric ma, Real8  b,const  Metric mb) {
     45                Metric mab(a*ma.a11+b*mb.a11,a*ma.a21+b*mb.a21,a*ma.a22+b*mb.a22);
    4646                MatVVP2x2 vab(mab);
    4747
     
    5959
    6060        /*Methods*/
    61         /*FUNCTION MetricAnIso::Echo {{{1*/
    62 
    63         void MetricAnIso::Echo(void){
    64 
    65                 printf("MetricAnIso:\n");
     61        /*FUNCTION Metric::Echo {{{1*/
     62
     63        void Metric::Echo(void){
     64
     65                printf("Metric:\n");
    6666                printf("   [a11 a21 a22]: [%g %g %g]\n",a11,a21,a22);
    6767
     
    6969        }
    7070        /*}}}*/
    71         /*FUNCTION MetricAnIso::IntersectWith{{{1*/
    72         int MetricAnIso::IntersectWith(const MetricAnIso M2) {
     71        /*FUNCTION Metric::IntersectWith{{{1*/
     72        int Metric::IntersectWith(const Metric M2) {
    7373                /*Get a new metric from an existing metric (M1=this)
    7474                 * and a new metric given in input M2 using a
     
    8888
    8989                int         change=0;
    90                 MetricAnIso &M1=*this;
     90                Metric &M1=*this;
    9191                D2xD2       P;
    9292
     
    123123        /*Intermediary*/
    124124        /*FUNCTION LengthInterpole{{{1*/
    125         Real8 LengthInterpole(const MetricAnIso Ma,const  MetricAnIso Mb, R2 AB) {
     125        Real8 LengthInterpole(const Metric Ma,const  Metric Mb, R2 AB) {
    126126                Real8 k=1./2.;
    127127                int level=0;
     
    189189        /*}}}1*/
    190190        /*FUNCTION SimultaneousMatrixReduction{{{1*/
    191         void SimultaneousMatrixReduction( MetricAnIso M1,  MetricAnIso M2, D2xD2 &V) {
     191        void SimultaneousMatrixReduction( Metric M1,  Metric M2, D2xD2 &V) {
    192192                /*In this routine we must return a matrix V that is composed of the
    193193                 * eigen vectors of N=inv(M1) M2.
     
    292292        /*}}}1*/
    293293        /*FUNCTION abscisseInterpole{{{1*/
    294         Real8 abscisseInterpole(const MetricAnIso Ma,const  MetricAnIso Mb, R2 AB,Real8 s,int optim) {
     294        Real8 abscisseInterpole(const Metric Ma,const  Metric Mb, R2 AB,Real8 s,int optim) {
    295295                if(!optim)  LengthInterpole(Ma,Mb,AB);
    296296                Real8 l  = s* LastMetricInterpole.lab,r;
  • issm/trunk/src/c/Bamgx/objects/Triangles.cpp

    r2977 r2981  
    773773                                        b=bamgopts->metric[i*3+1];
    774774                                        c=bamgopts->metric[i*3+2];
    775                                         MetricAnIso M(a,b,c);
     775                                        Metric M(a,b,c);
    776776                                        MatVVP2x2 Vp(M/coef);
    777777
     
    38343834                                        D2xD2 D(maxsubdiv2,0,0,lc);
    38353835                                        D2xD2 MM = Rt1*D*Rt1.t();
    3836                                         v0.m =  M = MetricAnIso(MM.x.x,MM.y.x,MM.y.y);
     3836                                        v0.m =  M = Metric(MM.x.x,MM.y.x,MM.y.y);
    38373837                                        nbchange++;
    38383838                                  }
     
    38473847                                        D2xD2 D(maxsubdiv2,0,0,lc);
    38483848                                        D2xD2  MM = Rt1*D*Rt1.t();
    3849                                         v1.m =  M = MetricAnIso(MM.x.x,MM.y.x,MM.y.y);
     3849                                        v1.m =  M = Metric(MM.x.x,MM.y.x,MM.y.y);
    38503850                                        nbchange++;
    38513851                                  }
     
    44314431                 D2xD2 BK =  B_K*B1r;
    44324432                 D2xD2 B1B1 = B1K.t()*B1K;
    4433                  MetricAnIso MK(B1B1.x.x,B1B1.x.y,B1B1.y.y);
     4433                 Metric MK(B1B1.x.x,B1B1.x.y,B1B1.y.y);
    44344434                 MatVVP2x2 VMK(MK);
    44354435                 alpha2 = Max(alpha2,Max(VMK.lambda1/VMK.lambda2,VMK.lambda2/VMK.lambda1));
     
    44424442                         hmax=Max(hmax,he);
    44434443                         Vertex & v=K[j];
    4444                          D2xD2 M((MetricAnIso)v);
     4444                         D2xD2 M((Metric)v);
    44454445                         betaK += sqrt(M.det());
    44464446
    44474447                         D2xD2 BMB = BK.t()*M*BK;
    4448                          MetricAnIso M1(BMB.x.x,BMB.x.y,BMB.y.y);
     4448                         Metric M1(BMB.x.x,BMB.x.y,BMB.y.y);
    44494449                         MatVVP2x2 VM1(M1);
    44504450                         gammamn=Min3(gammamn,VM1.lambda1,VM1.lambda2);
Note: See TracChangeset for help on using the changeset viewer.