[3682] | 1 | /* \file IoModel.h
|
---|
| 2 | * \brief Header file defining the IoModel structure that will help in processing the input data coming
|
---|
| 3 | * into ISSM, from Matlab, or through a binary file opened for reading.
|
---|
| 4 | * \sa IoModel.cpp
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | #ifndef _IOMODEL_H
|
---|
| 8 | #define _IOMODEL_H
|
---|
| 9 |
|
---|
[3775] | 10 | #include "../include/include.h"
|
---|
[9343] | 11 | #include "../EnumDefinitions/EnumDefinitions.h"
|
---|
[3682] | 12 |
|
---|
[9343] | 13 | class Elements;
|
---|
[9476] | 14 | class Param;
|
---|
[9362] | 15 |
|
---|
| 16 |
|
---|
[3682] | 17 | class IoModel {
|
---|
| 18 |
|
---|
[9340] | 19 | private:
|
---|
[12322] | 20 | IssmDouble **data; //this dataset holds temporary data, memory intensive.
|
---|
| 21 | Parameters *constants; //this dataset holds all IssmDouble, int, bool and char *parameters read in from the input file.*
|
---|
[9356] | 22 |
|
---|
[3682] | 23 | public:
|
---|
[9362] | 24 | /*This data needs to stay memory resident at all time, even if it's memory intensive: */
|
---|
[12377] | 25 | FILE *fid; //pointer to input file
|
---|
[9370] | 26 | bool *my_elements;
|
---|
| 27 | bool *my_nodes;
|
---|
| 28 | int *my_vertices;
|
---|
| 29 | int *singlenodetoelementconnectivity;
|
---|
| 30 | int *numbernodetoelementconnectivity;
|
---|
[9291] | 31 |
|
---|
[9362] | 32 | /*Data to synchronize through low level object drivers: */
|
---|
[9370] | 33 | int nodecounter; //keep track of how many nodes are being created in each analysis type
|
---|
| 34 | int loadcounter; //keep track of how many loads are being created in each analysis type
|
---|
| 35 | int constraintcounter; //keep track of how many constraints are being created in each analysis type
|
---|
[9362] | 36 |
|
---|
[9405] | 37 | /*Methods*/
|
---|
[3682] | 38 | ~IoModel();
|
---|
| 39 | IoModel();
|
---|
[8330] | 40 | IoModel(FILE* iomodel_handle);
|
---|
[3682] | 41 |
|
---|
[9405] | 42 | /*Input/Output*/
|
---|
[12265] | 43 | void CheckEnumSync(void);
|
---|
| 44 | void Constant(bool *poutput,int constant_enum);
|
---|
| 45 | void Constant(int *poutput,int constant_enum);
|
---|
[12322] | 46 | void Constant(IssmDouble *poutput,int constant_enum);
|
---|
[12265] | 47 | void Constant(char **poutput,int constant_enum);
|
---|
| 48 | Param *CopyConstantObject(int constant_enum);
|
---|
[12322] | 49 | IssmDouble *Data(int dataenum);
|
---|
[12265] | 50 | void DeleteData(int num,...);
|
---|
| 51 | void FetchConstants(void);
|
---|
| 52 | void FetchData(bool* pboolean,int data_enum);
|
---|
| 53 | void FetchData(int* pinteger,int data_enum);
|
---|
[12322] | 54 | void FetchData(IssmDouble* pscalar,int data_enum);
|
---|
[12265] | 55 | void FetchData(char** pstring,int data_enum);
|
---|
| 56 | void FetchData(int** pmatrix,int* pM,int* pN,int data_enum);
|
---|
[12322] | 57 | void FetchData(IssmDouble** pscalarmatrix,int* pM,int* pN,int data_enum);
|
---|
[12265] | 58 | void FetchData(char*** pstringarray,int* pnumstrings,int data_enum);
|
---|
[12322] | 59 | void FetchData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum);
|
---|
[12265] | 60 | void FetchData(int num,...);
|
---|
[12322] | 61 | void FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,IssmDouble default_value=0);
|
---|
[12265] | 62 | FILE* SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);
|
---|
[3682] | 63 | };
|
---|
| 64 |
|
---|
| 65 | #endif /* _IOMODEL_H */
|
---|