Skip to content

Commit

Permalink
- bugfix CombiTable2D
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5087 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Mar 5, 2010
1 parent 6440d84 commit a16418c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions c_runtime/tables.cpp
Expand Up @@ -151,10 +151,10 @@ int omcTable2DIni(int ipoType,
}

extern "C"
double omcTable2DIpo(int tableID,int icol, double irow)
double omcTable2DIpo(int tableID,double u1_, double u2_)
{
if ((int)interpolationTables2D.size() != 0 && tableID >= 0 && tableID < (int)interpolationTables2D.size()) {
return interpolationTables2D[tableID]->Interpolate(icol,irow-1);
return interpolationTables2D[tableID]->Interpolate(u1_,u2_);
} else { // error, unvalid tableID
if (acceptedStep) {
cerr << "in omcTable2DIpo, tableID " << tableID << " is not a valid table ID." << endl;
Expand Down Expand Up @@ -481,12 +481,12 @@ double InterpolationTable2D::Interpolate(double u1_, double u2_)
/* test if u1 and u2 are strict growing */
bool InterpolationTable2D::check_data(double u1_, double u2_)
{
for(unsigned int i=1;i<nRows_-2;i++)
for(unsigned int i=1;i<nRows_-1;i++)
{
if(!(getElt(i,0)<getElt(i+1,0))) throw "u1 nicht streng monoton";
}

for(unsigned int i=1;i<nCols_-2;i++)
for(unsigned int i=1;i<nCols_-1;i++)
{
if(!(getElt(0,i)<getElt(0,i+1))) throw "u2 nicht streng monoton";
}
Expand Down
2 changes: 1 addition & 1 deletion c_runtime/tables.h
Expand Up @@ -59,7 +59,7 @@ double omcTableTimeTmin(int tableID);

int omcTable2DIni(int ipoType,char *tableName,char* fileName, double *table,int tableDim1,int tableDim2,int colWise);

double omcTable2DIpo(int tableID,int icol, double irow);
double omcTable2DIpo(int tableID,double u1_, double u2_);


#ifdef __cplusplus
Expand Down

0 comments on commit a16418c

Please sign in to comment.