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

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

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

revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC
# Line 17  Line 17 
17    
18  /*  reads a mesh from a Finley file of name fname */  /*  reads a mesh from a Finley file of name fname */
19    
20  Finley_Mesh* Finley_Mesh_read(char* fname,int order) {  Finley_Mesh* Finley_Mesh_read(char* fname,index_t order) {
21    
22    int numNodes, numDim, numEle;    dim_t numNodes, numDim, numEle, i0, i1;
   int i0, i1;  
23    char name[LenString_MAX],element_type[LenString_MAX];    char name[LenString_MAX],element_type[LenString_MAX];
24    Finley_NodeFile *nodes_p=NULL;    Finley_NodeFile *nodes_p=NULL;
25    double time0=Finley_timer();    double time0=Finley_timer();
# Line 83  Finley_Mesh* Finley_Mesh_read(char* fnam Line 82  Finley_Mesh* Finley_Mesh_read(char* fnam
82    /* read the elements */    /* read the elements */
83    mesh_p->Elements=Finley_ElementFile_alloc(typeID,mesh_p->order);    mesh_p->Elements=Finley_ElementFile_alloc(typeID,mesh_p->order);
84    Finley_ElementFile_allocTable(mesh_p->Elements, numEle);    Finley_ElementFile_allocTable(mesh_p->Elements, numEle);
85    mesh_p->Elements->numColors=numEle+1;    mesh_p->Elements->minColor=0;
86      mesh_p->Elements->maxColor=numEle-1;
87    for (i0 = 0; i0 < numEle; i0++) {    for (i0 = 0; i0 < numEle; i0++) {
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;
# Line 104  Finley_Mesh* Finley_Mesh_read(char* fnam Line 104  Finley_Mesh* Finley_Mesh_read(char* fnam
104    }    }
105    mesh_p->FaceElements=Finley_ElementFile_alloc(faceTypeID,mesh_p->order);    mesh_p->FaceElements=Finley_ElementFile_alloc(faceTypeID,mesh_p->order);
106    Finley_ElementFile_allocTable(mesh_p->FaceElements, numEle);    Finley_ElementFile_allocTable(mesh_p->FaceElements, numEle);
107    mesh_p->FaceElements->numColors=numEle+1;    mesh_p->FaceElements->minColor=0;
108      mesh_p->FaceElements->maxColor=numEle-1;
109    for (i0 = 0; i0 < numEle; i0++) {    for (i0 = 0; i0 < numEle; i0++) {
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;
# Line 125  Finley_Mesh* Finley_Mesh_read(char* fnam Line 126  Finley_Mesh* Finley_Mesh_read(char* fnam
126    }    }
127    mesh_p->ContactElements=Finley_ElementFile_alloc(contactTypeID,mesh_p->order);    mesh_p->ContactElements=Finley_ElementFile_alloc(contactTypeID,mesh_p->order);
128    Finley_ElementFile_allocTable(mesh_p->ContactElements, numEle);    Finley_ElementFile_allocTable(mesh_p->ContactElements, numEle);
129    mesh_p->ContactElements->numColors=numEle+1;    mesh_p->ContactElements->minColor=0;
130      mesh_p->ContactElements->maxColor=numEle-1;
131    for (i0 = 0; i0 < numEle; i0++) {    for (i0 = 0; i0 < numEle; i0++) {
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;
# Line 147  Finley_Mesh* Finley_Mesh_read(char* fnam Line 149  Finley_Mesh* Finley_Mesh_read(char* fnam
149    mesh_p->Points=Finley_ElementFile_alloc(pointTypeID,mesh_p->order);    mesh_p->Points=Finley_ElementFile_alloc(pointTypeID,mesh_p->order);
150    
151    Finley_ElementFile_allocTable(mesh_p->Points, numEle);    Finley_ElementFile_allocTable(mesh_p->Points, numEle);
152    mesh_p->Points->numColors=numEle+1;    mesh_p->Points->minColor=0;
153      mesh_p->Points->maxColor=numEle-1;
154    for (i0 = 0; i0 < numEle; i0++) {    for (i0 = 0; i0 < numEle; i0++) {
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;
# Line 178  Finley_Mesh* Finley_Mesh_read(char* fnam Line 181  Finley_Mesh* Finley_Mesh_read(char* fnam
181  }  }
182  /*  /*
183  * $Log$  * $Log$
184  * Revision 1.1  2004/10/26 06:53:57  jgs  * Revision 1.2  2005/07/08 04:07:54  jgs
185  * Initial revision  * Merge of development branch back to main trunk on 2005-07-08
186    *
187    * Revision 1.1.1.1.2.1  2005/06/29 02:34:53  gross
188    * some changes towards 64 integers in finley
189    *
190    * Revision 1.1.1.1  2004/10/26 06:53:57  jgs
191    * initial import of project esys2
192  *  *
193  * Revision 1.1.1.1  2004/06/24 04:00:40  johng  * Revision 1.1.1.1  2004/06/24 04:00:40  johng
194  * Initial version of eys using boost-python.  * Initial version of eys using boost-python.

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

  ViewVC Help
Powered by ViewVC 1.1.26