Changeset 5581


Ignore:
Timestamp:
08/26/10 08:04:15 (15 years ago)
Author:
seroussi
Message:

As usual

Location:
issm/trunk/src/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Bamg/Mesh.cpp

    r5573 r5581  
    27352735                if (verbose>2) printf("   Insert initial %i vertices\n",nbv);
    27362736
    2737                 //Compute integer coordinates and determinants for the existing vertices (from Geometry)
     2737                //Compute integer coordinates for the existing vertices
    27382738                SetIntCoor();
    27392739
     
    27652765                 *  We hence have built a random list of nbv elements of
    27662766                 *  [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);
    27692770                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];
    27722775                }
    27732776
     
    27752778
    27762779                //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){
    27782781                        //if i is higher than nbv, it means that all the determinants are 0,
    27792782                        //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");
    27832784                }
    27842785                // exchange i et 2 in "ordre" so that
     
    50575058                                                                        while(s>=lcurve && s<=lcurveb && nbv<nbvend){
    50585059
     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
    50595069                                                                                double ss = s-lcurve;
    50605070
     
    50705080                                                                                ISSMASSERT(kk1!=kk0);
    50715081
    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;
    50745091
    50755092                                                                                // new vertex on edge
     
    50795096                                                                                vb->DirOfSearch =NoDirOfSearch;
    50805097                                                                                double abcisse = k ? bb : aa;
    5081                                                                                 vb->r =  e->F( abcisse );
     5098                                                                                vb->r =  e->F(abcisse);
    50825099                                                                                VerticesOnGeomEdge[NbVerticesOnGeomEdge++]= VertexOnGeom(*vb,*e,abcisse);       
    50835100
  • issm/trunk/src/c/shared/Bamg/det.h

    r3913 r5581  
    77
    88        Icoor2 inline det(const I2 &a,const I2 & b,const I2 &c){
    9                 register  Icoor2 bax = b.x - a.x ,bay = b.y - a.y;
    10                 register  Icoor2 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;
    1111                return  bax*cay - bay*cax;
    1212        }
Note: See TracChangeset for help on using the changeset viewer.