Changeset 5208


Ignore:
Timestamp:
08/12/10 15:32:14 (15 years ago)
Author:
Mathieu Morlighem
Message:

Fixed meshconvert

Location:
issm/trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/BamgConvertMeshx/BamgConvertMeshx.cpp

    r5177 r5208  
    2121        /*Options*/
    2222        BamgOpts* bamgopts=NULL;
     23        bamgopts=new BamgOpts();
    2324
    2425        // read mesh
  • issm/trunk/src/c/objects/Bamg/Geometry.cpp

    r5187 r5208  
    4848        Geometry::~Geometry() {
    4949                /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/~Geometry)*/
    50                 ISSMASSERT(NbRef<=0);
    51                 if(vertices)  delete [] vertices;   vertices=0;
    52                 if(edges)     delete [] edges;      edges=0;
    53                 if(quadtree)  delete  quadtree;     quadtree=0;
    54                 if(curves)    delete  []curves;     curves=0;nbcurves=0;
     50                if(NbRef>0)    ISSMERROR("Trying to delete geometry and NbRef>0");
     51                if(vertices)   delete [] vertices;  vertices=0;
     52                if(edges)      delete [] edges;     edges=0;
     53                if(quadtree)   delete    quadtree;  quadtree=0;
     54                if(curves)     delete [] curves;    curves=0;nbcurves=0;
    5555                if(subdomains) delete [] subdomains;subdomains=0;
    5656                Init();
  • issm/trunk/src/c/objects/Bamg/Mesh.cpp

    r5187 r5208  
    23242324                //Reset BamgVertex to On
    23252325                SetVertexFieldOn();
     2326
     2327        }
     2328        /*}}}1*/
     2329        /*FUNCTION Mesh::Echo{{{1*/
     2330        void Mesh::Echo(void) {
     2331
     2332                int i;
     2333
     2334                printf("Mesh Echo:\n");
     2335                printf("   nbv = %i\n",nbv);
     2336                printf("   nbt = %i\n",nbt);
     2337                printf("   nbe = %i\n",nbe);
     2338                printf("   nbq = %i\n",nbq);
     2339                printf("   index:\n");
     2340                for (i=0;i<nbt;i++){
     2341                        printf("   %4i: [%4i %4i %4i]\n",i+1,
     2342                                                ((BamgVertex *)triangles[i](0))?GetId(triangles[i][0])+1:0,
     2343                                                ((BamgVertex *)triangles[i](1))?GetId(triangles[i][1])+1:0,
     2344                                                ((BamgVertex *)triangles[i](2))?GetId(triangles[i][2])+1:0);
     2345                }
     2346                printf("   coordinates:\n");
     2347                for (i=0;i<nbv;i++){
     2348                        printf("   %4i: [%g %g]\n",i+1,vertices[i].r.x,vertices[i].r.y);
     2349                }
    23262350
    23272351        }
     
    25502574                                        // see routine MakeGeometricalEdgeToEdge
    25512575                                        Edge &e = *GeometricalEdgetoEdge[Gh.GetId(eg)];
    2552                                         if (&e==NULL){
    2553                                                 ISSMERROR("&e==NULL");
    2554                                         }
     2576                                        ISSMASSERT(&e);
    25552577                                        BamgVertex * v0 =  e(0),*v1 = e(1);
    25562578                                        Triangle *t  = v0->t;
     
    25602582                                        subdomains[i].direction = direction;
    25612583                                        subdomains[i].edge = &e;
    2562                                         if (!t || !direction){
    2563                                                 ISSMERROR("!t || !direction");
    2564                                         }
     2584                                        ISSMASSERT(t && direction);
    25652585
    25662586                                        AdjacentTriangle  ta(t,EdgesVertexTriangle[v0->vint][0]);// previous edges
    25672587
    25682588                                        while (1) {
    2569                                                 if ( v0 != ta.EdgeVertex(1) ){
    2570                                                         ISSMERROR("v0 != ta.EdgeVertex(1)");
    2571                                                 }
     2589                                                ISSMASSERT(v0==ta.EdgeVertex(1));
    25722590                                                if (ta.EdgeVertex(0) == v1) { // ok we find the edge
    25732591                                                        if (direction>0) 
     
    48414859
    48424860                        //check that num is in [0 nbt[
    4843                         if (num<0 || num>=nbt){ ISSMERROR("num<0 || num>=nbt");}
     4861                        ISSMASSERT(num>=0 && num<nbt);
    48444862
    48454863                        //reft of this triangle is the subdomain number
  • issm/trunk/src/c/objects/Bamg/Mesh.h

    r5180 r5208  
    7878                        void AddVertex(BamgVertex & s,Triangle * t,Icoor2 *  =0) ;
    7979                        void Insert();
     80                        void Echo(void);
    8081                        void ForceBoundary();
    8182                        void FindSubDomain(int OutSide=0);
  • issm/trunk/src/m/classes/public/bamg.m

    r5187 r5208  
    8686                bamg_geometry.Vertices=[bamg_geometry.Vertices; [domain(i).x(1:nods) domain(i).y(1:nods) ones(nods,1)]];
    8787                bamg_geometry.Edges   =[bamg_geometry.Edges;    [transpose(count+1:count+nods) transpose([count+2:count+nods count+1])  1*ones(nods,1)]];
     88                if i>1, bamg_geometry.SubDomains=[2 count+1 1 1];
    8889
    8990                %update counter
  • issm/trunk/src/m/utils/Model/loadmodel.m

    r2630 r5208  
    1919[stat,mess]=fileattrib(path);
    2020if( stat==0 | mess.UserRead~=1),
    21         error(['loadmodel error message: file ' path ' is not readable (permission dinied).']);
     21        %error(['loadmodel error message: file ' path ' is not readable (permission denied).']);
    2222end
    2323%check number of variables
Note: See TracChangeset for help on using the changeset viewer.