- Timestamp:
- 09/15/17 18:44:44 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/branches/trunk-larour-NatGeoScience2016/src/c/bamg/Mesh.h
r21759 r22085 38 38 39 39 R2 pmin,pmax; // extrema 40 double coefIcoor; // coef to integer Icoor1;40 double coefIcoor; // coef to integer 41 41 ListofIntersectionTriangles lIntTria; 42 int randomseed; //used for random number generation 42 43 43 44 long NbVerticesOnGeomVertex; … … 76 77 I2 R2ToI2(const R2 & P) const; 77 78 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(); 80 81 void Echo(void); 81 82 void ForceBoundary(); … … 91 92 void MaxSubDivision(double maxsubdiv); 92 93 void NewPoints(Mesh &,BamgOpts* bamgopts,int KeepVertices=1); 93 long InsertNewPoints(long nbvold,long & NbTSwap ,bool random);94 long InsertNewPoints(long nbvold,long & NbTSwap); 94 95 void TrianglesRenumberBySubDomain(bool justcompress=false); 95 96 void SmoothingVertex(int =3,double=0.3); 96 Metric MetricAt (const R2 &) const;97 Metric MetricAt (const R2 &); 97 98 GeomEdge* ProjectOnCurve( Edge & AB, BamgVertex & A, BamgVertex & B,double theta, BamgVertex & R,VertexOnEdge & BR,VertexOnGeom & GR); 98 99 long GetId(const Triangle & t) const; … … 103 104 long GetId(const Edge * t) const; 104 105 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); 106 107 void ReadMesh(int* index,double* x,double* y,int nods,int nels); 107 108 void ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts); … … 113 114 void BuildMetric0(BamgOpts* bamgopts); 114 115 void BuildMetric1(BamgOpts* bamgopts); 115 void AddGeometryMetric(BamgOpts* bamgopts);116 116 void BuildGeometryFromMesh(BamgOpts* bamgopts=NULL); 117 int RandomNumber(int max); 117 118 void ReconstructExistingMesh(); 118 119 … … 143 144 void Triangulate(double* x,double* y,int nods); 144 145 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); 145 150 }; 146 151 … … 149 154 void swap(Triangle *t1,short a1, 150 155 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 156 158 inline AdjacentTriangle Previous(const AdjacentTriangle & ta){ 157 159 return AdjacentTriangle(ta.t,PreviousEdge[ta.a]); … … 166 168 int j=i;i=on->AdjVertexIndex[i];on=on->Adj[j]; 167 169 } 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 185 170 } 186 171 #endif
Note:
See TracChangeset
for help on using the changeset viewer.