Changeset 2955


Ignore:
Timestamp:
02/04/10 07:25:05 (15 years ago)
Author:
Mathieu Morlighem
Message:

minor

Location:
issm/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Bamgx/Mesh2.h

    r2945 r2955  
    1616#include <limits.h>
    1717#include <time.h>
    18 
    19 #if  (defined(unix) || defined(__unix)) && !defined(__AIX)
    20 #define SYSTIMES
    21 #include <sys/times.h>
    22 #include <unistd.h>
    23 #endif
    2418
    2519#include "meshtype.h"
     
    124118                                Vertex * to;// use in geometry Vertex to now the Mesh Vertex associed
    125119                                VertexOnGeom * onGeometry;     // if vint 8; // set with Triangles::SetVertexFieldOn()
    126                                 Vertex * onbv; // if vint == 16 on Background vertex Triangles::SetVertexFieldOnBTh()
    127                                 VertexOnEdge * onbe;   // if vint == 32 on Background edge
     120                                Vertex * onBackgroundVertex; // if vint == 16 on Background vertex Triangles::SetVertexFieldOnBTh()
     121                                VertexOnEdge * onBackgroundEdge;   // if vint == 32 on Background edge
    128122                        };
    129123                        Int1 vint;  // the vertex number in triangle; varies between 0 and 2 in t
     
    245239        class GeometricalEdge {
    246240                public:
    247                         GeometricalVertex * v[2];
     241                        GeometricalVertex* v[2];
    248242                        Int4 ref;
    249                         Int4  CurveNumber;
    250                         R2 tg[2]; // the 2 tangente
    251                         //   if tg[0] =0 => no continuite
    252                         GeometricalEdge * Adj [2];
     243                        Int4 CurveNumber;
     244                        R2   tg[2]; // the 2 tangentes
     245                        //   if tg[0] =0 => no continuity
     246                        GeometricalEdge* Adj[2];
    253247                        int DirAdj[2];
    254                         //  private:
    255248                        int flag ;
    256                 public:
    257249                        GeometricalEdge* link; // if   Cracked() or Equi()
    258 
    259250                        // end of data
    260251
     
    578569                        VertexOnVertex() {};
    579570                        inline void Set(const Triangles &,Int4,Triangles &);
    580                         void SetOnBTh(){v->onbv=bv;v->vint=IsVertexOnVertex;}
     571                        void SetOnBTh(){v->onBackgroundVertex=bv;v->vint=IsVertexOnVertex;}
    581572        };
    582573        /*}}}1*/
     
    590581                VertexOnEdge(){}
    591582                inline void Set(const Triangles &,Int4,Triangles &); 
    592                 void SetOnBTh(){v->onbe=this;v->vint=IsVertexOnEdge;} 
     583                void SetOnBTh(){v->onBackgroundEdge=this;v->vint=IsVertexOnEdge;} 
    593584                Vertex & operator[](int i) const { return (*be)[i];}
    594585                operator Real8 () const { return abcisse;}
  • issm/trunk/src/c/Bamgx/objects/Triangles.cpp

    r2945 r2955  
    478478
    479479                verbose=bamgopts->verbose;
     480
     481                //Build reft that holds the number the subdomain number of each triangle
    480482                Int4 *reft = new Int4[nbt];
    481483                Int4 nbInT = ConsRefTriangle(reft);
     
    538540                        for (i=0;i<nbt;i++){
    539541                                Triangle &t=triangles[i];
     542                                //reft[i]=-1 for outside triangle
    540543                                if (reft[i]>=0 && !( t.Hidden(0) || t.Hidden(1) || t.Hidden(2) )){
    541544                                        bamgmesh->Triangles[num*4+0]=Number(t[0])+1; //back to M indexing
     
    17701773                register Triangle *t0,*t;
    17711774                register Int4 k=0, num;   
    1772                 for (Int4 it=0;it<nbt;it++) reft[it]=-1; // outside triangle
     1775
     1776                //initialize all triangles as -1 (outside)
     1777                for (Int4 it=0;it<nbt;it++) reft[it]=-1;
     1778
     1779                //loop over all subdomains
    17731780                for (Int4 i=0;i<NbSubDomains;i++){
     1781
     1782                        //first triangle of the subdomain i
    17741783                        t=t0=subdomains[i].head;
     1784
     1785                        //check that the subdomain is not empty
    17751786                        if (!t0){ // no empty sub domai{
    1776                                 throw ErrorException(__FUNCT__,exprintf("!t0"));
    1777                         }
    1778                         // register Int4 color=i+1;// because the color 0 is outside triangle
    1779                         do { k++;
     1787                                throw ErrorException(__FUNCT__,exprintf("At least one subdomain is empty"));
     1788                        }
     1789
     1790                        //loop
     1791                        do{
     1792                                k++;
     1793
     1794                                //get current triangle number
    17801795                                num = Number(t);
     1796
     1797                                //check that num is in [0 nbt[
    17811798                                if (num<0 || num>=nbt){
    17821799                                        throw ErrorException(__FUNCT__,exprintf("num<0 || num>=nbt"));
    17831800                                }
     1801
     1802                                //reft of this triangle is the subdomain number
    17841803                                reft[num]=i;
    1785                         }
    1786                         while (t0 != (t=t->link));
     1804                        } while (t0 != (t=t->link));
     1805                        //stop when all triangles of subdomains have been tagged
     1806
    17871807                        }
    17881808                        return k;   
     
    38973917                Vertex * pvA=&vA, * pvB=&vB;
    38983918                if (vA.vint == IsVertexOnVertex){
    3899                         pA=vA.onbv;
     3919                        pA=vA.onBackgroundVertex;
    39003920                }
    39013921                else if (vA.vint == IsVertexOnEdge){
    3902                         pA=vA.onbe->be;
    3903                         tA=vA.onbe->abcisse;
     3922                        pA=vA.onBackgroundEdge->be;
     3923                        tA=vA.onBackgroundEdge->abcisse;
    39043924                }
    39053925                else {
     
    39083928
    39093929                if (vB.vint == IsVertexOnVertex){
    3910                         pB=vB.onbv;
     3930                        pB=vB.onBackgroundVertex;
    39113931                }
    39123932                else if(vB.vint == IsVertexOnEdge){
    3913                         pB=vB.onbe->be;
    3914                         tB=vB.onbe->abcisse;
     3933                        pB=vB.onBackgroundEdge->be;
     3934                        tB=vB.onBackgroundEdge->abcisse;
    39153935                }
    39163936                else {
     
    39343954                if( vA.vint == IsVertexOnEdge)
    39353955                  { // find the start edge
    3936                         e = vA.onbe->be;         
     3956                        e = vA.onBackgroundEdge->be;     
    39373957
    39383958                  }
     
    39443964                        Exchange(pvA,pvB);
    39453965                        Exchange(A,B);
    3946                         e =  vB.onbe->be;
     3966                        e =  vB.onBackgroundEdge->be;
    39473967
    39483968                  }
  • issm/trunk/src/m/classes/public/bamg.m

    r2950 r2955  
    1818bamg_geometry.NumEdges=0;
    1919bamg_geometry.Edges=zeros(0,3);
     20bamg_geometry.NumCrackedEdges=0;
     21bamg_geometry.CrackedEdges=zeros(0,1);
    2022bamg_geometry.hVertices=zeros(0,1);
    2123bamg_geometry.NumSubDomains=0;
     
    3638                        bamg_geometry.Edges=[bamg_geometry.Edges; [transp(count+1:count+nods) transp([count+2:count+nods count+1])  ones(nods,1)]];
    3739                        if i>1,
    38                                 clockwise=-1;
    39                                 bamg_geometry.SubDomains=[2 count+1 clockwise 1];
     40                                %if closed : hole
     41                                if (domain(i).x(1)==domain(i).x(end) & domain(i).y(1)==domain(i).y(end)),
     42                                        clockwise=-1;
     43                                        bamg_geometry.SubDomains=[2 count+1 clockwise 1];
     44                                else
     45                                        %rift
     46                                end
    4047                        end
    4148                        count=count+nods;
     
    122129
    123130%Fill in rest of fields:
     131md.type='2d';
    124132md.numberofelements=length(md.elements);
    125133md.numberofgrids=length(md.x);
     
    127135md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
    128136md.gridonbed=ones(md.numberofgrids,1);
     137md.gridonwater=zeros(md.numberofgrids,1);
    129138md.gridonsurface=ones(md.numberofgrids,1);
    130139md.elementonbed=ones(md.numberofelements,1);
     
    138147md.segments=findsegments(md);
    139148md.gridonboundary=zeros(md.numberofgrids,1); md.gridonboundary(md.segments(:,1:2))=1;
    140 
    141 %Fill in rest of fields:
    142 md.z=zeros(md.numberofgrids,1);
    143 md.gridonbed=ones(md.numberofgrids,1);
    144 md.gridonsurface=ones(md.numberofgrids,1);
    145 md.elementonbed=ones(md.numberofelements,1);
    146 md.elementonsurface=ones(md.numberofelements,1);
    147 md.gridonwater=zeros(md.numberofgrids,1);
    148 
    149 %type of model
    150 md.type='2d';
  • issm/trunk/src/m/classes/public/mesh/meshyams.m

    r2749 r2955  
    171171
    172172end
    173 
    174 
    175 
    176 
    177 
  • issm/trunk/src/mex/Bamg/Bamg.cpp

    r2942 r2955  
    2626        int     NumEdgesGeom;
    2727        double* EdgesGeom=NULL;
     28        int     NumCrackedEdgesGeom;
     29        double* CrackedEdgesGeom=NULL;
    2830        double* hVerticesGeom=NULL;
    2931        double  MaximalAngleOfCorner;
     
    7375        bamggeom.NumRequiredEdges=0;
    7476        bamggeom.RequiredEdges=NULL;
    75         bamggeom.NumCrackedEdges=0;
    76         bamggeom.CrackedEdges=NULL;
     77        FetchData(&NumCrackedEdgesGeom,mxGetField(BAMGGEOMETRY,0,"NumCrackedEdges"));
     78        bamggeom.NumCrackedEdges=NumCrackedEdgesGeom;
     79        FetchData(&CrackedEdgesGeom,NULL,NULL,mxGetField(BAMGGEOMETRY,0,"CrackedEdges"));
     80        bamggeom.CrackedEdges=CrackedEdgesGeom;
    7781        FetchData(&NumSubDomainsGeom,mxGetField(BAMGGEOMETRY,0,"NumSubDomains"));
    7882        bamggeom.NumSubDomains=NumSubDomainsGeom;
Note: See TracChangeset for help on using the changeset viewer.