/[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 964 by gross, Tue Feb 13 05:10:26 2007 UTC revision 1028 by gross, Wed Mar 14 00:15:24 2007 UTC
# Line 34  Finley_Mesh* Finley_Mesh_read(char* fnam Line 34  Finley_Mesh* Finley_Mesh_read(char* fnam
34    char name[LenString_MAX],element_type[LenString_MAX],frm[20];    char name[LenString_MAX],element_type[LenString_MAX],frm[20];
35    char error_msg[LenErrorMsg_MAX];    char error_msg[LenErrorMsg_MAX];
36    double time0=Finley_timer();    double time0=Finley_timer();
37      FILE *fileHandle_p = NULL;
38      ElementTypeId typeID, faceTypeID, contactTypeID, pointTypeID;
39    
40    Finley_resetError();    Finley_resetError();
41    
42    /* get file handle */    /* get file handle */
43    FILE * fileHandle_p = fopen(fname, "r");    fileHandle_p = fopen(fname, "r");
44    if (fileHandle_p==NULL) {    if (fileHandle_p==NULL) {
45      sprintf(error_msg,"%s: Opening file %s for reading failed.",__FILE__,fname);      sprintf(error_msg,"Finley_Mesh_read: Opening file %s for reading failed.",fname);
46      Finley_setError(IO_ERROR,error_msg);      Finley_setError(IO_ERROR,error_msg);
47      return NULL;      return NULL;
48    }    }
# Line 90  Finley_Mesh* Finley_Mesh_read(char* fnam Line 92  Finley_Mesh* Finley_Mesh_read(char* fnam
92    /* get the element type */    /* get the element type */
93    
94    fscanf(fileHandle_p, "%s %d\n", element_type, &numEle);    fscanf(fileHandle_p, "%s %d\n", element_type, &numEle);
95    ElementTypeId typeID=Finley_RefElement_getTypeId(element_type);    typeID=Finley_RefElement_getTypeId(element_type);
96    if (typeID==NoType) {    if (typeID==NoType) {
97      sprintf(error_msg,"%s :Unidentified element type %s",__FILE__,element_type);      sprintf(error_msg,"Finley_Mesh_read :Unidentified element type %s",element_type);
98      Finley_setError(VALUE_ERROR,error_msg);      Finley_setError(VALUE_ERROR,error_msg);
99      return NULL;      return NULL;
100    }    }
# Line 117  Finley_Mesh* Finley_Mesh_read(char* fnam Line 119  Finley_Mesh* Finley_Mesh_read(char* fnam
119    
120    /* get the face elements */    /* get the face elements */
121    fscanf(fileHandle_p, "%s %d\n", element_type, &numEle);    fscanf(fileHandle_p, "%s %d\n", element_type, &numEle);
122    ElementTypeId faceTypeID=Finley_RefElement_getTypeId(element_type);    faceTypeID=Finley_RefElement_getTypeId(element_type);
123      faceTypeID=Finley_RefElement_getTypeId(element_type);
124    if (faceTypeID==NoType) {    if (faceTypeID==NoType) {
125      sprintf(error_msg,"%s :Unidentified element type %s for face elements",__FILE__,element_type);      sprintf(error_msg,"Finley_Mesh_read :Unidentified element type %s for face elements",element_type);
126      Finley_setError(VALUE_ERROR,error_msg);      Finley_setError(VALUE_ERROR,error_msg);
127      return NULL;      return NULL;
128    }    }
# Line 143  Finley_Mesh* Finley_Mesh_read(char* fnam Line 146  Finley_Mesh* Finley_Mesh_read(char* fnam
146    
147    /* get the Contact face element */    /* get the Contact face element */
148    fscanf(fileHandle_p, "%s %d\n", element_type, &numEle);    fscanf(fileHandle_p, "%s %d\n", element_type, &numEle);
149    ElementTypeId contactTypeID=Finley_RefElement_getTypeId(element_type);    contactTypeID=Finley_RefElement_getTypeId(element_type);
150    if (contactTypeID==NoType) {    if (contactTypeID==NoType) {
151      sprintf(error_msg,"%s: Unidentified element type %s for contact elements",__FILE__,element_type);      sprintf(error_msg,"Finley_Mesh_read: Unidentified element type %s for contact elements",element_type);
152      Finley_setError(VALUE_ERROR,error_msg);      Finley_setError(VALUE_ERROR,error_msg);
153      return NULL;      return NULL;
154    }    }
# Line 169  Finley_Mesh* Finley_Mesh_read(char* fnam Line 172  Finley_Mesh* Finley_Mesh_read(char* fnam
172    
173    /* get the nodal element */    /* get the nodal element */
174    fscanf(fileHandle_p, "%s %d\n", element_type, &numEle);    fscanf(fileHandle_p, "%s %d\n", element_type, &numEle);
175    ElementTypeId pointTypeID=Finley_RefElement_getTypeId(element_type);    pointTypeID=Finley_RefElement_getTypeId(element_type);
176    if (pointTypeID==NoType) {    if (pointTypeID==NoType) {
177      sprintf(error_msg,"%s: Unidentified element type %s for points",__FILE__,element_type);      sprintf(error_msg,"Finley_Mesh_read: Unidentified element type %s for points",element_type);
178      Finley_setError(VALUE_ERROR,error_msg);      Finley_setError(VALUE_ERROR,error_msg);
179      return NULL;      return NULL;
180    }    }

Legend:
Removed from v.964  
changed lines
  Added in v.1028

  ViewVC Help
Powered by ViewVC 1.1.26