Changeset 2969
- Timestamp:
- 02/05/10 13:24:45 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk/src/c/Bamgx/Mesh2.h ¶
r2965 r2969 314 314 inline void Set(const Triangle &,const Triangles &,Triangles &); 315 315 inline int In(Vertex *v) const { return ns[0]==v || ns[1]==v || ns[2]==v ;} 316 TriangleAdjacent FindBoundaryEdge(int ) const;316 TriangleAdjacent FindBoundaryEdge(int i) const; 317 317 318 318 void ReNumbering(Triangle *tb,Triangle *te, Int4 *renu){ -
TabularUnified issm/trunk/src/c/Bamgx/objects/Triangle.cpp ¶
r2960 r2969 20 20 /*FUNCTION Triangle::FindBoundaryEdge{{{1*/ 21 21 TriangleAdjacent Triangle::FindBoundaryEdge(int i) const{ 22 // turn around the vertex ns[i] also call s 22 23 /*Intermediary*/ 24 Triangle* ttc=NULL; 25 int k,j,jc; 26 27 // call current triangle t 23 28 Triangle* t = (Triangle*)this; 24 Triangle* ttc=NULL;25 29 26 int k=0,j = EdgesVertexTriangle[i][0],jc;27 int exterieur =!link ;30 //is the current triangle inside or outside? 31 int outside=!link ; 28 32 33 // EdgesVertexTriangle[3][2] = {{1,2},{2,0},{0,1}}; 34 // initialize j as the first vertex of the ith edge 35 j=EdgesVertexTriangle[i][0]; 36 37 //Loop over the adjacent triangle of t 38 k=0; 29 39 do{ 30 int exterieurp = exterieur; 31 k++; 40 //keep track of outside 41 int outsidep = outside; 42 //increment k 43 k++; 44 //Get ttc, adjacent triangle of t with respect to vertex j 32 45 ttc = t->at[j]; 33 exterieur = !ttc->link; 34 if (exterieur+exterieurp == 1) 35 return TriangleAdjacent(t,j); 46 //is the current triangle inside or outside? 47 outside = !ttc->link; 48 //if both previous triangle are outside, return 49 if (outside+outsidep == 1) return TriangleAdjacent(t,j); 50 51 //update t and j 52 t = ttc; 53 //NextEdge[3] = {1,2,0}; 36 54 jc = NextEdge[t->aa[j]&3]; 37 t = ttc;38 55 j = NextEdge[jc]; 56 57 //check number of iterations 39 58 if (k>=2000){ 40 59 throw ErrorException(__FUNCT__,exprintf("too many iteration in Triangle::FindBoundaryEdge (k>=2000)")); 41 60 } 42 } while (this!= t); 43 return TriangleAdjacent(0,0); 61 } while (this!= t); 62 //not found, return empty triangle 63 return TriangleAdjacent(NULL,0); 44 64 } 45 65 /*}}}1*/ -
TabularUnified issm/trunk/src/c/Bamgx/objects/Triangles.cpp ¶
r2965 r2969 513 513 bamgmesh->Edges[i*3+1]=Number(edges[i][1])+1; //back to M indexing 514 514 bamgmesh->Edges[i*3+2]=edges[i].ref; 515 /*if(edges[i].onGeometry){ 516 printf("ref = %i [%i %i]\n",edges[i].ref,Number(edges[i][0])+1,Number(edges[i][1])+1); 517 }*/ 515 518 } 516 519 } … … 551 554 bamgmesh->Triangles[num*4+3]=subdomains[reft[i]].ref; 552 555 num=num+1; 556 /*if (reft[i]==-1){ 557 if (!t(0)) printf("%i %i %i\n",Number(t[1])+1,Number(t[2]),i); 558 if (!t(1)) printf("%i %i %i\n",Number(t[2])+1,Number(t[0]),i); 559 if (!t(2)) printf("%i %i %i\n",Number(t[0])+1,Number(t[1]),i); 560 }*/ 553 561 } 554 562 } … … 3489 3497 3490 3498 nbt = 2; 3491 triangles[0](0) = 0; //infinite vertex3499 triangles[0](0) = NULL; //infinite vertex 3492 3500 triangles[0](1) = v0; 3493 3501 triangles[0](2) = v1; 3494 triangles[1](0) = 0;//infinite vertex3502 triangles[1](0) = NULL;//infinite vertex 3495 3503 triangles[1](2) = v0; 3496 3504 triangles[1](1) = v1; -
TabularUnified issm/trunk/src/m/classes/public/bamg.m ¶
r2966 r2969 39 39 nods=domain(i).nods-1; %the domain are closed 1=end; 40 40 bamg_geometry.Vertices=[bamg_geometry.Vertices; [domain(i).x(1:nods) domain(i).y(1:nods) ones(nods,1)]]; 41 bamg_geometry.Edges=[bamg_geometry.Edges; [transp(count+1:count+nods) transp([count+2:count+nods count+1]) ones(nods,1)]];41 bamg_geometry.Edges=[bamg_geometry.Edges; [transp(count+1:count+nods) transp([count+2:count+nods count+1]) 1*ones(nods,1)]]; 42 42 if i>1, 43 43 %if closed : hole … … 51 51 nods=domain(i).nods-1; 52 52 bamg_geometry.Vertices=[bamg_geometry.Vertices; [domain(i).x(:) domain(i).y(:) ones(nods+1,1)]]; 53 bamg_geometry.Edges=[bamg_geometry.Edges; [transp(count+1:count+nods) transp([count+2:count+nods+1]) ones(nods,1)]];53 bamg_geometry.Edges=[bamg_geometry.Edges; [transp(count+1:count+nods) transp([count+2:count+nods+1]) 2*ones(nods,1)]]; 54 54 55 55 else … … 65 65 end 66 66 bamg_geometry.NumVertices=size(bamg_geometry.Vertices,1); 67 bamg_geometry.NumEdges=size(bamg_geometry.Edges,1) 68 bamg_geometry.Edges 67 bamg_geometry.NumEdges=size(bamg_geometry.Edges,1); 69 68 bamg_geometry.NumSubDomains=size(bamg_geometry.SubDomains,1); 70 69 end
Note:
See TracChangeset
for help on using the changeset viewer.