Changeset 18488
- Timestamp:
- 09/09/14 05:40:32 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/bamg/Mesh.cpp
r18486 r18488 2930 2930 Triangle *tcvj=TriangleFindFromCoord(vj.i,det3); 2931 2931 if (tcvj && !tcvj->link){ 2932 _printf_("While trying to add the following point:\n"); 2933 vj.Echo(); 2934 _printf_("BAMG determined that it was inside the following triangle, which probably lies outside of the geometric domain\n"); 2932 2935 tcvj->Echo(); 2933 2936 _error_("problem inserting point in InsertNewPoints (tcvj=" << tcvj << " and tcvj->link=" << tcvj->link << ")"); … … 3146 3149 if (verbose>5) _printf_(" Inserting initial mesh points\n"); 3147 3150 bool pointsoutside = false; 3148 for 3151 for(i=0;i<Bh.nbv;i++){ 3149 3152 BamgVertex &bv=Bh[i]; 3150 3153 /*Do not insert if the point is outside*/ 3151 3154 long long det3[3]; 3152 3155 Triangle* tcvj=TriangleFindFromCoord(bv.i,det3); 3153 if(tcvj->det<0 ){3156 if(tcvj->det<0 || !tcvj->link){ 3154 3157 pointsoutside = true; 3155 3158 continue; 3156 3159 } 3157 if (!bv.GeomEdgeHook){ 3160 IssmDouble area_1=((bv.r.x -(*tcvj)(2)->r.x)*((*tcvj)(1)->r.y-(*tcvj)(2)->r.y) 3161 - (bv.r.y -(*tcvj)(2)->r.y)*((*tcvj)(1)->r.x-(*tcvj)(2)->r.x)); 3162 IssmDouble area_2=(((*tcvj)(0)->r.x -(*tcvj)(2)->r.x)*(bv.r.y -(*tcvj)(2)->r.y) 3163 - ((*tcvj)(0)->r.y -(*tcvj)(2)->r.y)*(bv.r.x -(*tcvj)(2)->r.x)); 3164 IssmDouble area_3 =((bv.r.x -(*tcvj)(1)->r.x)*((*tcvj)(0)->r.y-(*tcvj)(1)->r.y) 3165 - (bv.r.y -(*tcvj)(1)->r.y)*((*tcvj)(0)->r.x-(*tcvj)(1)->r.x)); 3166 if(area_1<0 || area_2<0 || area_3<0){ 3167 pointsoutside = true; 3168 continue; 3169 } 3170 if(!bv.GeomEdgeHook){ 3158 3171 vertices[nbv].r = bv.r; 3159 3172 vertices[nbv].PreviousNumber = i+1; … … 3164 3177 Bh.CreateSingleVertexToTriangleConnectivity(); 3165 3178 InsertNewPoints(nbvold,NbTSwap,bamgopts->random); 3166 } 3179 } 3167 3180 else Bh.CreateSingleVertexToTriangleConnectivity(); 3168 3181
Note:
See TracChangeset
for help on using the changeset viewer.