Changeset 2814
- Timestamp:
- 01/13/10 09:51:40 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Bamgx/Bamgx.h
r2790 r2814 12 12 13 13 #endif /* _BAMGX_H */ 14 15 -
issm/trunk/src/c/Bamgx/Mesh2.cpp
r2813 r2814 239 239 } 240 240 241 TriangleAdjacent Triangle::FindBoundaryEdge(int i) const242 {243 // turn around the vertex ns[i] also call s244 Triangle *t = (Triangle *) this , *ttc;245 int k=0,j = EdgesVertexTriangle[i][0],jc;246 int exterieur = !link ;247 248 do249 {250 int exterieurp = exterieur;251 k++;252 ttc = t->at[j];253 exterieur = !ttc->link;254 if (exterieur+exterieurp == 1)255 return TriangleAdjacent(t,j);256 jc = NextEdge[t->aa[j]&3];257 t = ttc;258 j = NextEdge[jc];259 assert(k<2000);260 } while ( (this!= t));261 return TriangleAdjacent(0,0);262 263 }264 265 266 241 TriangleAdjacent CloseBoundaryEdgeV2(I2 C,Triangle *t, double &a,double &b) 267 242 { … … 431 406 const R2 &A,const R2 &B,int nbegin) 432 407 { // SplitEdge 433 // if(SHOW) cout << " splitedge " << A << B << " " << nbegin << endl;434 408 Triangle *tbegin, *t; 435 409 … … 454 428 init(); 455 429 t=tbegin = Bh.FindTriangleContening(a,deta); 456 // if(SHOW) cout <<t << " " << Real8(deta[0])/t->det<< " " << Real8(deta[1])/t->det457 // << " " << Real8(deta[2])/t->det << endl;458 430 if( t->det>=0) 459 431 ilast=NewItem(t,Real8(deta[0])/t->det,Real8(deta[1])/t->det,Real8(deta[2])/t->det); … … 489 461 deti = bamg::det(a,b,vi); 490 462 detj = bamg::det(a,b,vj); 491 // if(SHOW) { penthickness(3);492 // Move(vi);Line(vj);CurrentTh->inquire();penthickness(1);493 // cout << Bh.Number(tbegin) << " " << Bh.Number(t) << " i= " << i <<" j= " << j << " k=" << k494 // << " deti= " << deti << " detj= " << detj495 // << " v = " << Bh.Number((*t)[i]) << (*t)[i].r << " " << Bh.Number((*t)[j]) << (*t)[j].r << endl;}496 463 if (deti>0) // go to i direction on gamma 497 464 ocut = PreviousEdge[ocut]; … … 537 504 ba[i] = -deti/dij; 538 505 ba[k] = 0; 539 // if(SHOW) cout << i << " " << j << " " << k << " " << ba[i] << " " << ba[j] << endl;540 506 ilast=NewItem(t,ba[0],ba[1],ba[2]); } 541 507 } // outside departure -
issm/trunk/src/c/Bamgx/Mesh2.h
r2813 r2814 50 50 #endif 51 51 52 extern int SHOW;53 52 #include "meshtype.h" 54 55 53 #include "error.hpp" 56 57 58 54 #include "R2.h" 59 55 60 56 namespace bamg { 61 62 63 57 64 58 const double Pi = 3.14159265358979323846264338328; … … 66 60 67 61 extern int hinterpole; 68 69 62 70 63 typedef P2<Icoor1,Icoor2> I2; … … 82 75 typedef P2xP2<Int2,Int4> I2xI2; 83 76 typedef P2<Real4,Real8> R2xR2; 84 85 77 } 86 78 … … 98 90 register Icoor2 cax = c.x - a.x ,cay = c.y - a.y; 99 91 return bax*cay - bay*cax;} 100 101 92 102 93 … … 835 826 void BoundAnisotropy(Real8 anisomax,double hminaniso= 1e-100) ; 836 827 void MaxSubDivision(Real8 maxsubdiv); 837 void WriteMetric(std::ostream &,int iso) ;838 828 Edge** MakeGeometricalEdgeToEdge(); 839 829 void SetVertexFieldOn(); … … 873 863 874 864 void ReadMetric(BamgOpts* bamgopts,const Real8 hmin,const Real8 hmax,const Real8 coef); 865 void WriteMetric(BamgOpts* bamgopts); 875 866 void IntersectConsMetric(const double * s,const Int4 nbsol,const int * typsols, 876 867 const Real8 hmin,const Real8 hmax, const Real8 coef, -
issm/trunk/src/c/Bamgx/Triangles.cpp
r2813 r2814 697 697 } 698 698 /*}}}1*/ 699 /*FUNCTION Triangles::WriteMetric TO UPDATE{{{1*/700 void Triangles::WriteMetric( ostream & f,int iso) {701 i f (iso)702 {703 f << nbv <<" " << 1 << endl ;704 for (Int4 iv=0;iv<nbv;iv++)705 706 MatVVP2x2 V=vertices[i v].m;707 f << V.hmin() << endl;708 709 710 else 711 {712 f << nbv <<" " << 3 << endl ;713 for (Int4 iv=0;iv<nbv;iv++)714 f << vertices[iv].m.a11 << " "715 << vertices[iv].m.a21 << " "716 << vertices[iv].m.a22 << endl;717 699 /*FUNCTION Triangles::WriteMetric{{{1*/ 700 void Triangles::WriteMetric(BamgOpts* bamgopts) { 701 int i; 702 xfree((void**)&bamgopts->metric); 703 if (bamgopts->iso){ 704 bamgopts->metric=(double*)xmalloc(1*nbv*sizeof(double)); 705 for (i=0;i<nbv;i++){ 706 MatVVP2x2 V=vertices[i].m; 707 bamgopts->metric[i]=V.hmin(); 708 } 709 } 710 else { 711 bamgopts->metric=(double*)xmalloc(3*nbv*sizeof(double)); 712 for (i=0;i<nbv;i++){ 713 bamgopts->metric[i*3+0]=vertices[i].m.a11; 714 bamgopts->metric[i*3+1]=vertices[i].m.a21; 715 bamgopts->metric[i*3+2]=vertices[i].m.a22; 716 } 717 } 718 718 } 719 719 /*}}}1*/ -
issm/trunk/src/c/Makefile.am
r2810 r2814 325 325 ./Bamgx/meshtype.h \ 326 326 ./Bamgx/Triangles.cpp \ 327 ./Bamgx/Triangle.cpp \ 327 328 ./Bamgx/Geometry.cpp \ 328 329 ./Bamgx/Metric.cpp \ … … 664 665 ./Bamgx/meshtype.h \ 665 666 ./Bamgx/Triangles.cpp \ 667 ./Bamgx/Triangle.cpp \ 666 668 ./Bamgx/Geometry.cpp \ 667 669 ./Bamgx/Metric.cpp \
Note:
See TracChangeset
for help on using the changeset viewer.