/[escript]/branches/RW_WIN32/finley/src/finleyC/Mesh_saveDX.c
ViewVC logotype

Diff of /branches/RW_WIN32/finley/src/finleyC/Mesh_saveDX.c

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

revision 209 by robwdcock, Sun Nov 20 05:43:12 2005 UTC revision 210 by robwdcock, Wed Nov 23 09:54:02 2005 UTC
# Line 53  void Finley_Mesh_saveDX(const char * fil Line 53  void Finley_Mesh_saveDX(const char * fil
53    /* find the mesh type to be written */    /* find the mesh type to be written */
54    int nodetype=FINLEY_DEGREES_OF_FREEDOM;    int nodetype=FINLEY_DEGREES_OF_FREEDOM;
55    int elementtype=FINLEY_UNKNOWN;    int elementtype=FINLEY_UNKNOWN;
56    bool_t isCellCentered[num_data];    /* win32 refactor */
57      bool_t *isCellCentered = (num_data>0) ? TMPMEMALLOC(num_data,bool_t) : (bool_t*)NULL;
58    
59    for (i_data=0;i_data<num_data;++i_data) {    for (i_data=0;i_data<num_data;++i_data) {
60       if (! isEmpty(data_pp[i_data])) {       if (! isEmpty(data_pp[i_data])) {
61          switch(getFunctionSpaceType(data_pp[i_data])) {          switch(getFunctionSpaceType(data_pp[i_data])) {
# Line 63  void Finley_Mesh_saveDX(const char * fil Line 65  void Finley_Mesh_saveDX(const char * fil
65                   elementtype=FINLEY_ELEMENTS;                   elementtype=FINLEY_ELEMENTS;
66               } else {               } else {
67                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");
68                     /* win32 refactor */
69             TMPMEMFREE(isCellCentered);
70    
71                   return;                   return;
72               }               }
73               isCellCentered[i_data]=FALSE;               isCellCentered[i_data]=FALSE;
# Line 73  void Finley_Mesh_saveDX(const char * fil Line 78  void Finley_Mesh_saveDX(const char * fil
78                   elementtype=FINLEY_ELEMENTS;                   elementtype=FINLEY_ELEMENTS;
79               } else {               } else {
80                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");
81                     /* win32 refactor */
82             TMPMEMFREE(isCellCentered);
83                    
84                   return;                   return;
85               }               }
86               isCellCentered[i_data]=FALSE;               isCellCentered[i_data]=FALSE;
# Line 83  void Finley_Mesh_saveDX(const char * fil Line 91  void Finley_Mesh_saveDX(const char * fil
91                   elementtype=FINLEY_ELEMENTS;                   elementtype=FINLEY_ELEMENTS;
92               } else {               } else {
93                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");
94                     /* win32 refactor */
95             TMPMEMFREE(isCellCentered);
96                    
97                   return;                   return;
98               }               }
99               isCellCentered[i_data]=FALSE;               isCellCentered[i_data]=FALSE;
# Line 93  void Finley_Mesh_saveDX(const char * fil Line 104  void Finley_Mesh_saveDX(const char * fil
104                   elementtype=FINLEY_ELEMENTS;                   elementtype=FINLEY_ELEMENTS;
105               } else {               } else {
106                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");
107                     /* win32 refactor */
108             TMPMEMFREE(isCellCentered);
109                   return;                   return;
110               }               }
111               isCellCentered[i_data]=TRUE;               isCellCentered[i_data]=TRUE;
# Line 103  void Finley_Mesh_saveDX(const char * fil Line 116  void Finley_Mesh_saveDX(const char * fil
116                   elementtype=FINLEY_FACE_ELEMENTS;                   elementtype=FINLEY_FACE_ELEMENTS;
117               } else {               } else {
118                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");
119                     /* win32 refactor */
120             TMPMEMFREE(isCellCentered);
121                   return;                   return;
122               }               }
123               isCellCentered[i_data]=TRUE;               isCellCentered[i_data]=TRUE;
# Line 113  void Finley_Mesh_saveDX(const char * fil Line 128  void Finley_Mesh_saveDX(const char * fil
128                   elementtype=FINLEY_POINTS;                   elementtype=FINLEY_POINTS;
129               } else {               } else {
130                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");
131                     /* win32 refactor */
132             TMPMEMFREE(isCellCentered);
133                   return;                   return;
134               }               }
135               isCellCentered[i_data]=TRUE;               isCellCentered[i_data]=TRUE;
# Line 123  void Finley_Mesh_saveDX(const char * fil Line 140  void Finley_Mesh_saveDX(const char * fil
140                   elementtype=FINLEY_CONTACT_ELEMENTS_1;                   elementtype=FINLEY_CONTACT_ELEMENTS_1;
141               } else {               } else {
142                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");
143                     /* win32 refactor */
144             TMPMEMFREE(isCellCentered);
145                   return;                   return;
146               }               }
147               isCellCentered[i_data]=TRUE;               isCellCentered[i_data]=TRUE;
# Line 133  void Finley_Mesh_saveDX(const char * fil Line 152  void Finley_Mesh_saveDX(const char * fil
152                   elementtype=FINLEY_CONTACT_ELEMENTS_1;                   elementtype=FINLEY_CONTACT_ELEMENTS_1;
153               } else {               } else {
154                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");                   Finley_setError(TYPE_ERROR,"saveDX: cannot write given data in single file.");
155                     /* win32 refactor */
156             TMPMEMFREE(isCellCentered);
157                   return;                   return;
158               }               }
159               isCellCentered[i_data]=TRUE;               isCellCentered[i_data]=TRUE;
# Line 140  void Finley_Mesh_saveDX(const char * fil Line 161  void Finley_Mesh_saveDX(const char * fil
161             default:             default:
162               sprintf(error_msg,"saveDX: Finley does not know anything about function space type %d",getFunctionSpaceType(data_pp[i_data]));               sprintf(error_msg,"saveDX: Finley does not know anything about function space type %d",getFunctionSpaceType(data_pp[i_data]));
163               Finley_setError(TYPE_ERROR,error_msg);               Finley_setError(TYPE_ERROR,error_msg);
164                     /* win32 refactor */
165             TMPMEMFREE(isCellCentered);
166               return;               return;
167          }          }
168       }       }
# Line 170  void Finley_Mesh_saveDX(const char * fil Line 193  void Finley_Mesh_saveDX(const char * fil
193    }    }
194    if (elements==NULL) {    if (elements==NULL) {
195       Finley_setError(SYSTEM_ERROR,"saveDX: undefined element file");       Finley_setError(SYSTEM_ERROR,"saveDX: undefined element file");
196         /* win32 refactor */
197         TMPMEMFREE(isCellCentered);
198       return;       return;
199    }    }
200    
# Line 202  void Finley_Mesh_saveDX(const char * fil Line 227  void Finley_Mesh_saveDX(const char * fil
227     } else {     } else {
228       sprintf(error_msg,"saveDX: Element type %s is not supported by DX",elements->ReferenceElement->Type->Name);       sprintf(error_msg,"saveDX: Element type %s is not supported by DX",elements->ReferenceElement->Type->Name);
229       Finley_setError(VALUE_ERROR,error_msg);       Finley_setError(VALUE_ERROR,error_msg);
230         /* win32 refactor */
231         TMPMEMFREE(isCellCentered);
232       return;       return;
233     }     }
234    
# Line 295  void Finley_Mesh_saveDX(const char * fil Line 322  void Finley_Mesh_saveDX(const char * fil
322    fprintf(fileHandle_p, "end\n");    fprintf(fileHandle_p, "end\n");
323    /* close the file */    /* close the file */
324    fclose(fileHandle_p);    fclose(fileHandle_p);
325    return;    /* win32 refactor */
326      TMPMEMFREE(isCellCentered);
327    return;
328  }  }

Legend:
Removed from v.209  
changed lines
  Added in v.210

  ViewVC Help
Powered by ViewVC 1.1.26