Changeset 5581
- Timestamp:
- 08/26/10 08:04:15 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Bamg/Mesh.cpp
r5573 r5581 2735 2735 if (verbose>2) printf(" Insert initial %i vertices\n",nbv); 2736 2736 2737 //Compute integer coordinates and determinants for the existing vertices (from Geometry)2737 //Compute integer coordinates for the existing vertices 2738 2738 SetIntCoor(); 2739 2739 … … 2765 2765 * We hence have built a random list of nbv elements of 2766 2766 * [0 nbv[ all distincts*/ 2767 for (i=0;i<nbv;i++) ordre[i]= &vertices[i] ; 2768 const long PrimeNumber= BigPrimeNumber(nbv) ; 2767 2768 //Get Prime number 2769 const long PrimeNumber= BigPrimeNumber(nbv); 2769 2770 int k0=rand()%nbv; 2770 for (int is3=0; is3<nbv; is3++){ 2771 ordre[is3]= &vertices[k0=(k0+PrimeNumber)%nbv]; 2771 2772 //Build ordre 2773 for (i=0; i<nbv; i++){ 2774 ordre[i]=&vertices[k0=(k0+PrimeNumber)%nbv]; 2772 2775 } 2773 2776 … … 2775 2778 2776 2779 //get first vertex i such that [0,1,i] are not aligned 2777 for (i=2 ; det( ordre[0]->i, ordre[1]->i, ordre[i]->i ) == 0;){2780 for (i=2; det(ordre[0]->i,ordre[1]->i,ordre[i]->i)==0){ 2778 2781 //if i is higher than nbv, it means that all the determinants are 0, 2779 2782 //all vertices are aligned! 2780 if ( ++i >= nbv) { 2781 ISSMERROR("all the vertices are aligned"); 2782 } 2783 if (++i>=nbv) ISSMERROR("all the vertices are aligned"); 2783 2784 } 2784 2785 // exchange i et 2 in "ordre" so that … … 5057 5058 while(s>=lcurve && s<=lcurveb && nbv<nbvend){ 5058 5059 5060 /*Schematic of current curve 5061 * 5062 * a vb b // vertex 5063 * 0 ll0 ll1 ledge // length from a 5064 * + --- + - ... - + --S-- + --- + - ... - + // where is S 5065 * 0 kk0 kk1 NbSubEdge // Sub edge index 5066 * 5067 */ 5068 5059 5069 double ss = s-lcurve; 5060 5070 … … 5070 5080 ISSMASSERT(kk1!=kk0); 5071 5081 5072 double sbb = (ss-ll0 )/(ll1-ll0); 5073 double bb = (kk1+sbb)/NbSubEdge, aa=1-bb; 5082 /*Curvilinear coordinate in [0 1] of ss in current edge*/ 5083 // WARNING: This is what we would do 5084 // ssa = (ss-ll0)/(ll1-ll0); 5085 // aa = (kk0+ssa)/NbSubEdge 5086 // This is what Bamg does: 5087 double sbb = (ss-ll0)/(ll1-ll0); 5088 /*Curvilinear coordinate in [0 1] of ss in current curve*/ 5089 double bb = (kk1+sbb)/NbSubEdge; 5090 double aa = 1-bb; 5074 5091 5075 5092 // new vertex on edge … … 5079 5096 vb->DirOfSearch =NoDirOfSearch; 5080 5097 double abcisse = k ? bb : aa; 5081 vb->r = e->F( abcisse);5098 vb->r = e->F(abcisse); 5082 5099 VerticesOnGeomEdge[NbVerticesOnGeomEdge++]= VertexOnGeom(*vb,*e,abcisse); 5083 5100 -
issm/trunk/src/c/shared/Bamg/det.h
r3913 r5581 7 7 8 8 Icoor2 inline det(const I2 &a,const I2 & b,const I2 &c){ 9 registerIcoor2 bax = b.x - a.x ,bay = b.y - a.y;10 registerIcoor2 cax = c.x - a.x ,cay = c.y - a.y;9 Icoor2 bax = b.x - a.x ,bay = b.y - a.y; 10 Icoor2 cax = c.x - a.x ,cay = c.y - a.y; 11 11 return bax*cay - bay*cax; 12 12 }
Note:
See TracChangeset
for help on using the changeset viewer.