/[escript]/trunk/finley/src/finleyC/Mesh_read.c
ViewVC logotype

Diff of /trunk/finley/src/finleyC/Mesh_read.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC revision 126 by jgs, Fri Jul 22 03:53:08 2005 UTC
# Line 88  Finley_Mesh* Finley_Mesh_read(char* fnam Line 88  Finley_Mesh* Finley_Mesh_read(char* fnam
88      fscanf(fileHandle_p, "%d %d", &mesh_p->Elements->Id[i0], &mesh_p->Elements->Tag[i0]);      fscanf(fileHandle_p, "%d %d", &mesh_p->Elements->Id[i0], &mesh_p->Elements->Tag[i0]);
89      mesh_p->Elements->Color[i0]=i0;      mesh_p->Elements->Color[i0]=i0;
90      for (i1 = 0; i1 < mesh_p->Elements->ReferenceElement->Type->numNodes; i1++) {      for (i1 = 0; i1 < mesh_p->Elements->ReferenceElement->Type->numNodes; i1++) {
91           fscanf(fileHandle_p, " %d",           fscanf(fileHandle_p, " %d",
92              &mesh_p->Elements->Nodes[INDEX2(i1, i0, mesh_p->Elements->ReferenceElement->Type->numNodes)]);              &mesh_p->Elements->Nodes[INDEX2(i1, i0, mesh_p->Elements->ReferenceElement->Type->numNodes)]);
93      }   /* for i1 */      }   /* for i1 */
94      fscanf(fileHandle_p, "\n");      fscanf(fileHandle_p, "\n");
# Line 110  Finley_Mesh* Finley_Mesh_read(char* fnam Line 110  Finley_Mesh* Finley_Mesh_read(char* fnam
110      fscanf(fileHandle_p, "%d %d", &mesh_p->FaceElements->Id[i0], &mesh_p->FaceElements->Tag[i0]);      fscanf(fileHandle_p, "%d %d", &mesh_p->FaceElements->Id[i0], &mesh_p->FaceElements->Tag[i0]);
111      mesh_p->FaceElements->Color[i0]=i0;      mesh_p->FaceElements->Color[i0]=i0;
112      for (i1 = 0; i1 < mesh_p->FaceElements->ReferenceElement->Type->numNodes; i1++) {      for (i1 = 0; i1 < mesh_p->FaceElements->ReferenceElement->Type->numNodes; i1++) {
113           fscanf(fileHandle_p, " %d",           fscanf(fileHandle_p, " %d",
114              &mesh_p->FaceElements->Nodes[INDEX2(i1, i0, mesh_p->FaceElements->ReferenceElement->Type->numNodes)]);              &mesh_p->FaceElements->Nodes[INDEX2(i1, i0, mesh_p->FaceElements->ReferenceElement->Type->numNodes)]);
115      }   /* for i1 */      }   /* for i1 */
116      fscanf(fileHandle_p, "\n");      fscanf(fileHandle_p, "\n");
# Line 132  Finley_Mesh* Finley_Mesh_read(char* fnam Line 132  Finley_Mesh* Finley_Mesh_read(char* fnam
132      fscanf(fileHandle_p, "%d %d", &mesh_p->ContactElements->Id[i0], &mesh_p->ContactElements->Tag[i0]);      fscanf(fileHandle_p, "%d %d", &mesh_p->ContactElements->Id[i0], &mesh_p->ContactElements->Tag[i0]);
133      mesh_p->ContactElements->Color[i0]=i0;      mesh_p->ContactElements->Color[i0]=i0;
134      for (i1 = 0; i1 < mesh_p->ContactElements->ReferenceElement->Type->numNodes; i1++) {      for (i1 = 0; i1 < mesh_p->ContactElements->ReferenceElement->Type->numNodes; i1++) {
135          fscanf(fileHandle_p, " %d",          fscanf(fileHandle_p, " %d",
136             &mesh_p->ContactElements->Nodes[INDEX2(i1, i0, mesh_p->ContactElements->ReferenceElement->Type->numNodes)]);             &mesh_p->ContactElements->Nodes[INDEX2(i1, i0, mesh_p->ContactElements->ReferenceElement->Type->numNodes)]);
137      }   /* for i1 */      }   /* for i1 */
138      fscanf(fileHandle_p, "\n");      fscanf(fileHandle_p, "\n");
# Line 155  Finley_Mesh* Finley_Mesh_read(char* fnam Line 155  Finley_Mesh* Finley_Mesh_read(char* fnam
155      fscanf(fileHandle_p, "%d %d", &mesh_p->Points->Id[i0], &mesh_p->Points->Tag[i0]);      fscanf(fileHandle_p, "%d %d", &mesh_p->Points->Id[i0], &mesh_p->Points->Tag[i0]);
156      mesh_p->Points->Color[i0]=i0;      mesh_p->Points->Color[i0]=i0;
157      for (i1 = 0; i1 < mesh_p->Points->ReferenceElement->Type->numNodes; i1++) {      for (i1 = 0; i1 < mesh_p->Points->ReferenceElement->Type->numNodes; i1++) {
158          fscanf(fileHandle_p, " %d",          fscanf(fileHandle_p, " %d",
159             &mesh_p->Points->Nodes[INDEX2(i1, i0, mesh_p->Points->ReferenceElement->Type->numNodes)]);             &mesh_p->Points->Nodes[INDEX2(i1, i0, mesh_p->Points->ReferenceElement->Type->numNodes)]);
160      }   /* for i1 */      }   /* for i1 */
161      fscanf(fileHandle_p, "\n");      fscanf(fileHandle_p, "\n");
# Line 167  Finley_Mesh* Finley_Mesh_read(char* fnam Line 167  Finley_Mesh* Finley_Mesh_read(char* fnam
167    fclose(fileHandle_p);    fclose(fileHandle_p);
168    
169    /*   resolve id's : */    /*   resolve id's : */
170                                                                                                                                      
171    Finley_Mesh_resolveNodeIds(mesh_p);    Finley_Mesh_resolveNodeIds(mesh_p);
172                                                                                                                                        
173    /* rearrange elements: */    /* rearrange elements: */
174      
175    Finley_Mesh_prepare(mesh_p);    Finley_Mesh_prepare(mesh_p);
176                                                                                                                                          printf ("nodes read!\n");
177    
178    /* that's it */    /* that's it */
179    printf("timing: reading mesh: %.4e sec\n",Finley_timer()-time0);    printf("timing: reading mesh: %.4e sec\n",Finley_timer()-time0);
180    if (Finley_ErrorCode!=NO_ERROR) Finley_Mesh_dealloc(mesh_p);    if (Finley_ErrorCode!=NO_ERROR) Finley_Mesh_dealloc(mesh_p);
# Line 181  Finley_Mesh* Finley_Mesh_read(char* fnam Line 182  Finley_Mesh* Finley_Mesh_read(char* fnam
182  }  }
183  /*  /*
184  * $Log$  * $Log$
185    * Revision 1.3  2005/07/22 03:53:08  jgs
186    * Merge of development branch back to main trunk on 2005-07-22
187    *
188  * Revision 1.2  2005/07/08 04:07:54  jgs  * Revision 1.2  2005/07/08 04:07:54  jgs
189  * Merge of development branch back to main trunk on 2005-07-08  * Merge of development branch back to main trunk on 2005-07-08
190  *  *
191    * Revision 1.1.1.1.2.2  2005/07/18 10:34:54  gross
192    * some informance improvements when reading meshes
193    *
194  * Revision 1.1.1.1.2.1  2005/06/29 02:34:53  gross  * Revision 1.1.1.1.2.1  2005/06/29 02:34:53  gross
195  * some changes towards 64 integers in finley  * some changes towards 64 integers in finley
196  *  *

Legend:
Removed from v.123  
changed lines
  Added in v.126

  ViewVC Help
Powered by ViewVC 1.1.26