View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001987 | OpenFOAM | Bug | public | 2016-02-04 16:09 | 2016-02-04 17:30 |
Reporter | Assigned To | henry | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | GNU/Linux | OS | OpenSuSE | OS Version | 12.3 |
Summary | 0001987: DataEntry<label> interpolation issue | ||||
Description | Using DataEntry with type "label" and a input method that uses interpolation will result in an incorrect return value. For linear interpolation for example the interpolated value is calculated as: t = weight[0] * table[i].second() t += weight[1] * table[i+1].second() Since t is a label and table[] returns a label, the result for "t" will typically be 1 less than it should. For example, consider a scenario with table[0] = 2 table[1] = 2 weight[0] = 0.33 weight[1] = 0.67 t0 = 0.33 * 2 = 0 t1 = 0 + 0.67 * 2 = 1 Where in fact it should be t = 2 A simple solution is a bit tricky due to the nature of the templating. I guess specialization would do the trick. | ||||
Steps To Reproduce | Construct DataEntry<label> and check value(x) function return against expected value. | ||||
Tags | No tags attached. | ||||