[20498] | 1 | Index: ../trunk-jpl/src/c/bamg/BamgVertex.h
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/bamg/BamgVertex.h (revision 19292)
|
---|
| 4 | +++ ../trunk-jpl/src/c/bamg/BamgVertex.h (revision 19293)
|
---|
| 5 | @@ -47,6 +47,7 @@
|
---|
| 6 | void MetricFromHessian(const double Hxx,const double Hyx, const double Hyy, const double smin,const double smax,const double s,const double err,BamgOpts* bamgopts);
|
---|
| 7 | void Echo();
|
---|
| 8 | int GetReferenceNumber() const;
|
---|
| 9 | + I2 GetIntegerCoordinates() const{return this->i;};// avoid operator I2()
|
---|
| 10 | long Optim(int =1,int =0);
|
---|
| 11 |
|
---|
| 12 | //inline functions
|
---|
| 13 | Index: ../trunk-jpl/src/c/bamg/Triangle.h
|
---|
| 14 | ===================================================================
|
---|
| 15 | --- ../trunk-jpl/src/c/bamg/Triangle.h (revision 19292)
|
---|
| 16 | +++ ../trunk-jpl/src/c/bamg/Triangle.h (revision 19293)
|
---|
| 17 | @@ -64,6 +64,7 @@
|
---|
| 18 | double qualite() ;
|
---|
| 19 | void Set(const Triangle &,const Mesh &,Mesh &);
|
---|
| 20 | int In(BamgVertex *v) const { return vertices[0]==v || vertices[1]==v || vertices[2]==v ;}
|
---|
| 21 | + BamgVertex* GetVertex(int i){return vertices[i];}; // FIXME: this is used to avoid BamgVertex * operator()
|
---|
| 22 |
|
---|
| 23 | };
|
---|
| 24 |
|
---|
| 25 | Index: ../trunk-jpl/src/c/bamg/Mesh.cpp
|
---|
| 26 | ===================================================================
|
---|
| 27 | --- ../trunk-jpl/src/c/bamg/Mesh.cpp (revision 19292)
|
---|
| 28 | +++ ../trunk-jpl/src/c/bamg/Mesh.cpp (revision 19293)
|
---|
| 29 | @@ -1098,7 +1098,7 @@
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
| 32 | /*}}}*/
|
---|
| 33 | - void Mesh::AddVertex( BamgVertex &s,Triangle* t, Icoor2* det3) {/*{{{*/
|
---|
| 34 | + void Mesh::AddVertex( BamgVertex &s,Triangle* t, Icoor2* det3){/*{{{*/
|
---|
| 35 | /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Add)*/
|
---|
| 36 | // -------------------------------
|
---|
| 37 | // s2
|
---|
| 38 | @@ -1123,9 +1123,9 @@
|
---|
| 39 | int iedge;
|
---|
| 40 |
|
---|
| 41 | /*three vertices of t*/
|
---|
| 42 | - BamgVertex &s0=(*t)[0];
|
---|
| 43 | - BamgVertex &s1=(*t)[1];
|
---|
| 44 | - BamgVertex &s2=(*t)[2];
|
---|
| 45 | + BamgVertex* s0=t->GetVertex(0);
|
---|
| 46 | + BamgVertex* s1=t->GetVertex(1);
|
---|
| 47 | + BamgVertex* s2=t->GetVertex(2);
|
---|
| 48 |
|
---|
| 49 | //determinant of t
|
---|
| 50 | Icoor2 detOld=t->det;
|
---|
| 51 | @@ -1133,7 +1133,7 @@
|
---|
| 52 | /* infvertexindex = index of the infinite vertex (NULL)
|
---|
| 53 | if no infinite vertex (NULL) infvertexindex=-1
|
---|
| 54 | else if v_i is infinite, infvertexindex=i*/
|
---|
| 55 | - int infvertexindex = &s0 ? (( &s1 ? ( &s2 ? -1 : 2) : 1 )) : 0;
|
---|
| 56 | + int infvertexindex = s0 ? ((s1? (s2?-1:2):1)):0;
|
---|
| 57 |
|
---|
| 58 | //some checks
|
---|
| 59 | if(((infvertexindex <0 ) && (detOld <0)) || ((infvertexindex >=0) && (detOld >0)) ){
|
---|
| 60 | @@ -1146,14 +1146,14 @@
|
---|
| 61 | det3 = det3local;
|
---|
| 62 | //if no infinite vertex
|
---|
| 63 | if (infvertexindex<0 ) {
|
---|
| 64 | - det3[0]=bamg::det(s ,s1,s2);
|
---|
| 65 | - det3[1]=bamg::det(s0,s ,s2);
|
---|
| 66 | - det3[2]=bamg::det(s0,s1,s );}
|
---|
| 67 | + det3[0]=bamg::det(s .GetIntegerCoordinates(),s1->GetIntegerCoordinates(),s2->GetIntegerCoordinates());
|
---|
| 68 | + det3[1]=bamg::det(s0->GetIntegerCoordinates(),s .GetIntegerCoordinates(),s2->GetIntegerCoordinates());
|
---|
| 69 | + det3[2]=bamg::det(s0->GetIntegerCoordinates(),s1->GetIntegerCoordinates(),s.GetIntegerCoordinates());}
|
---|
| 70 | else {
|
---|
| 71 | // one of &s1 &s2 &s0 is NULL
|
---|
| 72 | - det3[0]= &s0 ? -1 : bamg::det(s ,s1,s2) ;
|
---|
| 73 | - det3[1]= &s1 ? -1 : bamg::det(s0,s ,s2) ;
|
---|
| 74 | - det3[2]= &s2 ? -1 : bamg::det(s0,s1,s ) ;
|
---|
| 75 | + det3[0]= s0 ? -1 : bamg::det(s.GetIntegerCoordinates(),s1->GetIntegerCoordinates(),s2->GetIntegerCoordinates()) ;
|
---|
| 76 | + det3[1]= s1 ? -1 : bamg::det(s0->GetIntegerCoordinates(),s.GetIntegerCoordinates(),s2->GetIntegerCoordinates()) ;
|
---|
| 77 | + det3[2]= s2 ? -1 : bamg::det(s0->GetIntegerCoordinates(),s1->GetIntegerCoordinates(),s.GetIntegerCoordinates()) ;
|
---|
| 78 | }
|
---|
| 79 | }
|
---|
| 80 |
|
---|
| 81 | @@ -3799,15 +3799,15 @@
|
---|
| 82 | // computation of the det
|
---|
| 83 | int number_of_errors=0;
|
---|
| 84 | for (i=0;i<nbt;i++) {
|
---|
| 85 | - BamgVertex & v0 = triangles[i][0];
|
---|
| 86 | - BamgVertex & v1 = triangles[i][1];
|
---|
| 87 | - BamgVertex & v2 = triangles[i][2];
|
---|
| 88 | + BamgVertex* v0 = triangles[i](0);
|
---|
| 89 | + BamgVertex* v1 = triangles[i](1);
|
---|
| 90 | + BamgVertex* v2 = triangles[i](2);
|
---|
| 91 |
|
---|
| 92 | //If this is not a boundary triangle
|
---|
| 93 | - if ( &v0 && &v1 && &v2 ){
|
---|
| 94 | + if (v0 && v1 && v2){
|
---|
| 95 |
|
---|
| 96 | /*Compute determinant*/
|
---|
| 97 | - triangles[i].det= det(v0,v1,v2);
|
---|
| 98 | + triangles[i].det= det(v0->GetIntegerCoordinates(),v1->GetIntegerCoordinates(),v2->GetIntegerCoordinates());
|
---|
| 99 |
|
---|
| 100 | /*Check that determinant is positive*/
|
---|
| 101 | if (triangles[i].det <=0){
|
---|