Ignore:
Timestamp:
01/29/18 14:39:39 (7 years ago)
Author:
Mathieu Morlighem
Message:

CHG: fixing bug if initial mesh is not generated by bamg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/bamg/Mesh.cpp

    r22253 r22380  
    3030                        _printf_("WARNING: mesh present but no geometry found. Reconstructing...\n");
    3131                        BuildGeometryFromMesh(bamgopts);
    32                         Gh.PostRead();
     32                        Gh.PostRead(true);
    3333                }
    3434
     
    12151215                /*Construction of the edges*/
    12161216
    1217                 //initialize st and edge4
     1217                /*initialize st and edge4*/
    12181218                SetOfEdges4* edge4= new SetOfEdges4(nbt*3,nbv);
    12191219                long*        st   = new long[nbt*3];
    12201220
    1221                 //initialize st as -1 (chaining algorithm)
     1221                /*initialize st as -1 (chaining algorithm)*/
    12221222                for (i=0;i<nbt*3;i++) st[i]=-1;
    12231223
    1224                 //build edge4 (chain)
     1224                /*build edge4 (chain)*/
    12251225                for (i=0;i<nbe;i++){
    12261226                        edge4->SortAndAdd(GetId(edges[i][0]),GetId(edges[i][1]));
    12271227                }
    1228                 //check that there is no double edge
     1228                /*check that there is no double edge*/
    12291229                if (nbe !=  edge4->nb()){
    12301230                        delete [] st;
     
    12341234                long nbeold = nbe;
    12351235
    1236                 //Go through the triangles and ass the edges in edge4 if they are not there yet
     1236                //Go through the triangles and add the edges in edge4 if they are not there yet
    12371237                for (i=0;i<nbt;i++){
    12381238                        //3 edges per triangle
     
    12511251                                                _error_("problem in Geometry reconstruction: an edge on boundary is duplicated (double element?)");
    12521252                                        }
    1253                                         //OK, the element is not on boundary, is belongs to 2 triangles -> build Adjacent triangles list
     1253                                        /*OK, the element is not on boundary, is belongs to 2 triangles -> build Adjacent triangles list*/
    12541254                                        triangles[i].SetAdj2(j,triangles + st[k] / 3,(int) (st[k]%3));
    12551255                                        if (invisible)  triangles[i].SetHidden(j);
    1256                                         // if k < nbe mark the edge as on Boundary (Locked)
     1256                                        /* if k < nbe mark the edge as on Boundary (Locked)*/
    12571257                                        if (k<nbe) {
    12581258                                                triangles[i].SetLocked(j);
    12591259                                        }
    1260                                         //set st[k] as negative so that the edge should not be called again
     1260                                        /*set st[k] as negative so that the edge should not be called again*/
    12611261                                        st[k]=-2-st[k];
    12621262                                }
    1263                                 //else (see 3 lines above), the edge has been called more than twice: return error
    12641263                                else {
     1264                                        /*else (see 3 lines above), the edge has been called more than twice: return error*/
    12651265                                        _printf_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << "," << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles (" << k << ")\n");
    12661266                                        _printf_("Edge " << j << " of triangle " << i << "\n");
     
    12861286                }
    12871287
    1288                 // check consistency of edge[].adj and geometrical required  vertices
     1288                /*check consistency of edge[].adj and geometrical required  vertices*/
    12891289                k=0; kk=0;
    12901290                for (i=0;i<nbedges;i++){
     
    13041304
    13051305                /*Constructions of edges*/
    1306 
    13071306                k += kk;
    13081307                kk=0;
Note: See TracChangeset for help on using the changeset viewer.