Changeset 23570
- Timestamp:
- 12/27/18 19:15:09 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/IoModel.cpp
r23568 r23570 136 136 this->my_elements=NULL; 137 137 this->my_faces=NULL; 138 this->my_vfaces=NULL; 138 139 this->my_edges=NULL; 139 140 this->my_vedges=NULL; … … 148 149 this->numberofelements=-1; 149 150 this->numberoffaces=-1; 151 this->numberofverticalfaces=-1; 150 152 this->numberofedges=-1; 151 153 this->numberofverticaledges=-1; … … 154 156 this->elements=NULL; 155 157 this->faces=NULL; 158 this->verticalfaces=NULL; 156 159 this->edges=NULL; 157 160 this->verticaledges=NULL; 158 161 this->horizontaledges=NULL; 159 162 this->elementtofaceconnectivity = NULL; 163 this->elementtoverticalfaceconnectivity = NULL; 160 164 this->elementtoedgeconnectivity = NULL; 161 165 this->elementtoverticaledgeconnectivity = NULL; … … 203 207 /*Initialize permanent data: */ 204 208 this->my_elements = NULL; 205 this->my_faces = NULL; 206 this->my_edges = NULL; 207 this->my_vedges = NULL; 208 this->my_hedges = NULL; 209 this->my_faces = NULL; 210 this->my_vfaces = NULL; 211 this->my_edges = NULL; 212 this->my_vedges = NULL; 213 this->my_hedges = NULL; 209 214 this->my_vertices = NULL; 210 this->epart = NULL;215 this->epart = NULL; 211 216 212 217 FindConstant(&this->domaintype,"md.mesh.domain_type"); … … 219 224 this->facescols = -1; 220 225 this->faces = NULL; 226 this->verticalfaces = NULL; 221 227 this->edges = NULL; 222 228 this->verticaledges = NULL; 223 229 this->horizontaledges = NULL; 224 230 this->elementtofaceconnectivity = NULL; 231 this->elementtoverticalfaceconnectivity = NULL; 225 232 this->elementtoedgeconnectivity = NULL; 226 233 this->elementtoverticaledgeconnectivity = NULL; … … 252 259 xDelete<bool>(this->my_elements); 253 260 xDelete<bool>(this->my_faces); 261 xDelete<bool>(this->my_vfaces); 254 262 xDelete<bool>(this->my_edges); 255 263 xDelete<bool>(this->my_vedges); … … 260 268 xDelete<int>(this->elements); 261 269 xDelete<int>(this->faces); 270 xDelete<int>(this->verticalfaces); 262 271 xDelete<int>(this->edges); 263 272 xDelete<int>(this->verticaledges); 264 273 xDelete<int>(this->horizontaledges); 265 274 xDelete<int>(this->elementtofaceconnectivity); 275 xDelete<int>(this->elementtoverticalfaceconnectivity); 266 276 xDelete<int>(this->elementtoedgeconnectivity); 267 277 xDelete<int>(this->elementtoverticaledgeconnectivity); -
issm/trunk-jpl/src/c/classes/IoModel.h
r23568 r23570 65 65 bool *my_elements; 66 66 bool *my_faces; 67 bool *my_vfaces; 67 68 bool *my_edges; 68 69 bool *my_vedges; … … 82 83 int *elementtohorizontaledgeconnectivity; 83 84 int *elementtofaceconnectivity; 85 int *elementtoverticalfaceconnectivity; 84 86 int *faces; 87 int *verticalfaces; 85 88 int facescols; 86 89 int meshelementtype; … … 91 94 int numberofelements; 92 95 int numberoffaces; 96 int numberofverticalfaces; 93 97 int numberofvertices; 94 98 int *singlenodetoelementconnectivity; -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateEdges.cpp
r23569 r23570 132 132 } 133 133 } 134 135 /*vertical/horizontal edges*/ 134 136 int nbve = 0; 135 137 int nbhe = 0; 136 /*vertical/horizontal edges*/137 138 if(iomodel->meshelementtype==PentaEnum){ 138 139 for(i=0;i<iomodel->numberofvertices;i++) head_minv[i]=-1; -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateFaces.cpp
r18140 r23570 125 125 126 126 /*Intermediaries*/ 127 bool exist; 128 int i,j,k,v0,cols,facescols; 129 int maxnbf,nbf,elementnbf,elementnbv,facenbv,facemaxnbv; 127 int i,j,k,v0,cols,facemaxnbv; 128 int elementnbf,elementnbv,facenbv; 130 129 int *elementfaces = NULL; 131 130 int *elementfaces_markers = NULL; … … 175 174 176 175 /*Allocate connectivity*/ 177 int *element_face_connectivity = xNew<int>(iomodel->numberofelements*elementnbf); /*format: [face1 face2 ...] */ 176 int *element_face_connectivity = xNew<int>(iomodel->numberofelements*elementnbf); /*format: [face1 face2 ...] */ 177 int *element_vface_connectivity = NULL; 178 if(iomodel->meshelementtype==PentaEnum){ 179 element_vface_connectivity = xNew<int>(iomodel->numberofelements*3); /*format: [face1 face2 face3] */ 180 } 178 181 179 182 /*Maximum number of faces for initial allocation*/ 180 maxnbf = elementnbf*iomodel->numberofelements;181 facescols = 4+facemaxnbv; _assert_(facescols>6);183 int maxnbf = elementnbf*iomodel->numberofelements; 184 int facescols = 4+facemaxnbv; _assert_(facescols>6); 182 185 183 186 /*Initialize intermediaries*/ 184 int* facestemp = xNew<int>(maxnbf*facescols); /*format: [element1 element2 marker nbv vertex1 vertex2 vertex3 ...] */ 187 int* facestemp = xNew<int>(maxnbf*facescols); /*format: [element1 element2 marker nbv vertex1 vertex2 vertex3 ...] */ 188 int* vfacestemp = xNew<int>(maxnbf*4); 185 189 for(i=0;i<maxnbf;i++) facestemp[i*facescols+1]=-1; /*Initialize second column of faces as -1 (boundary face) */ 186 190 … … 191 195 192 196 /*Initialize number of faces and list of vertex indices*/ 193 nbf = 0;197 int nbf = 0; 194 198 int* v = xNew<int>(facemaxnbv); 195 196 199 for(i=0;i<iomodel->numberofelements;i++){ 197 200 for(j=0;j<elementnbf;j++){ … … 208 211 209 212 /*This face a priori has not been processed yet*/ 210 exist = false;213 bool exist = false; 211 214 212 215 /*Go through all processed faces connected to v0 and check whether we have seen this face yet*/ … … 243 246 } 244 247 248 /*Vertical faces*/ 249 int nbvf = 0; 250 if(iomodel->meshelementtype==PentaEnum){ 251 for(i=0;i<iomodel->numberofvertices;i++) head_minv[i]=-1; 252 for(i=0;i<iomodel->numberofelements;i++){ 253 for(j=2;j<5;j++){ 254 for(k=0;k<4;k++) v[k] = iomodel->elements[i*elementnbv + elementfaces[cols*j+k+1]] - 1; 255 HeapSort(v,4); 256 v0 = v[0]; _assert_(v0>=0 && v0<iomodel->numberofvertices); 257 bool exist = false; 258 for(int f=head_minv[v0]; f!=-1; f=next_face[f]){ 259 if(vfacestemp[f*4+1]==v[1]+1 && vfacestemp[f*4+2]==v[2]+1){ 260 exist = true; 261 element_vface_connectivity[i*3+(j-2)]=f; 262 break; 263 } 264 } 265 if(!exist){ _assert_(nbvf<maxnbf); 266 for(k=0;k<4;k++) vfacestemp[nbvf*4+k] = v[k]+1; 267 element_vface_connectivity[i*3+(j-2)]=nbvf; 268 next_face[nbvf] = head_minv[v0]; 269 head_minv[v0] = nbvf; 270 nbvf++; 271 } 272 } 273 } 274 } 275 245 276 /*Clean up*/ 246 277 xDelete<int>(head_minv); … … 254 285 xMemCpy<int>(faces,facestemp,nbf*facescols); 255 286 xDelete<int>(facestemp); 287 int* vfaces = xNew<int>(nbvf*4); 288 xMemCpy<int>(vfaces,vfacestemp,nbvf*4); 289 xDelete<int>(vfacestemp); 256 290 257 291 /*Assign output pointers*/ 258 iomodel->faces = faces; 259 iomodel->numberoffaces = nbf; 260 iomodel->facescols = facescols; 261 iomodel->elementtofaceconnectivity = element_face_connectivity; 292 iomodel->faces = faces; 293 iomodel->verticalfaces = vfaces; 294 iomodel->numberoffaces = nbf; 295 iomodel->numberofverticalfaces = nbvf; 296 iomodel->facescols = facescols; 297 iomodel->elementtofaceconnectivity = element_face_connectivity; 298 iomodel->elementtoverticalfaceconnectivity = element_vface_connectivity; 262 299 }/*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.