Changeset 2794
- Timestamp:
- 01/12/10 09:29:51 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Bamgx/Bamgx.cpp
r2790 r2794 109 109 110 110 //Build output 111 if (verbosity>1) printf(" Processing Output...\n"); 112 NumVerticesOut=Th.nbv; 113 VerticesOut=(double*)xmalloc(3*NumVerticesOut*sizeof(double)); 114 for (i=0;i<NumVerticesOut;i++){ 115 VerticesOut[i*3+0]=Th.vertices[i].r.x; 116 VerticesOut[i*3+1]=Th.vertices[i].r.y; 117 VerticesOut[i*3+2]=Th.vertices[i].ReferenceNumber; 118 } 119 120 NumTrianglesOut=Th.nbt-Th.NbOutT; //number of triangles - number of external triangles 121 TrianglesOut=(double*)xmalloc(4*NumTrianglesOut*sizeof(double)); 122 num=0; 123 for(i=0;i<Th.nbt;i++){ 124 Triangle &t=Th.triangles[i]; 125 if (t.link){ 126 //write the element only if it is part of the mesh (no boundary element) 127 TrianglesOut[4*num+0]=Th.Number(t[0])+1; 128 TrianglesOut[4*num+1]=Th.Number(t[1])+1; 129 TrianglesOut[4*num+2]=Th.Number(t[2])+1; 130 TrianglesOut[4*num+3]=t.color; 131 num=num+1; 132 } 133 } 111 Th.WriteBamgMesh(bamgmesh,bamgopts); 134 112 /*}}}*/ 135 113 } … … 186 164 187 165 //Build output 188 NumVerticesOut=Th.nbv; 189 VerticesOut=(double*)xmalloc(3*NumVerticesOut*sizeof(double)); 190 for (i=0;i<NumVerticesOut;i++){ 191 VerticesOut[i*3+0]=Th.vertices[i].r.x; 192 VerticesOut[i*3+1]=Th.vertices[i].r.y; 193 VerticesOut[i*3+2]=Th.vertices[i].ReferenceNumber; 194 } 195 196 NumTrianglesOut=Th.nbt-Th.NbOutT; //number of triangles - number of external triangles 197 TrianglesOut=(double*)xmalloc(4*NumTrianglesOut*sizeof(double)); 198 num=0; 199 for(i=0;i<Th.nbt;i++){ 200 Triangle &t=Th.triangles[i]; 201 if (t.link){ 202 //write the element only if it is part of the mesh (no boundary element) 203 TrianglesOut[4*num+0]=Th.Number(t[0])+1; 204 TrianglesOut[4*num+1]=Th.Number(t[1])+1; 205 TrianglesOut[4*num+2]=Th.Number(t[2])+1; 206 TrianglesOut[4*num+3]=t.color; 207 num=num+1; 208 } 209 } 166 Th.WriteBamgMesh(bamgmesh,bamgopts); 210 167 211 168 /*clean up*/ … … 214 171 } 215 172 216 /*Assign output pointers*/217 bamgmesh->NumTriangles=NumTrianglesOut;218 xfree((void**)&bamgmesh->Triangles);219 bamgmesh->Triangles=TrianglesOut;220 221 bamgmesh->NumVertices=NumVerticesOut;222 xfree((void**)&bamgmesh->Vertices);223 bamgmesh->Vertices=VerticesOut;224 225 173 /*No error return*/ 226 174 if (verbosity>1) printf(" Exiting Bamg.\n"); -
issm/trunk/src/c/Bamgx/Mesh2.h
r2790 r2794 899 899 void Read(MeshIstream &,int version,Real8 cutoffradian); 900 900 void ReadFromMatlabMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts); 901 void WriteBamgMesh(BamgMesh* bamgmesh,BamgOpts* bamgopts); 901 902 void Read_am_fmt(MeshIstream &); 902 903 void Read_amdba(MeshIstream &); -
issm/trunk/src/c/Bamgx/MeshRead.cpp
r2790 r2794 132 132 } 133 133 134 //Ver texOnGeometricEdge135 if(bamgmesh->Vert exOnGeometricEdge){136 if(verbose>3) printf(" processing Vert exOnGeometricEdge\n");137 NbVerticesOnGeomEdge=bamgmesh->NumVert exOnGeometricEdge;134 //VerVerticesOnGeometricEdge 135 if(bamgmesh->VerticesOnGeometricEdge){ 136 if(verbose>3) printf(" processing VerticesOnGeometricEdge\n"); 137 NbVerticesOnGeomEdge=bamgmesh->NumVerticesOnGeometricEdge; 138 138 VerticesOnGeomEdge= new VertexOnGeom[NbVerticesOnGeomEdge] ; 139 139 for (i=0;i<NbVerticesOnGeomEdge;i++){ 140 140 Int4 i1,i2; 141 141 Real8 s; 142 //VertexOnGeom & v =VerticesOnGeomVertex[i0]; 143 i1=(Int4)bamgmesh->VertexOnGeometricEdge[i*3+0]-1; //for C indexing 144 i2=(Int4)bamgmesh->VertexOnGeometricEdge[i*3+1]-1; //for C indexing 145 s =(Int4)bamgmesh->VertexOnGeometricEdge[i*3+2]; 142 i1=(Int4)bamgmesh->VerticesOnGeometricEdge[i*3+0]-1; //for C indexing 143 i2=(Int4)bamgmesh->VerticesOnGeometricEdge[i*3+1]-1; //for C indexing 144 s =(Int4)bamgmesh->VerticesOnGeometricEdge[i*3+2]; 146 145 VerticesOnGeomEdge[i]=VertexOnGeom(vertices[i1],Gh.edges[i2],s); 147 146 } … … 224 223 225 224 //EdgeOnGeometricEdge 226 if(bamgmesh->Edge OnGeometricEdge){227 if(verbose>3) printf(" processing Edge OnGeometricEdge\n");225 if(bamgmesh->EdgesOnGeometricEdge){ 226 if(verbose>3) printf(" processing EdgesOnGeometricEdge\n"); 228 227 int i1,i2,i,j; 229 i2=bamgmesh->NumEdge OnGeometricEdge;228 i2=bamgmesh->NumEdgesOnGeometricEdge; 230 229 for (i1=0;i1<i2;i1++) { 231 i=(int)bamgmesh->Edge OnGeometricEdge[i*2+0];232 j=(int)bamgmesh->Edge OnGeometricEdge[i*2+1];230 i=(int)bamgmesh->EdgesOnGeometricEdge[i*2+0]; 231 j=(int)bamgmesh->EdgesOnGeometricEdge[i*2+1]; 233 232 if(!(i>0 && j >0 && i <= nbe && j <= Gh.nbe)) { 234 throw ErrorException(__FUNCT__,exprintf("Edge OnGeometricEdge error: We must have : (i>0 && j >0 && i <= nbe && j <= Gh.nbe)"));233 throw ErrorException(__FUNCT__,exprintf("EdgesOnGeometricEdge error: We must have : (i>0 && j >0 && i <= nbe && j <= Gh.nbe)")); 235 234 } 236 235 edges[i-1].on = Gh.edges + j-1; … … 238 237 } 239 238 else{ 240 if(verbose>3) printf(" no Edge OnGeometricEdge found\n");239 if(verbose>3) printf(" no EdgesOnGeometricEdge found\n"); 241 240 } 242 241 243 242 //SubDomain 244 if(bamgmesh->SubDomain ){243 if(bamgmesh->SubDomains){ 245 244 Int4 i3,head,sens; 246 if(verbose>3) printf(" processing SubDomain \n");247 NbSubDomains=bamgmesh->NumSubDomain ;245 if(verbose>3) printf(" processing SubDomains\n"); 246 NbSubDomains=bamgmesh->NumSubDomains; 248 247 subdomains = new SubDomain [ NbSubDomains ]; 249 248 for (i=0;i<NbSubDomains;i++) { 250 i3 =(int)bamgmesh->SubDomain [i*3+0];251 head=(int)bamgmesh->SubDomain [i*3+1]-1;//C indexing252 sens=(int)bamgmesh->SubDomain [i*3+2];249 i3 =(int)bamgmesh->SubDomains[i*3+0]; 250 head=(int)bamgmesh->SubDomains[i*3+1]-1;//C indexing 251 sens=(int)bamgmesh->SubDomains[i*3+2]; 253 252 if (i3!=23) throw ErrorException(__FUNCT__,exprintf("Bad Subdomain definition: first number should be 3")); 254 253 if (head<0 || head>=nbt) throw ErrorException(__FUNCT__,exprintf("Bad Subdomain definition: head should in [1 %i] (triangle number)",nbt)); … … 257 256 } 258 257 else{ 259 if(verbose>3) printf(" no SubDomain found\n");258 if(verbose>3) printf(" no SubDomains found\n"); 260 259 } 261 260 … … 1391 1390 1392 1391 //SubDomain 1393 if(bamggeom->SubDomain ){1392 if(bamggeom->SubDomains){ 1394 1393 Int4 i0,i1,i2,i3; 1395 if(verbose>3) printf(" processing SubDomain \n");1396 NbSubDomains=bamggeom->NumSubDomain ;1394 if(verbose>3) printf(" processing SubDomains\n"); 1395 NbSubDomains=bamggeom->NumSubDomains; 1397 1396 subdomains = new GeometricalSubDomain[NbSubDomains]; 1398 1397 for (i=0;i<NbSubDomains;i++) { 1399 i0=(int)bamggeom->SubDomain [i*4+0];1400 i1=(int)bamggeom->SubDomain [i*4+1];1401 i2=(int)bamggeom->SubDomain [i*4+2];1402 i3=(int)bamggeom->SubDomain [i*4+3];1398 i0=(int)bamggeom->SubDomains[i*4+0]; 1399 i1=(int)bamggeom->SubDomains[i*4+1]; 1400 i2=(int)bamggeom->SubDomains[i*4+2]; 1401 i3=(int)bamggeom->SubDomains[i*4+3]; 1403 1402 if (i0!=2) throw ErrorException(__FUNCT__,exprintf("Bad Subdomain definition: first number should be 2 (for Edges)")); 1404 1403 if (i1>nbe || i1<=0) throw ErrorException(__FUNCT__,exprintf("Bad Subdomain definition: second number should in [1 %i] (edge number)",nbe)); … … 1409 1408 } 1410 1409 else{ 1411 if(verbose>3) printf(" no SubDomain found\n");1410 if(verbose>3) printf(" no SubDomains found\n"); 1412 1411 } 1413 1412 } -
issm/trunk/src/c/Bamgx/MeshWrite.cpp
r2740 r2794 1 // -*- Mode : c++ -*- 2 // 3 // SUMMARY : 4 // USAGE : 5 // ORG : 6 // AUTHOR : Frederic Hecht 7 // E-MAIL : hecht@ann.jussieu.fr 8 // 9 10 /* 11 12 This file is part of Freefem++ 13 14 Freefem++ is free software; you can redistribute it and/or modify 15 it under the terms of the GNU Lesser General Public License as published by 16 the Free Software Foundation; either version 2.1 of the License, or 17 (at your option) any later version. 18 19 Freefem++ is distributed in the hope that it will be useful, 20 but WITHOUT ANY WARRANTY; without even the implied warranty of 21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 GNU Lesser General Public License for more details. 23 24 You should have received a copy of the GNU Lesser General Public License 25 along with Freefem++; if not, write to the Free Software 26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 */ 1 #include "../shared/shared.h" 2 #include "../include/macros.h" 3 #include "../toolkits/toolkits.h" 4 28 5 #include <cstdio> 29 6 #include <cstring> … … 553 530 } 554 531 532 void Triangles::WriteBamgMesh(BamgMesh* bamgmesh,BamgOpts* bamgopts){ 533 534 int i,j; 535 int verbose; 536 537 verbose=bamgopts->verbose; 538 Int4 *reft = new Int4[nbt]; 539 Int4 nbInT = ConsRefTriangle(reft); 540 541 //Vertices 542 if(verbose>3) printf(" writing Vertices\n"); 543 bamgmesh->NumVertices=nbv; 544 xfree((void**)&bamgmesh->Vertices); 545 if (nbv){ 546 bamgmesh->Vertices=(double*)xmalloc(3*nbv*sizeof(double)); 547 for (i=0;i<nbv;i++){ 548 bamgmesh->Vertices[i*3+0]=vertices[i].r.x; 549 bamgmesh->Vertices[i*3+1]=vertices[i].r.y; 550 bamgmesh->Vertices[i*3+2]=vertices[i].ref(); 551 } 552 } 553 else{ 554 bamgmesh->Vertices=NULL; 555 } 556 557 //Edges 558 if(verbose>3) printf(" writing Edges\n"); 559 bamgmesh->NumEdges=nbe; 560 xfree((void**)&bamgmesh->Edges); 561 if (nbe){ 562 bamgmesh->Edges=(double*)xmalloc(3*nbe*sizeof(double)); 563 for (i=0;i<nbe;i++){ 564 bamgmesh->Edges[i*3+0]=Number(edges[i][0])+1; //back to M indexing 565 bamgmesh->Edges[i*3+1]=Number(edges[i][1])+1; //back to M indexing 566 bamgmesh->Edges[i*3+2]=edges[i].ref; 567 } 568 } 569 else{ 570 bamgmesh->Edges=NULL; 571 } 572 573 //CrackedEdges 574 if(verbose>3) printf(" writing CrackedEdges\n"); 575 bamgmesh->NumCrackedEdges=NbCrackedEdges; 576 xfree((void**)&bamgmesh->CrackedEdges); 577 if (NbCrackedEdges){ 578 bamgmesh->CrackedEdges=(double*)xmalloc(2*NbCrackedEdges*sizeof(double)); 579 for (i=0;i<NbCrackedEdges;i++){ 580 bamgmesh->CrackedEdges[i*2+0]=Number(CrackedEdges[i].a.edge)+1; //back to M indexing 581 bamgmesh->CrackedEdges[i*2+1]=Number(CrackedEdges[i].b.edge)+1; //back to M indexing 582 } 583 } 584 else{ 585 bamgmesh->CrackedEdges=NULL; 586 } 587 588 //Triangles 589 if(verbose>3) printf(" writing Triangles\n"); 590 Int4 k=nbInT-NbOfQuad*2; 591 Int4 num=0; 592 bamgmesh->NumTriangles=k; 593 xfree((void**)&bamgmesh->Triangles); 594 if (k){ 595 bamgmesh->Triangles=(double*)xmalloc(4*k*sizeof(double)); 596 for (i=0;i<nbt;i++){ 597 Triangle &t=triangles[i]; 598 if (reft[i]>=0 && !( t.Hidden(0) || t.Hidden(1) || t.Hidden(2) )){ 599 bamgmesh->Triangles[num*4+0]=Number(t[0])+1; //back to M indexing 600 bamgmesh->Triangles[num*4+1]=Number(t[1])+1; //back to M indexing 601 bamgmesh->Triangles[num*4+2]=Number(t[2])+1; //back to M indexing 602 bamgmesh->Triangles[num*4+3]=subdomains[reft[i]].ref; 603 num=num+1; 604 } 605 } 606 } 607 else{ 608 bamgmesh->Triangles=NULL; 609 } 610 611 //Quadrilaterals 612 if(verbose>3) printf(" writing Quadrilaterals\n"); 613 bamgmesh->NumQuadrilaterals=NbOfQuad; 614 xfree((void**)&bamgmesh->Quadrilaterals); 615 if (NbOfQuad){ 616 bamgmesh->Quadrilaterals=(double*)xmalloc(5*NbOfQuad*sizeof(double)); 617 for (i=0;i<nbt;i++){ 618 Triangle &t =triangles[i]; 619 Triangle* ta; 620 Vertex *v0,*v1,*v2,*v3; 621 if (reft[i]<0) continue; 622 if ((ta=t.Quadrangle(v0,v1,v2,v3)) !=0 && &t<ta) { 623 bamgmesh->Quadrilaterals[i*5+0]=Number(v0)+1; //back to M indexing 624 bamgmesh->Quadrilaterals[i*5+1]=Number(v1)+1; //back to M indexing 625 bamgmesh->Quadrilaterals[i*5+2]=Number(v2)+1; //back to M indexing 626 bamgmesh->Quadrilaterals[i*5+3]=Number(v3)+1; //back to M indexing 627 bamgmesh->Quadrilaterals[i*5+4]=subdomains[reft[i]].ref; 628 } 629 } 630 } 631 else{ 632 bamgmesh->Quadrilaterals=NULL; 633 } 634 635 //SubDomains 636 if(verbose>3) printf(" writing SubDomains\n"); 637 bamgmesh->NumSubDomains=NbSubDomains; 638 xfree((void**)&bamgmesh->SubDomains); 639 if (NbSubDomains){ 640 bamgmesh->SubDomains=(double*)xmalloc(4*NbSubDomains*sizeof(double)); 641 for (i=0;i<NbSubDomains;i++){ 642 bamgmesh->SubDomains[i*4+0]=3; 643 bamgmesh->SubDomains[i*4+1]=reft[Number(subdomains[i].head)]; 644 bamgmesh->SubDomains[i*4+2]=1; 645 bamgmesh->SubDomains[i*4+3]=subdomains[i].ref; 646 } 647 } 648 else{ 649 bamgmesh->SubDomains=NULL; 650 } 651 652 //SubDomainsFromGeom 653 if(verbose>3) printf(" writing SubDomainsFromGeom\n"); 654 bamgmesh->NumSubDomainsFromGeom=Gh.NbSubDomains; 655 xfree((void**)&bamgmesh->SubDomainsFromGeom); 656 if (Gh.NbSubDomains){ 657 bamgmesh->SubDomainsFromGeom=(double*)xmalloc(4*Gh.NbSubDomains*sizeof(double)); 658 for (i=0;i<Gh.NbSubDomains;i++){ 659 bamgmesh->SubDomainsFromGeom[i*4+0]=2; 660 bamgmesh->SubDomainsFromGeom[i*4+1]=Number(subdomains[i].edge)+1; //back to Matlab indexing 661 bamgmesh->SubDomainsFromGeom[i*4+2]=subdomains[i].sens; 662 bamgmesh->SubDomainsFromGeom[i*4+3]=Gh.subdomains[i].ref; 663 } 664 } 665 else{ 666 bamgmesh->SubDomainsFromGeom=NULL; 667 } 668 669 //VerticesOnGeomVertex 670 if(verbose>3) printf(" writing VerticesOnGeometricVertex\n"); 671 bamgmesh->NumVerticesOnGeometricVertex=NbVerticesOnGeomVertex; 672 xfree((void**)&bamgmesh->VerticesOnGeometricVertex); 673 if (NbVerticesOnGeomVertex){ 674 bamgmesh->VerticesOnGeometricVertex=(double*)xmalloc(2*NbVerticesOnGeomVertex*sizeof(double)); 675 for (i=0;i<NbVerticesOnGeomVertex;i++){ 676 VertexOnGeom &v=VerticesOnGeomVertex[i]; 677 if (!v.OnGeomVertex()){ 678 throw ErrorException(__FUNCT__,exprintf("A vertices supposed to be OnGeometricVertex is actually not")); 679 } 680 bamgmesh->VerticesOnGeometricVertex[i*2+0]=Number((Vertex*)v)+1; //back to Matlab indexing 681 bamgmesh->VerticesOnGeometricVertex[i*2+1]=Gh.Number(( GeometricalVertex*)v)+1; //back to Matlab indexing 682 } 683 } 684 else{ 685 bamgmesh->VerticesOnGeometricVertex=NULL; 686 } 687 688 //VertexOnGeometricEdge 689 if(verbose>3) printf(" writing VerticesOnGeometricEdge\n"); 690 bamgmesh->NumVerticesOnGeometricEdge=NbVerticesOnGeomEdge; 691 xfree((void**)&bamgmesh->VerticesOnGeometricEdge); 692 if (NbVerticesOnGeomEdge){ 693 bamgmesh->VerticesOnGeometricEdge=(double*)xmalloc(3*NbVerticesOnGeomEdge*sizeof(double)); 694 for (i=0;i<NbVerticesOnGeomEdge;i++){ 695 const VertexOnGeom &v=VerticesOnGeomEdge[i]; 696 if (!v.OnGeomEdge()){ 697 throw ErrorException(__FUNCT__,exprintf("A vertices supposed to be OnGeometricEdge is actually not")); 698 } 699 bamgmesh->VerticesOnGeometricEdge[i*3+0]=Number((Vertex*)v)+1; //back to Matlab indexing 700 bamgmesh->VerticesOnGeometricEdge[i*3+1]=Gh.Number((const GeometricalEdge*)v)+1; //back to Matlab indexing 701 bamgmesh->VerticesOnGeometricEdge[i*3+2]=(double)v; 702 } 703 } 704 else{ 705 bamgmesh->VerticesOnGeometricEdge=NULL; 706 } 707 708 //EdgesOnGeometricEdge 709 if(verbose>3) printf(" writing EdgesOnGeometricEdge\n"); 710 k=0; 711 for (i=0;i<nbe;i++){ 712 if (edges[i].on) k=k+1; 713 } 714 bamgmesh->NumEdgesOnGeometricEdge=k; 715 xfree((void**)&bamgmesh->EdgesOnGeometricEdge); 716 if (k){ 717 bamgmesh->EdgesOnGeometricEdge=(double*)xmalloc(2*(int)k*sizeof(double)); 718 int count=0; 719 for (i=0;i<nbe;i++){ 720 if (edges[i].on){ 721 bamgmesh->EdgesOnGeometricEdge[count*2+0]=(double)i+1; //back to Matlab indexing 722 bamgmesh->EdgesOnGeometricEdge[count*2+1]=(double)Gh.Number(edges[i].on)+1; //back to Matlab indexing 723 count=count+1; 724 } 725 } 726 } 727 else{ 728 bamgmesh->EdgesOnGeometricEdge=NULL; 729 } 730 } 731 555 732 void Triangles::Write(const char * filename) 556 733 { … … 719 896 f << "\nEdgeOnGeometricEdge\n"<< k << endl; 720 897 for (i0=0;i0<Th.nbe;i0++) 721 if ( Th.edges[i0].on )722 f << (i0+1) << " " << (1+Th.Gh.Number(Th.edges[i0].on)) << endl;723 898 if ( Th.edges[i0].on ) 899 f << (i0+1) << " " << (1+Th.Gh.Number(Th.edges[i0].on)) << endl; 900 if (Th.NbCrackedEdges) 724 901 { 725 902 f << "\nCrackedEdges\n"<< Th.NbCrackedEdges << endl; -
issm/trunk/src/c/objects/BamgGeom.h
r2790 r2794 30 30 double* RequiredEdges; 31 31 32 int NumSubDomain ;33 double* SubDomain ;32 int NumSubDomains; 33 double* SubDomains; 34 34 }; 35 35 #endif -
issm/trunk/src/c/objects/BamgMesh.h
r2785 r2794 17 17 double* Edges; 18 18 19 int NumCrackedEdges; 20 double* CrackedEdges; 21 19 22 int NumQuadrilaterals; 20 23 double* Quadrilaterals; 21 24 22 int NumVert exOnGeometricEdge;23 double* Vert exOnGeometricEdge;25 int NumVerticesOnGeometricVertex; 26 double* VerticesOnGeometricVertex; 24 27 25 int Num EdgeOnGeometricEdge;26 double* EdgeOnGeometricEdge;28 int NumVerticesOnGeometricEdge; 29 double* VerticesOnGeometricEdge; 27 30 28 int NumSubDomain; 29 double* SubDomain; 31 int NumEdgesOnGeometricEdge; 32 double* EdgesOnGeometricEdge; 33 34 int NumSubDomains; 35 double* SubDomains; 36 37 int NumSubDomainsFromGeom; 38 double* SubDomainsFromGeom; 30 39 31 40 double* hVertices; -
issm/trunk/src/m/classes/public/bamg.m
r2790 r2794 19 19 bamg_geometry.Edges=zeros(0,3); 20 20 bamg_geometry.hVertices=zeros(0,1); 21 bamg_geometry.NumSubDomain =0;22 bamg_geometry.SubDomain =zeros(0,3);21 bamg_geometry.NumSubDomains=0; 22 bamg_geometry.SubDomains=zeros(0,3); 23 23 if exist(options,'domain'), 24 24 domainfile=getfieldvalueerr(options,'domain'); … … 38 38 if i>1, 39 39 clockwise=-1; 40 bamg_geometry.SubDomain =[2 count+1 clockwise 1];40 bamg_geometry.SubDomains=[2 count+1 clockwise 1]; 41 41 end 42 42 count=count+nods; … … 44 44 bamg_geometry.NumVertices=size(bamg_geometry.Vertices,1); 45 45 bamg_geometry.NumEdges=size(bamg_geometry.Edges,1); 46 bamg_geometry.NumSubDomain =size(bamg_geometry.SubDomain,1);46 bamg_geometry.NumSubDomains=size(bamg_geometry.SubDomains,1); 47 47 end 48 48 end -
issm/trunk/src/mex/Bamg/Bamg.cpp
r2790 r2794 26 26 double* hVerticesGeom=NULL; 27 27 double MaximalAngleOfCorner; 28 int NumSubDomain Geom;29 double* SubDomain Geom=NULL;28 int NumSubDomainsGeom; 29 double* SubDomainsGeom=NULL; 30 30 31 31 /*Options inputs*/ … … 63 63 bamggeom.NumRequiredEdges=0; 64 64 bamggeom.RequiredEdges=NULL; 65 FetchData(&NumSubDomain Geom,mxGetField(BAMGGEOMETRY,0,"NumSubDomain"));66 bamggeom.NumSubDomain =NumSubDomainGeom;67 FetchData(&SubDomain Geom,NULL,NULL,mxGetField(BAMGGEOMETRY,0,"SubDomain"));68 bamggeom.SubDomain =SubDomainGeom;65 FetchData(&NumSubDomainsGeom,mxGetField(BAMGGEOMETRY,0,"NumSubDomains")); 66 bamggeom.NumSubDomains=NumSubDomainsGeom; 67 FetchData(&SubDomainsGeom,NULL,NULL,mxGetField(BAMGGEOMETRY,0,"SubDomains")); 68 bamggeom.SubDomains=SubDomainsGeom; 69 69 70 70 /*create bamg mesh input*/ … … 80 80 bamgmesh.NumQuadrilaterals=0; 81 81 bamgmesh.Quadrilaterals=NULL; 82 bamgmesh.NumVertexOnGeometricEdge=0; 83 bamgmesh.VertexOnGeometricEdge=NULL; 84 bamgmesh.NumEdgeOnGeometricEdge=0; 85 bamgmesh.EdgeOnGeometricEdge=NULL; 82 bamgmesh.NumVerticesOnGeometricVertex=0; 83 bamgmesh.VerticesOnGeometricVertex=NULL; 84 bamgmesh.NumVerticesOnGeometricEdge=0; 85 bamgmesh.VerticesOnGeometricEdge=NULL; 86 bamgmesh.NumEdgesOnGeometricEdge=0; 87 bamgmesh.EdgesOnGeometricEdge=NULL; 86 88 bamgmesh.NumEdges=0; 87 89 bamgmesh.Edges=NULL; 88 bamgmesh.NumSubDomain=0; 89 bamgmesh.SubDomain=NULL; 90 bamgmesh.NumCrackedEdges=0; 91 bamgmesh.CrackedEdges=NULL; 92 bamgmesh.NumSubDomains=0; 93 bamgmesh.SubDomains=NULL; 94 bamgmesh.NumSubDomainsFromGeom=0; 95 bamgmesh.SubDomainsFromGeom=NULL; 90 96 91 97 /*create bamg options input*/ … … 122 128 xfree((void**)&EdgesGeom); 123 129 xfree((void**)&hVerticesGeom); 124 xfree((void**)&SubDomain Geom);130 xfree((void**)&SubDomainsGeom); 125 131 //xfree((void**)&TrianglesMesh); 126 132 //xfree((void**)&VerticesMesh);
Note:
See TracChangeset
for help on using the changeset viewer.