Changeset 3549
- Timestamp:
- 04/16/10 08:21:11 (15 years ago)
- Location:
- issm/trunk/src/c/ModelProcessorx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/Partitioning.cpp
r3446 r3549 213 213 /*Get edges and elements*/ 214 214 IoModelFetchData(&iomodel->edges,&iomodel->numberofedges,NULL,iomodel_handle,"edges"); 215 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 215 216 216 217 /*!All elements have been partitioned above, only create elements for this CPU: */ … … 233 234 234 235 /*2: Get the column where these ids are located in the index*/ 235 pos= =UNDEF;236 pos=UNDEF; 236 237 for(j=0;j<3;j++){ 237 if (iomodel->elements[3*(int)e2+j]==i1) pos=j+1; 238 } 239 ISSMASSERT(pos!=UNDEF); 238 if ((int)iomodel->elements[3*(int)e2+j]==i1) pos=j; 239 } 240 240 241 241 /*3: We have the id of the elements and the position of the vertices in the index 242 242 * we can now create the corresponding nodes:*/ 243 my_nodes[(int)e2*3+pos-1]=1; 244 my_nodes[(int)e2*3+((pos+1)%3)]=1; 243 if (pos==0){ 244 my_nodes[(int)e2*3+0]=1; 245 my_nodes[(int)e2*3+2]=1; 246 } 247 else if(pos==1){ 248 my_nodes[(int)e2*3+1]=1; 249 my_nodes[(int)e2*3+0]=1; 250 } 251 else if (pos==2){ 252 my_nodes[(int)e2*3+2]=1; 253 my_nodes[(int)e2*3+1]=1; 254 } 255 else{ 256 ISSMERROR("Problem in edges creation"); 257 } 245 258 } 246 259 } 247 260 248 261 /*Free data: */ 262 xfree((void**)&iomodel->elements); 249 263 xfree((void**)&iomodel->edges); 250 264 -
issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateLoadsPrognostic2.cpp
r3548 r3549 47 47 /*Create load*/ 48 48 numericalflux_id=i+1; //Matlab indexing 49 numericalflux_elem_id=(int)e1+1;//id is in matlab index 50 51 /*1: Get vertices ids*/ 52 i1=(int)iomodel->edges[4*i+0]; 53 i2=(int)iomodel->edges[4*i+1]; 49 54 50 55 if (!isnan(e2)){ 51 56 strcpy(numericalflux_type,"internal"); 52 57 53 numericalflux_elem_id=(int)e1+1;//id is in matlab index54 55 58 /*Now, we must get the nodes of the 4 nodes located on the edge*/ 56 57 /*1: Get vertices ids*/58 i1=(int)iomodel->edges[4*i+0];59 i2=(int)iomodel->edges[4*i+1];60 59 61 60 /*2: Get the column where these ids are located in the index*/ … … 76 75 else{ 77 76 strcpy(numericalflux_type,"boundary"); 78 79 numericalflux_elem_id=(int)e1+1;80 81 /*1: Get vertices ids*/82 i1=(int)iomodel->edges[4*i+0];83 i2=(int)iomodel->edges[4*i+1];84 77 85 78 /*2: Get the column where these ids are located in the index*/
Note:
See TracChangeset
for help on using the changeset viewer.