Changeset 8306 for issm/trunk/src/mex/TriMeshNoDensity/TriMeshNoDensity.cpp
- Timestamp:
- 05/16/11 15:50:34 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/mex/TriMeshNoDensity/TriMeshNoDensity.cpp
r4526 r8306 33 33 /*Domain outline variables: */ 34 34 int nprof; 35 int* profn grids=NULL;35 int* profnvertices=NULL; 36 36 double** pprofx=NULL; 37 37 double** pprofy=NULL; … … 42 42 /*Rift outline variables: */ 43 43 int numrifts; 44 int* riftsnum grids=NULL;45 double** rifts gridsx=NULL;46 double** rifts gridsy=NULL;44 int* riftsnumvertices=NULL; 45 double** riftsverticesx=NULL; 46 double** riftsverticesy=NULL; 47 47 48 48 /* Triangle structures: */ … … 86 86 87 87 /*Start reading the domain outline file: */ 88 if(!DomainOutlineRead(&nprof,&profn grids,&pprofx,&pprofy,domainname)){88 if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,domainname)){ 89 89 printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname); 90 90 mexErrMsgTxt(" "); … … 93 93 /*Read rifts file if present: */ 94 94 if(riftname){ 95 if(!DomainOutlineRead(&numrifts,&riftsnum grids,&riftsgridsx,&riftsgridsy,riftname)){95 if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,riftname)){ 96 96 printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname); 97 97 mexErrMsgTxt(" "); … … 102 102 numberofpoints=0; 103 103 for (i=0;i<nprof;i++){ 104 numberofpoints+=profn grids[i];104 numberofpoints+=profnvertices[i]; 105 105 } 106 106 if (riftname){ 107 107 for (i=0;i<numrifts;i++){ 108 numberofpoints+=riftsnum grids[i];108 numberofpoints+=riftsnumvertices[i]; 109 109 } 110 110 } … … 118 118 xprof=pprofx[i]; 119 119 yprof=pprofy[i]; 120 for (j=0;j<profn grids[i];j++){120 for (j=0;j<profnvertices[i];j++){ 121 121 in.pointlist[2*counter+0]=xprof[j]; 122 122 in.pointlist[2*counter+1]=yprof[j]; … … 126 126 if(riftname){ 127 127 for (i=0;i<numrifts;i++){ 128 xprof=rifts gridsx[i];129 yprof=rifts gridsy[i];130 for (j=0;j<riftsnum grids[i];j++){128 xprof=riftsverticesx[i]; 129 yprof=riftsverticesy[i]; 130 for (j=0;j<riftsnumvertices[i];j++){ 131 131 in.pointlist[2*counter+0]=xprof[j]; 132 132 in.pointlist[2*counter+1]=yprof[j]; … … 149 149 150 150 /*Build segments: */ 151 /*Figure out number of segments: holes and closed outlines have as many segments as grids,152 *for rifts, we have one less segment as we have grids*/151 /*Figure out number of segments: holes and closed outlines have as many segments as vertices, 152 *for rifts, we have one less segment as we have vertices*/ 153 153 in.numberofsegments=0; 154 154 for (i=0;i<nprof;i++){ 155 in.numberofsegments+=profn grids[i];155 in.numberofsegments+=profnvertices[i]; 156 156 } 157 157 if (riftname){ 158 158 for (i=0;i<numrifts;i++){ 159 in.numberofsegments+=riftsnum grids[i]-1;159 in.numberofsegments+=riftsnumvertices[i]-1; 160 160 } 161 161 } … … 166 166 backcounter=0; 167 167 for (i=0;i<nprof;i++){ 168 for (j=0;j<(profn grids[i]-1);j++){168 for (j=0;j<(profnvertices[i]-1);j++){ 169 169 in.segmentlist[2*counter+0]=counter; 170 170 in.segmentlist[2*counter+1]=counter+1; … … 182 182 if(riftname){ 183 183 for (i=0;i<numrifts;i++){ 184 for (j=0;j<(riftsnum grids[i]-1);j++){184 for (j=0;j<(riftsnumvertices[i]-1);j++){ 185 185 in.segmentlist[2*counter2+0]=counter; 186 186 in.segmentlist[2*counter2+1]=counter+1; … … 201 201 in.holelist = (REAL *) mxMalloc(in.numberofholes * 2 * sizeof(REAL)); 202 202 for (i=0;i<nprof-1;i++){ 203 /*We are looking for a gridthat lies inside the hole: */204 GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],profn grids[i+1],pprofx[i+1],pprofy[i+1]);203 /*We are looking for a vertex that lies inside the hole: */ 204 GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],profnvertices[i+1],pprofx[i+1],pprofy[i+1]); 205 205 } 206 206
Note:
See TracChangeset
for help on using the changeset viewer.