Changeset 12093
- Timestamp:
- 04/20/12 15:02:46 (13 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Makefile.am
r12074 r12093 793 793 ./modules/TriMeshx/TriMeshx.h\ 794 794 ./modules/TriMeshx/TriMeshx.cpp\ 795 ./modules/TriMeshRiftsx/TriMeshRiftsx.h\796 ./modules/TriMeshRiftsx/TriMeshRiftsx.cpp\797 795 ./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h\ 798 796 ./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp\ -
issm/trunk-jpl/src/c/modules/TriMeshRiftsx/TriMeshRiftsx.cpp
r12063 r12093 20 20 /*}}}*/ 21 21 22 void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area ,bool order){22 void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){ 23 23 24 24 /*indexing: */ … … 48 48 in.numberofpoints+=contour->nods; 49 49 } 50 if (rifts){ 51 for (i=0;i<rifts->Size();i++){ 52 contour=(Contour*)rifts->GetObjectByOffset(i); 53 in.numberofpoints+=contour->nods; 54 } 55 } 50 for (i=0;i<rifts->Size();i++){ 51 contour=(Contour*)rifts->GetObjectByOffset(i); 52 in.numberofpoints+=contour->nods; 53 } 54 56 55 /*number of point attributes: */ 57 56 in.numberofpointattributes=1; … … 69 68 } 70 69 } 71 if(rifts){ 72 for (i=0;i<rifts->Size();i++){ 73 contour=(Contour*)rifts->GetObjectByOffset(i); 74 for (j=0;j<contour->nods;j++){ 75 in.pointlist[2*counter+0]=contour->x[j]; 76 in.pointlist[2*counter+1]=contour->y[j]; 77 counter++; 78 } 70 for (i=0;i<rifts->Size();i++){ 71 contour=(Contour*)rifts->GetObjectByOffset(i); 72 for (j=0;j<contour->nods;j++){ 73 in.pointlist[2*counter+0]=contour->x[j]; 74 in.pointlist[2*counter+1]=contour->y[j]; 75 counter++; 79 76 } 80 77 } … … 94 91 in.numberofsegments+=contour->nods; 95 92 } 96 if(rifts){ 97 for(i=0;i<rifts->Size();i++){ 98 contour=(Contour*)rifts->GetObjectByOffset(i); 99 /*for rifts, we have one less segment as we have vertices*/ 100 in.numberofsegments+=contour->nods-1; 101 } 93 for(i=0;i<rifts->Size();i++){ 94 contour=(Contour*)rifts->GetObjectByOffset(i); 95 /*for rifts, we have one less segment as we have vertices*/ 96 in.numberofsegments+=contour->nods-1; 102 97 } 103 98 … … 122 117 } 123 118 counter2=counter; 124 if(rifts){ 125 for (i=0;i<rifts->Size();i++){ 126 contour=(Contour*)rifts->GetObjectByOffset(i); 127 for (j=0;j<(contour->nods-1);j++){ 128 in.segmentlist[2*counter2+0]=counter; 129 in.segmentlist[2*counter2+1]=counter+1; 130 in.segmentmarkerlist[counter2]=2+i; 131 counter2++; 132 counter++; 133 } 134 counter++; 135 } 119 for (i=0;i<rifts->Size();i++){ 120 contour=(Contour*)rifts->GetObjectByOffset(i); 121 for (j=0;j<(contour->nods-1);j++){ 122 in.segmentlist[2*counter2+0]=counter; 123 in.segmentlist[2*counter2+1]=counter+1; 124 in.segmentmarkerlist[counter2]=2+i; 125 counter2++; 126 counter++; 127 } 128 counter++; 136 129 } 137 130 … … 196 189 197 190 /*Order segments so that their normals point outside the domain: */ 198 if(order){ 199 OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles); 200 } 191 OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles); 201 192 202 193 /*Output : */ -
issm/trunk-jpl/src/c/modules/TriMeshRiftsx/TriMeshRiftsx.h
r12063 r12093 11 11 12 12 /* local prototypes: */ 13 void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area ,bool order);13 void TriMeshRiftsx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area); 14 14 15 15 #endif /* _TRIMESHX_H */ -
issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
r12061 r12093 20 20 /*}}}*/ 21 21 22 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain, double area,bool order){22 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){ 23 23 24 24 /*indexing: */ … … 35 35 36 36 /*intermediary: */ 37 int counter, backcounter;37 int counter,counter2,backcounter; 38 38 Contour* contour=NULL; 39 39 … … 48 48 in.numberofpoints+=contour->nods; 49 49 } 50 for (i=0;i<rifts->Size();i++){ 51 contour=(Contour*)rifts->GetObjectByOffset(i); 52 in.numberofpoints+=contour->nods; 53 } 54 50 55 /*number of point attributes: */ 51 56 in.numberofpointattributes=1; … … 63 68 } 64 69 } 70 for (i=0;i<rifts->Size();i++){ 71 contour=(Contour*)rifts->GetObjectByOffset(i); 72 for (j=0;j<contour->nods;j++){ 73 in.pointlist[2*counter+0]=contour->x[j]; 74 in.pointlist[2*counter+1]=contour->y[j]; 75 counter++; 76 } 77 } 65 78 66 79 /*fill in the point attribute list: */ 67 in.pointattributelist = (REAL *) xmalloc(in.numberofpoints * in.numberofpointattributes *sizeof(REAL));80 in.pointattributelist = (REAL*)xmalloc(in.numberofpoints*in.numberofpointattributes*sizeof(REAL)); 68 81 for (i=0;i<in.numberofpoints;i++) in.pointattributelist[i] = 0.0; 69 82 … … 77 90 contour=(Contour*)domain->GetObjectByOffset(i); 78 91 in.numberofsegments+=contour->nods; 92 } 93 for(i=0;i<rifts->Size();i++){ 94 contour=(Contour*)rifts->GetObjectByOffset(i); 95 /*for rifts, we have one less segment as we have vertices*/ 96 in.numberofsegments+=contour->nods-1; 79 97 } 80 98 … … 97 115 counter++; 98 116 backcounter=counter; 117 } 118 counter2=counter; 119 for (i=0;i<rifts->Size();i++){ 120 contour=(Contour*)rifts->GetObjectByOffset(i); 121 for (j=0;j<(contour->nods-1);j++){ 122 in.segmentlist[2*counter2+0]=counter; 123 in.segmentlist[2*counter2+1]=counter+1; 124 in.segmentmarkerlist[counter2]=2+i; 125 counter2++; 126 counter++; 127 } 128 counter++; 99 129 } 100 130 … … 159 189 160 190 /*Order segments so that their normals point outside the domain: */ 161 if(order){ 162 OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles); 163 } 191 OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles); 164 192 165 193 /*Output : */ -
issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h
r12056 r12093 7 7 8 8 #include "string.h" 9 10 9 #include "../../Container/Container.h" 11 10 #include "../../objects/objects.h" 12 11 13 12 /* local prototypes: */ 14 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain, double area,bool order);13 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area); 15 14 16 15 #endif /* _TRIMESHX_H */ -
issm/trunk-jpl/src/c/shared/Exp/DomainOutlineRead.cpp
r11935 r12093 14 14 15 15 int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole=true){ 16 17 16 18 17 /*indexing: */ … … 128 127 DataSet* DomainOutlineRead(char* domainname,bool whole=true){ 129 128 130 /*indexing: */131 int i;132 133 129 /*intermediary: */ 134 int nprof; 135 int* profnvertices=NULL; 136 double** pprofx=NULL; 137 double** pprofy=NULL; 138 139 Contour* contour=NULL; 130 int nprof; 131 int *profnvertices = NULL; 132 double **pprofx = NULL; 133 double **pprofy = NULL; 134 Contour *contour = NULL; 140 135 141 136 /*output: */ 142 137 DataSet* domain=NULL; 143 138 144 /*get domain outline from intermediary function:*/ 145 DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname,whole); 139 /*If domainname is an empty string, return empty dataset*/ 140 if (strcmp(domainname,"")==0){ 141 nprof=0; 142 } 143 else{ 144 DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname,whole); 145 } 146 146 147 147 /*now create dataset of contours: */ 148 148 domain=new DataSet(0); 149 149 150 for(i =0;i<nprof;i++){150 for(int i=0;i<nprof;i++){ 151 151 domain->AddObject(new Contour(i,profnvertices[i],pprofx[i],pprofy[i],1)); 152 152 } 153 154 153 return domain; 155 154 } -
issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp
r12025 r12093 8 8 9 9 /* input: */ 10 char * domainname=NULL;11 double area;12 bool order;10 char *domainname = NULL; 11 char *riftsname = NULL; 12 double area; 13 13 14 14 /*intermediary: */ 15 DataSet* domain=NULL; 15 DataSet *domain = NULL; 16 DataSet *rifts = NULL; 16 17 17 18 /* output: */ 18 Matrix * index=NULL;19 Vector * x=NULL;20 Vector * y=NULL;21 Matrix * segments=NULL;22 Vector * segmentmarkerlist=NULL;19 Matrix *index = NULL; 20 Vector *x = NULL; 21 Vector *y = NULL; 22 Matrix *segments = NULL; 23 Vector *segmentmarkerlist = NULL; 23 24 24 25 /*Boot module: */ … … 30 31 /*Fetch data needed for meshing: */ 31 32 FetchData(&domainname,DOMAINOUTLINE); 33 FetchData(&riftsname,RIFTSOUTLINE); 32 34 FetchData(&area,AREA); 33 FetchData(&order,ORDER);34 35 35 36 /*Read domain outline: */ 36 domain=DomainOutlineRead(domainname,false); 37 domain = DomainOutlineRead(domainname,false); 38 rifts = DomainOutlineRead(riftsname,false); 37 39 38 40 /*call x core: */ 39 TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain, area,order);40 41 TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain,rifts,area); 42 41 43 /*write outputs: */ 42 44 WriteData(INDEX,index); … … 48 50 /*free ressources: */ 49 51 delete domain; 52 delete rifts; 50 53 xdelete_module(&index); 51 54 xdelete_module(&x); … … 61 64 { 62 65 printf("\n"); 63 printf(" usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename, area,ordered) \n");66 printf(" usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,rifts,area) \n"); 64 67 printf(" where: index,x,y defines a triangulation, segments is an array made \n"); 65 68 printf(" of exterior segments to the mesh domain outline, segmentmarkers is an array flagging each segment, \n"); 66 69 printf(" outlinefilename an Argus domain outline file, \n"); 67 70 printf(" area is the maximum area desired for any element of the resulting mesh, \n"); 68 printf(" and ordered is a bool that determines whether segments are output in the \n");69 printf(" order they are made by Triangle (ie none), or ordered counter clockwise around the domain outline.\n");70 71 printf("\n"); 71 72 } -
issm/trunk-jpl/src/modules/TriMesh/TriMesh.h
r12032 r12093 31 31 /* serial input macros: */ 32 32 #define DOMAINOUTLINE (mxArray *)prhs[0] 33 #define AREA(mxArray *)prhs[1]34 #define ORDER(mxArray *)prhs[2]33 #define RIFTSOUTLINE (mxArray *)prhs[1] 34 #define AREA (mxArray *)prhs[2] 35 35 /* serial output macros: */ 36 36 #define INDEX (mxArray**)&plhs[0] … … 44 44 /* serial input macros: */ 45 45 #define DOMAINOUTLINE PyTuple_GetItem(args,0) 46 #define AREAPyTuple_GetItem(args,1)47 #define ORDERPyTuple_GetItem(args,2)46 #define RIFTSOUTLINE PyTuple_GetItem(args,1) 47 #define AREA PyTuple_GetItem(args,2) 48 48 /* serial output macros: */ 49 49 #define INDEX output,0 -
issm/trunk-jpl/src/modules/matlab/Makefile.am
r12090 r12093 35 35 TriaSearch\ 36 36 TriMesh\ 37 TriMeshRifts\38 37 TriMeshProcessRifts\ 39 38 Xy2ll … … 156 155 ../TriMesh/TriMesh.h 157 156 158 TriMeshRifts_SOURCES = ../TriMeshRifts/TriMeshRifts.cpp\159 ../TriMeshRifts/TriMeshRifts.h160 161 157 TriMeshProcessRifts_SOURCES = ../TriMeshProcessRifts/TriMeshProcessRifts.cpp\ 162 158 ../TriMeshProcessRifts/TriMeshProcessRifts.h
Note:
See TracChangeset
for help on using the changeset viewer.