source: issm/trunk-jpl/src/c/objects/IoModel.h@ 12416

Last change on this file since 12416 was 12416, checked in by utke, 13 years ago

keep these strictlt passive - also retain the xmalloc calls given that memory is passed on to Option instances which may also receive such memory from other sections of the code we don't currently convert but all this memory is deleted in the options dtors.

File size: 2.7 KB
Line 
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
13class Elements;
14class Param;
15class Option;
16
17class IoModel {
18
19 private:
20 IssmPDouble **data; //this dataset holds temporary data, memory intensive.
21 Parameters *constants; //this dataset holds all IssmPDouble, 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(IssmPDouble *poutput,int constant_enum);
47 void Constant(char **poutput,int constant_enum);
48 Param *CopyConstantObject(int constant_enum);
49 IssmPDouble *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(IssmPDouble* 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(IssmPDouble** pscalarmatrix,int* pM,int* pN,int data_enum);
58 void FetchData(char*** pstringarray,int* pnumstrings,int data_enum);
59 void FetchData(IssmPDouble*** 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,IssmPDouble 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 */
Note: See TracBrowser for help on using the repository browser.