root/trunk/Modelica/C-Sources/ModelicaTables_Dymola.c

Revision 1037, 2.1 kB (checked in by otter, 10 months ago)

Re-added ModelicaTables_Dymola.c, since some people seem still to need it

Line 
1
2#include "ModelicaTables.h"
3#include "dymtable.h"
4
5
6int ModelicaTables_CombiTimeTable_init(const char* tableName, const char* fileName, 
7                                        double const *table, int nRow, int nColumn,
8                                        double startTime, int smoothness,
9                                        int extrapolation) {
10  int tableID = (int) dymTableTimeIni2(0.0, startTime, smoothness-1, extrapolation-1, 
11                                       tableName, fileName, table, nRow, nColumn, 0.0);
12  return tableID;
13}
14
15void ModelicaTables_CombiTimeTable_close(int tableID) {
16  ;
17};
18
19double ModelicaTables_CombiTimeTable_interpolate(int tableID, int icol, double u) {
20  return dymTableTimeIpo2(tableID, icol, u);
21}
22
23double ModelicaTables_CombiTimeTable_minimumTime(int tableID) {
24  int tableID2 = (int) tableID;
25  return dymTableTimeTmin(tableID2);
26}
27
28double ModelicaTables_CombiTimeTable_maximumTime(int tableID) {
29  return dymTableTimeTmax(tableID);
30}
31
32
33
34
35
36
37int ModelicaTables_CombiTable1D_init(const char* tableName, const char* fileName, 
38                                       double const *table, int nRow, int nColumn, 
39                                       int smoothness) {
40  int tableID = (int) dymTableInit(1.0, smoothness-1, tableName, fileName, table, nRow, nColumn, 0.0);
41  return tableID;
42}
43
44void ModelicaTables_CombiTable1D_close(int tableID) {
45  ;
46};
47
48double ModelicaTables_CombiTable1D_interpolate(int tableID, int icol, double u) {
49  return dymTableIpo1((double) tableID, icol, u);
50}
51
52
53
54
55
56
57int ModelicaTables_CombiTable2D_init(const char* tableName, const char* fileName,
58                                       double const *table, int nRow, int nColumn, 
59                                       int smoothness) {
60  int tableID = (int) dymTableInit(2.0, smoothness-1, tableName, fileName, table, nRow, nColumn, 0.0);
61  return tableID;
62}
63
64void ModelicaTables_CombiTable2D_close(int tableID) {
65  ;
66};
67
68double ModelicaTables_CombiTable2D_interpolate(int tableID, double u1, double u2) {
69  return dymTableIpo2((double) tableID, u1, u2);
70}
Note: See TracBrowser for help on using the browser.