Changeset 8306
- Timestamp:
- 05/16/11 15:50:34 (14 years ago)
- Location:
- issm/trunk/src/mex
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp
r8269 r8306 84 84 printf("\nContour echo: contour number %i / %i\n",i+1,numcontours); 85 85 contouri=*(contours+i); 86 printf(" Number of grids %i\n",contouri->nods);86 printf(" Number of vertices %i\n",contouri->nods); 87 87 for (j=0;j<contouri->nods;j++){ 88 88 printf(" %lf %lf\n",*(contouri->x+j),*(contouri->y+j)); -
issm/trunk/src/mex/ContourToNodes/ContourToNodes.cpp
r5030 r8306 84 84 printf("\nContour echo: contour number %i / %i\n",i+1,numcontours); 85 85 contouri=*(contours+i); 86 printf(" Number of grids %i\n",contouri->nods);86 printf(" Number of nodes %i\n",contouri->nods); 87 87 for (j=0;j<contouri->nods;j++){ 88 88 printf(" %lf %lf\n",*(contouri->x+j),*(contouri->y+j)); -
issm/trunk/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp
r7519 r8306 1 1 /*!\file InterpFromGridToMesh.c 2 * \brief: data interpolation from a list of (x,y,values) into mesh grids2 * \brief: data interpolation from a list of (x,y,values) into mesh vertices 3 3 4 4 InterpFromGridToMesh.c … … 12 12 x,y: coordinates of matrix data 13 13 data - matrix holding the data to be interpolated onto the mesh. 14 x_mesh,y_mesh: coordinates of the mesh grids onto which we interpolate.14 x_mesh,y_mesh: coordinates of the mesh vertices onto which we interpolate. 15 15 16 16 output: -
issm/trunk/src/mex/InterpFromMesh2d/InterpFromMesh2d.cpp
r6412 r8306 1 1 /*!\file InterpFromMesh2d.c 2 * \brief: data interpolation from a list of (x,y,values) into mesh grids2 * \brief: data interpolation from a list of (x,y,values) into mesh vertices 3 3 4 4 InterpFromMesh2d.c … … 12 12 x,y: coordinates of matrix data 13 13 data - matrix holding the data to be interpolated onto the mesh. 14 x_mesh,y_mesh: coordinates of the mesh grids onto which we interpolate.14 x_mesh,y_mesh: coordinates of the mesh vertices onto which we interpolate. 15 15 16 16 output: … … 116 116 printf("\nContour echo: contour number %i / %i\n",i+1,numcontours); 117 117 contouri=*(contours+i); 118 printf(" Number of grids %i\n",contouri->nods);118 printf(" Number of vertices %i\n",contouri->nods); 119 119 for (j=0;j<contouri->nods;j++){ 120 120 printf(" %lf %lf\n",*(contouri->x+j),*(contouri->y+j)); … … 162 162 _printf_(true," index: index of the mesh where data is defined\n"); 163 163 _printf_(true," data - vector holding the data to be interpolated onto the points.\n"); 164 _printf_(true," x_prime,y_prime: coordinates of the mesh grids onto which we interpolate.\n");164 _printf_(true," x_prime,y_prime: coordinates of the mesh vertices onto which we interpolate.\n"); 165 165 _printf_(true," default_value: a scalar or vector of size length(x_prime).\n"); 166 166 _printf_(true," contourname: linear interpolation will happen on all x_interp,y_interp inside the contour, default value will be adopted on the rest of the mesh.\n"); -
issm/trunk/src/mex/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
r6412 r8306 94 94 printf("\nContour echo: contour number %i / %i\n",i+1,numcontours); 95 95 contouri=*(contours+i); 96 printf(" Number of grids %i\n",contouri->nods);96 printf(" Number of vertices %i\n",contouri->nods); 97 97 for (j=0;j<contouri->nods;j++){ 98 98 printf(" %lf %lf\n",*(contouri->x+j),*(contouri->y+j)); -
issm/trunk/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
r6412 r8306 1 1 /*!\file InterpFromMeshToMesh3d.c 2 * \brief: data interpolation from a list of (x,y,values) into mesh grids2 * \brief: data interpolation from a list of (x,y,values) into mesh vertices 3 3 4 4 InterpFromMeshToMesh3d.c … … 12 12 x,y,z: coordinates of matrix data 13 13 data - matrix holding the data to be interpolated onto the mesh. 14 x_mesh,y_mesh,z_mesh: coordinates of the mesh grids onto which we interpolate.14 x_mesh,y_mesh,z_mesh: coordinates of the mesh vertices onto which we interpolate. 15 15 16 16 output: -
issm/trunk/src/mex/MeshPartition/MeshPartition.cpp
r7961 r8306 7 7 %Info needed from model are the following: 8 8 %mesh info: 9 numberofelements,numberof grids,elements,elements_width9 numberofelements,numberofnodes,elements,elements_width 10 10 %Non-extruded 2d mesh info 11 11 nel2d,nods2d,elements2d, … … 32 32 int dim; 33 33 int numberofelements; 34 int numberof grids;34 int numberofnodes; 35 35 double* elements=NULL; 36 36 int elements_width; 37 37 38 38 int numberofelements2d; 39 int numberof grids2d;39 int numberofnodes2d; 40 40 double* elements2d=NULL; 41 41 … … 59 59 FetchData(&dim,mxGetAssignedField(MODEL,0,"dim")); 60 60 FetchData(&numberofelements,mxGetAssignedField(MODEL,0,"numberofelements")); 61 FetchData(&numberof grids,mxGetAssignedField(MODEL,0,"numberofgrids"));61 FetchData(&numberofnodes,mxGetAssignedField(MODEL,0,"numberofnodes")); 62 62 FetchData(&elements,NULL,&elements_width,mxGetAssignedField(MODEL,0,"elements")); 63 63 … … 65 65 66 66 FetchData(&numberofelements2d,mxGetAssignedField(MODEL,0,"numberofelements2d")); 67 FetchData(&numberof grids2d,mxGetAssignedField(MODEL,0,"numberofgrids2d"));67 FetchData(&numberofnodes2d,mxGetAssignedField(MODEL,0,"numberofnodes2d")); 68 68 FetchData(&elements2d,NULL,NULL,mxGetAssignedField(MODEL,0,"elements2d")); 69 69 … … 73 73 74 74 /*Run partitioning algorithm based on a "clever" use of the Metis partitioner: */ 75 MeshPartitionx(&int_element_partitioning,&int_node_partitioning,numberofelements,numberof grids,elements,76 numberofelements2d,numberof grids2d,elements2d,numlayers,elements_width,dim,numareas);75 MeshPartitionx(&int_element_partitioning,&int_node_partitioning,numberofelements,numberofnodes,elements, 76 numberofelements2d,numberofnodes2d,elements2d,numlayers,elements_width,dim,numareas); 77 77 78 78 … … 83 83 } 84 84 85 node_partitioning=(double*)xmalloc(numberof grids*sizeof(double));86 for (i=0;i<numberof grids;i++){85 node_partitioning=(double*)xmalloc(numberofnodes*sizeof(double)); 86 for (i=0;i<numberofnodes;i++){ 87 87 node_partitioning[i]=(double)int_node_partitioning[i]+1; //Metis indexing from 0, matlab from 1. 88 88 } … … 90 90 /*Write data:*/ 91 91 WriteData(ELEMENTPARTITIONING,element_partitioning,numberofelements); 92 WriteData(NODEPARTITIONING,node_partitioning,numberof grids);92 WriteData(NODEPARTITIONING,node_partitioning,numberofnodes); 93 93 94 94 /*Free ressources:*/ -
issm/trunk/src/mex/MeshProfileIntersection/MeshProfileIntersection.cpp
r6412 r8306 83 83 printf("\nContour echo: contour number %i / %i\n",i+1,numcontours); 84 84 contouri=*(contours+i); 85 printf(" Number of grids %i\n",contouri->nods);85 printf(" Number of vertices %i\n",contouri->nods); 86 86 for (j=0;j<contouri->nods;j++){ 87 87 printf(" %lf %lf\n",*(contouri->x+j),*(contouri->y+j)); -
issm/trunk/src/mex/ModelProcessor/ModelProcessor.cpp
r6412 r8306 66 66 void ModelProcessorUsage(void) { 67 67 _printf_(true,"\n"); 68 _printf_(true," usage: [elements, grids,constraints,loads,materials,parameters,part,tpart]=ModelProcessor(model,analyses)\n");68 _printf_(true," usage: [elements,vertices,constraints,loads,materials,parameters,part,tpart]=ModelProcessor(model,analyses)\n"); 69 69 _printf_(true," where: model is an instance of the matlab @model class and analyses is a list of analysis types being performed.\n"); 70 70 _printf_(true,"\n"); -
issm/trunk/src/mex/TriMesh/TriMesh.cpp
r4526 r8306 35 35 /*Domain outline variables: */ 36 36 int nprof; 37 int* profn grids=NULL;37 int* profnvertices=NULL; 38 38 double** pprofx=NULL; 39 39 double** pprofy=NULL; … … 44 44 /*Rift outline variables: */ 45 45 int numrifts; 46 int* riftsnum grids=NULL;47 double** rifts gridsx=NULL;48 double** rifts gridsy=NULL;46 int* riftsnumvertices=NULL; 47 double** riftsverticesx=NULL; 48 double** riftsverticesy=NULL; 49 49 50 50 /* Triangle structures: */ … … 96 96 97 97 /*Start reading the domain outline file: */ 98 if(!DomainOutlineRead(&nprof,&profn grids,&pprofx,&pprofy,domainname)){98 if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,domainname)){ 99 99 printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname); 100 100 mexErrMsgTxt(" "); … … 103 103 /*Read rifts file if present: */ 104 104 if(riftname){ 105 if(!DomainOutlineRead(&numrifts,&riftsnum grids,&riftsgridsx,&riftsgridsy,riftname)){105 if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,riftname)){ 106 106 printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname); 107 107 mexErrMsgTxt(" "); … … 112 112 numberofpoints=0; 113 113 for (i=0;i<nprof;i++){ 114 numberofpoints+=profn grids[i];114 numberofpoints+=profnvertices[i]; 115 115 } 116 116 if (riftname){ 117 117 for (i=0;i<numrifts;i++){ 118 numberofpoints+=riftsnum grids[i];118 numberofpoints+=riftsnumvertices[i]; 119 119 } 120 120 } … … 128 128 xprof=pprofx[i]; 129 129 yprof=pprofy[i]; 130 for (j=0;j<profn grids[i];j++){130 for (j=0;j<profnvertices[i];j++){ 131 131 in.pointlist[2*counter+0]=xprof[j]; 132 132 in.pointlist[2*counter+1]=yprof[j]; … … 136 136 if(riftname){ 137 137 for (i=0;i<numrifts;i++){ 138 xprof=rifts gridsx[i];139 yprof=rifts gridsy[i];140 for (j=0;j<riftsnum grids[i];j++){138 xprof=riftsverticesx[i]; 139 yprof=riftsverticesy[i]; 140 for (j=0;j<riftsnumvertices[i];j++){ 141 141 in.pointlist[2*counter+0]=xprof[j]; 142 142 in.pointlist[2*counter+1]=yprof[j]; … … 158 158 159 159 /*Build segments: */ 160 /*Figure out number of segments: holes and closed outlines have as many segments as grids,161 *for rifts, we have one less segment as we have grids*/160 /*Figure out number of segments: holes and closed outlines have as many segments as vertices, 161 *for rifts, we have one less segment as we have vertices*/ 162 162 in.numberofsegments=0; 163 163 for (i=0;i<nprof;i++){ 164 in.numberofsegments+=profn grids[i];164 in.numberofsegments+=profnvertices[i]; 165 165 } 166 166 if (riftname){ 167 167 for (i=0;i<numrifts;i++){ 168 in.numberofsegments+=riftsnum grids[i]-1;168 in.numberofsegments+=riftsnumvertices[i]-1; 169 169 } 170 170 } … … 175 175 backcounter=0; 176 176 for (i=0;i<nprof;i++){ 177 for (j=0;j<(profn grids[i]-1);j++){177 for (j=0;j<(profnvertices[i]-1);j++){ 178 178 in.segmentlist[2*counter+0]=counter; 179 179 in.segmentlist[2*counter+1]=counter+1; … … 191 191 if(riftname){ 192 192 for (i=0;i<numrifts;i++){ 193 for (j=0;j<(riftsnum grids[i]-1);j++){193 for (j=0;j<(riftsnumvertices[i]-1);j++){ 194 194 in.segmentlist[2*counter2+0]=counter; 195 195 in.segmentlist[2*counter2+1]=counter+1; … … 210 210 in.holelist = (REAL *) mxMalloc(in.numberofholes * 2 * sizeof(REAL)); 211 211 for (i=0;i<nprof-1;i++){ 212 /*We are looking for a gridthat lies inside the hole: */213 GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],profn grids[i+1],pprofx[i+1],pprofy[i+1]);212 /*We are looking for a vertex that lies inside the hole: */ 213 GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],profnvertices[i+1],pprofx[i+1],pprofy[i+1]); 214 214 } 215 215 -
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 -
issm/trunk/src/mex/TriMeshProcessRifts/TriMeshProcessRifts.cpp
r6748 r8306 165 165 166 166 /*First, do some fixing on the existing mesh: we do not want any element belonging entirely to the segment list (ie: 167 *all the grids of this element belong to the segments (tends to happen when there are corners: */167 *all the nodes of this element belong to the segments (tends to happen when there are corners: */ 168 168 RemoveCornersFromRifts(&index_in,&nel,&x_in,&y_in,&nods,segments_in,segmentmarkers_in,num_seg); 169 169 -
issm/trunk/src/mex/TriaSearch/TriaSearch.cpp
r6412 r8306 19 19 double* x0=NULL; 20 20 double* y0=NULL; 21 int numberof grids;21 int numberofnodes; 22 22 23 23 /* output: */ … … 34 34 FetchData(&x,&nods,XHANDLE); 35 35 FetchData(&y,&nods,YHANDLE); 36 FetchData(&x0,&numberof grids,X0HANDLE);37 FetchData(&y0,&numberof grids,Y0HANDLE);36 FetchData(&x0,&numberofnodes,X0HANDLE); 37 FetchData(&y0,&numberofnodes,Y0HANDLE); 38 38 39 39 /* Echo: {{{1*/ … … 42 42 43 43 /* Run core computations: */ 44 TriaSearchx(&tria,index,nel,x,y,nods,x0,y0,numberof grids);44 TriaSearchx(&tria,index,nel,x,y,nods,x0,y0,numberofnodes); 45 45 46 46 /* c to matlab: */ 47 for(i=0;i<numberof grids;i++)tria[i]++;47 for(i=0;i<numberofnodes;i++)tria[i]++; 48 48 49 49 /*Write data: */ 50 WriteData(TRIA,tria,numberof grids);50 WriteData(TRIA,tria,numberofnodes); 51 51 52 52 /*end module: */
Note:
See TracChangeset
for help on using the changeset viewer.