Changeset 8330 for issm/trunk/src/c/io
- Timestamp:
- 05/17/11 16:05:50 (14 years ago)
- Location:
- issm/trunk/src/c/io
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/io/FetchData.cpp
r7860 r8330 571 571 #endif 572 572 573 #if defined(_ PARALLEL_) && defined(_HAVE_PETSC_)573 #if defined(_HAVE_PETSC_) 574 574 /*FUNCTION FetchData(double** pmatrix, int* pM,int* pN,FILE* fid){{{1*/ 575 575 void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid){ -
issm/trunk/src/c/io/IoModelFetchData.cpp
r6412 r8330 11 11 #include "./io.h" 12 12 13 #ifdef _SERIAL_ 14 /***************** **************** **************** **************** **************** **************** **************** **************** **************** **************** 15 Serial IoModelFetch Data Routines, all overloaded. 16 **************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/ 17 /*FUNCTION IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){{{1*/ 18 void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){ 19 20 FetchData(pdataset,mxGetAssignedField(model_handle,0,data_name)); 13 /*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int* pN,FILE* model_handle,char* data_name){{{1*/ 14 void IoModelFetchData(double** pmatrix,int* pM,int* pN,FILE* model_handle,char* data_name){ 15 16 FILE* fid=NULL; 17 18 /*Set file pointer to beginning of the data: */ 19 fid=SetFilePointerToData(model_handle,data_name); 20 21 /*Now fetch: */ 22 FetchData(pmatrix,pM,pN,fid); 21 23 22 24 } 23 25 /*}}}*/ 24 /*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){{{1*/ 25 void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){ 26 /*FUNCTION IoModelFetchData(char** pstring,FILE* model_handle,char* data_name){{{1*/ 27 void IoModelFetchData(char** pstring,FILE* model_handle,char* data_name){ 28 29 FILE* fid=NULL; 26 30 27 FetchData(pmatrix,pM,pN,mxGetAssignedField(model_handle,0,data_name)); 28 31 /*Set file pointer to beginning of the data: */ 32 fid=SetFilePointerToData(model_handle,data_name); 33 34 /*Now fetch: */ 35 FetchData(pstring,fid); 29 36 } 30 37 /*}}}*/ 31 /*FUNCTION IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){{{1*/ 32 void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){ 38 /*FUNCTION IoModelFetchData(double* pscalar,FILE* model_handle,char* data_name){{{1*/ 39 void IoModelFetchData(double* pscalar,FILE* model_handle,char* data_name){ 40 41 FILE* fid=NULL; 33 42 34 FetchData(pmatrix,mxGetAssignedField(model_handle,0,data_name)); 35 43 /*Set file pointer to beginning of the data: */ 44 fid=SetFilePointerToData(model_handle,data_name); 45 46 /*Now fetch: */ 47 FetchData(pscalar,fid); 36 48 } 37 49 /*}}}*/ 38 /*FUNCTION IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){{{1*/ 39 void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){ 50 /*FUNCTION IoModelFetchData(int* pinteger,FILE* model_handle,char* data_name){{{1*/ 51 void IoModelFetchData(int* pinteger,FILE* model_handle,char* data_name){ 52 53 FILE* fid=NULL; 40 54 41 FetchData(pvector,pM,mxGetAssignedField(model_handle,0,data_name)); 42 55 /*Set file pointer to beginning of the data: */ 56 fid=SetFilePointerToData(model_handle,data_name); 57 58 /*Now fetch: */ 59 FetchData(pinteger,fid); 43 60 } 44 61 /*}}}*/ 45 /*FUNCTION IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){{{1*/ 46 void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){ 47 48 FetchData(pvector,mxGetAssignedField(model_handle,0,data_name)); 49 50 } 51 /*}}}*/ 52 /*FUNCTION IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){{{1*/ 53 void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){ 54 55 FetchData(pstring,mxGetAssignedField(model_handle,0,data_name)); 56 57 } 58 /*}}}*/ 59 /*FUNCTION IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){{{1*/ 60 void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){ 61 62 FetchData(pscalar,mxGetAssignedField(model_handle,0,data_name)); 63 64 } 65 /*}}}*/ 66 /*FUNCTION IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){{{1*/ 67 void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){ 68 69 FetchData(pinteger,mxGetAssignedField(model_handle,0,data_name)); 70 } 71 /*}}}*/ 72 #endif 73 74 #ifdef _PARALLEL_ 75 /***************** **************** **************** **************** **************** **************** **************** **************** **************** **************** 76 Parallel IoModelFetch Data Routines, all overloaded. 77 **************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/ 78 /*FUNCTION SetFilePointerToData(ConstDataHandle model_handle,char* data_name){{{1*/ 79 FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name){ 62 /*FUNCTION SetFilePointerToData(FILE* model_handle,char* data_name){{{1*/ 63 FILE* SetFilePointerToData(FILE* model_handle,char* data_name){ 80 64 81 65 extern int my_rank; … … 140 124 } 141 125 /*}}}*/ 142 /*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name){{{1*/ 143 void IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name){ 126 127 #ifdef _SERIAL_ 128 /***************** **************** **************** **************** **************** **************** **************** **************** **************** **************** 129 Serial IoModelFetch Data Routines, all overloaded. 130 **************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/ 131 /*FUNCTION IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){{{1*/ 132 void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){ 133 134 FetchData(pdataset,mxGetAssignedField(model_handle,0,data_name)); 135 136 } 137 /*}}}*/ 138 /*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){{{1*/ 139 void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){ 144 140 145 FILE* fid=NULL; 141 FetchData(pmatrix,pM,pN,mxGetAssignedField(model_handle,0,data_name)); 142 143 } 144 /*}}}*/ 145 /*FUNCTION IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){{{1*/ 146 void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){ 146 147 147 /*Set file pointer to beginning of the data: */ 148 fid=SetFilePointerToData(model_handle,data_name); 148 FetchData(pmatrix,mxGetAssignedField(model_handle,0,data_name)); 149 150 } 151 /*}}}*/ 152 /*FUNCTION IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){{{1*/ 153 void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){ 149 154 150 /*Now fetch: */ 151 FetchData(pmatrix,pM,pN,fid); 155 FetchData(pvector,pM,mxGetAssignedField(model_handle,0,data_name)); 156 157 } 158 /*}}}*/ 159 /*FUNCTION IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){{{1*/ 160 void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){ 161 162 FetchData(pvector,mxGetAssignedField(model_handle,0,data_name)); 152 163 153 164 } 154 165 /*}}}*/ 155 166 /*FUNCTION IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){{{1*/ 156 void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){ 167 void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){ 168 169 FetchData(pstring,mxGetAssignedField(model_handle,0,data_name)); 157 170 158 FILE* fid=NULL;159 160 /*Set file pointer to beginning of the data: */161 fid=SetFilePointerToData(model_handle,data_name);162 163 /*Now fetch: */164 FetchData(pstring,fid);165 171 } 166 172 /*}}}*/ 167 173 /*FUNCTION IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){{{1*/ 168 void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){ 174 void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){ 175 176 FetchData(pscalar,mxGetAssignedField(model_handle,0,data_name)); 169 177 170 FILE* fid=NULL;171 172 /*Set file pointer to beginning of the data: */173 fid=SetFilePointerToData(model_handle,data_name);174 175 /*Now fetch: */176 FetchData(pscalar,fid);177 178 } 178 179 /*}}}*/ 179 180 /*FUNCTION IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){{{1*/ 180 void 181 void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){ 181 182 182 FILE* fid=NULL; 183 184 /*Set file pointer to beginning of the data: */ 185 fid=SetFilePointerToData(model_handle,data_name); 186 187 /*Now fetch: */ 188 FetchData(pinteger,fid); 183 FetchData(pinteger,mxGetAssignedField(model_handle,0,data_name)); 189 184 } 190 185 /*}}}*/ -
issm/trunk/src/c/io/io.h
r7860 r8330 15 15 FILE* pfopen(char* filename,char* format); 16 16 void pfclose(FILE* fid,char* filename); 17 18 19 void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid); 20 void FetchData(char** pstring,FILE* fid); 21 void FetchData(double* pscalar,FILE* fid); 22 void FetchData(int* pinteger,FILE* fid); 23 void IoModelFetchData(double** pmatrix,int* pM,int* pN,FILE* model_handle,char* data_name); 24 void IoModelFetchData(char** pstring,FILE* model_handle,char* data_name); 25 void IoModelFetchData(double* pscalar,FILE* model_handle,char* data_name); 26 void IoModelFetchData(int* pinteger,FILE* model_handle,char* data_name); 27 FILE* SetFilePointerToData(FILE* model_handle,char* data_name); 28 17 29 18 30 #ifdef _SERIAL_ … … 75 87 76 88 #ifdef _PARALLEL_ 77 void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid);78 void FetchData(char** pstring,FILE* fid);79 void FetchData(double* pscalar,FILE* fid);80 void FetchData(int* pinteger,FILE* fid);81 89 82 83 FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name);84 void IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name);85 void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name);86 void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name);87 void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name);88 90 89 91 void WriteData(int* pdummy,void* data,char* data_type); 90 92 void WriteDataToDisk(void* data,int* pM,int* pN,char* datatype,FILE* fid); 91 93 92 /*petsc options: */93 void ParsePetscOptions(Parameters* parameters, char* filename);94 94 95 95 #endif
Note:
See TracChangeset
for help on using the changeset viewer.