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 |
|
---|
10 | #include "../include/include.h"
|
---|
11 | #include "../EnumDefinitions/EnumDefinitions.h"
|
---|
12 |
|
---|
13 | class Elements;
|
---|
14 | class Param;
|
---|
15 | class Option;
|
---|
16 |
|
---|
17 | class IoModel {
|
---|
18 |
|
---|
19 | private:
|
---|
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.*
|
---|
22 |
|
---|
23 | public:
|
---|
24 | /*This data needs to stay memory resident at all time, even if it's memory intensive: */
|
---|
25 | FILE *fid; //pointer to input file
|
---|
26 | bool *my_elements;
|
---|
27 | bool *my_nodes;
|
---|
28 | int *my_vertices;
|
---|
29 | int *singlenodetoelementconnectivity;
|
---|
30 | int *numbernodetoelementconnectivity;
|
---|
31 |
|
---|
32 | /*Data to synchronize through low level object drivers: */
|
---|
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
|
---|
36 |
|
---|
37 | /*Methods*/
|
---|
38 | ~IoModel();
|
---|
39 | IoModel();
|
---|
40 | IoModel(FILE* iomodel_handle);
|
---|
41 |
|
---|
42 | /*Input/Output*/
|
---|
43 | void CheckEnumSync(void);
|
---|
44 | void Constant(bool *poutput,int constant_enum);
|
---|
45 | void Constant(int *poutput,int constant_enum);
|
---|
46 | void Constant(IssmDouble *poutput,int constant_enum);
|
---|
47 | void Constant(char **poutput,int constant_enum);
|
---|
48 | Param *CopyConstantObject(int constant_enum);
|
---|
49 | IssmDouble *Data(int dataenum);
|
---|
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);
|
---|
54 | void FetchData(IssmDouble* pscalar,int data_enum);
|
---|
55 | void FetchData(char** pstring,int data_enum);
|
---|
56 | void FetchData(int** pmatrix,int* pM,int* pN,int data_enum);
|
---|
57 | void FetchData(IssmDouble** pscalarmatrix,int* pM,int* pN,int data_enum);
|
---|
58 | void FetchData(char*** pstringarray,int* pnumstrings,int data_enum);
|
---|
59 | void FetchData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum);
|
---|
60 | void FetchData(Option **poption,int data_enum);
|
---|
61 | void FetchData(int num,...);
|
---|
62 | void FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,IssmDouble default_value=0);
|
---|
63 | void LastIndex(int *pindex);
|
---|
64 | FILE* SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);
|
---|
65 | };
|
---|
66 |
|
---|
67 | #endif /* _IOMODEL_H */
|
---|