Ignore:
Timestamp:
09/15/17 18:44:44 (8 years ago)
Author:
Eric.Larour
Message:

CHG: new bamg version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-larour-NatGeoScience2016/src/c/bamg/Mesh.h

    r21759 r22085  
    3838
    3939                        R2                            pmin,pmax;             // extrema
    40                         double                        coefIcoor;             // coef to integer Icoor1;
     40                        double                        coefIcoor;             // coef to integer
    4141                        ListofIntersectionTriangles   lIntTria;
     42                        int                           randomseed;            //used for random number generation
    4243
    4344                        long                          NbVerticesOnGeomVertex;
     
    7677                        I2 R2ToI2(const R2 & P) const;
    7778                        R2 I2ToR2(const I2 & P) const;
    78                         void AddVertex(BamgVertex & s,Triangle * t,Icoor2 *  =0) ;
    79                         void Insert(bool random);
     79                        void AddVertex(BamgVertex & s,Triangle * t,long long *  =0) ;
     80                        void Insert();
    8081                        void Echo(void);
    8182                        void ForceBoundary();
     
    9192                        void MaxSubDivision(double maxsubdiv);
    9293                        void NewPoints(Mesh &,BamgOpts* bamgopts,int KeepVertices=1);
    93                         long InsertNewPoints(long nbvold,long & NbTSwap,bool random);
     94                        long InsertNewPoints(long nbvold,long & NbTSwap);
    9495                        void TrianglesRenumberBySubDomain(bool justcompress=false);
    9596                        void SmoothingVertex(int =3,double=0.3);
    96                         Metric MetricAt (const R2 &) const;
     97                        Metric MetricAt (const R2 &);
    9798                        GeomEdge* ProjectOnCurve( Edge & AB, BamgVertex &  A, BamgVertex & B,double theta, BamgVertex & R,VertexOnEdge & BR,VertexOnGeom & GR);
    9899                        long GetId(const Triangle & t) const;
     
    103104                        long GetId(const Edge * t) const;
    104105                        BamgVertex* NearestVertex(int i,int j) ;
    105                         Triangle* TriangleFindFromCoord(const I2 & ,Icoor2 [3],Triangle *tstart=0) const;
     106                        Triangle* TriangleFindFromCoord(const I2 & ,long long [3],Triangle *tstart=0);
    106107                        void ReadMesh(int* index,double* x,double* y,int nods,int nels);
    107108                        void ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts);
     
    113114                        void BuildMetric0(BamgOpts* bamgopts);
    114115                        void BuildMetric1(BamgOpts* bamgopts);
    115                         void AddGeometryMetric(BamgOpts* bamgopts);
    116116                        void BuildGeometryFromMesh(BamgOpts* bamgopts=NULL);
     117                        int  RandomNumber(int max);
    117118                        void ReconstructExistingMesh();
    118119
     
    143144                        void Triangulate(double* x,double* y,int nods);
    144145                        void Init(long);
     146                        int ForceEdge(BamgVertex &a, BamgVertex & b,AdjacentTriangle & taret) ;
     147                        int SwapForForcingEdge(BamgVertex   *  & pva ,BamgVertex  * &   pvb ,
     148                                                AdjacentTriangle & tt1,long long & dets1,
     149                                                long long & detsa,long long & detsb, int & nbswap);
    145150        };
    146151
     
    149154        void  swap(Triangle *t1,short a1,
    150155                                Triangle *t2,short a2,
    151                                 BamgVertex *s1,BamgVertex *s2,Icoor2 det1,Icoor2 det2);
    152         int SwapForForcingEdge(BamgVertex   *  & pva ,BamgVertex  * &   pvb ,
    153                                 AdjacentTriangle & tt1,Icoor2 & dets1,
    154                                 Icoor2 & detsa,Icoor2 & detsb, int & nbswap);
    155         int ForceEdge(BamgVertex &a, BamgVertex & b,AdjacentTriangle & taret) ;
     156                                BamgVertex *s1,BamgVertex *s2,long long det1,long long det2);
     157
    156158        inline AdjacentTriangle Previous(const AdjacentTriangle & ta){
    157159                return AdjacentTriangle(ta.t,PreviousEdge[ta.a]);
     
    166168                int j=i;i=on->AdjVertexIndex[i];on=on->Adj[j];
    167169        }
    168         inline double qualite(const BamgVertex &va,const BamgVertex &vb,const BamgVertex &vc){
    169                 double ret;
    170                 I2 ia=va,ib=vb,ic=vc;
    171                 I2 ab=ib-ia,bc=ic-ib,ac=ic-ia;
    172                 Icoor2 deta=Det(ab,ac);
    173                 if (deta <=0) ret = -1;
    174                 else {
    175                         double a = sqrt((double) (ac,ac)),
    176                                          b = sqrt((double) (bc,bc)),
    177                                          c = sqrt((double) (ab,ab)),
    178                                          p = a+b+c;
    179                         double h= Max(Max(a,b),c),ro=deta/p;
    180                         ret = ro/h;
    181                 }
    182                 return ret;
    183         }
    184 
    185170}
    186171#endif
Note: See TracChangeset for help on using the changeset viewer.