jcaiuwyo / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

missing functionality in ReactorNet C++ class #161

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Documentation reports the function:
void setTolerances  (   double      reltol,
        size_t      n,
        double *    abstol 
    )

(http://cantera.github.io/docs/doxygen/html/classCantera_1_1CVodeInt.html#a77aba
291a4c01c3f703f2447daf4b658)
but it results impossible to use this function in the c++ framework.

2. Starting from the combustor.cpp sample, try to add a line after line 109 
(just berfore the while cycle that compute the solution in time):

    double atoli[nEq];
    atoli[0] = 1e-8;
    atoli[1] = 1e-12;
    for (k = 2; k < (nEq - 1); k++) {
        atoli[k] = 1e-15;
    }
    sim.setTolerances(1e-9, nEq, *atoli);

and then try to compile.

3. What is the expected output? What do you see instead?
I expect to have the possibility to compile the code and use this function 
while I get the error message:

combustor.cpp:125:40: error: no matching function for call to 
‘Cantera::ReactorNet::setTolerances(double, size_t&, double&)’
combustor.cpp:125:40: note: candidate is:
/opt/cantera/202/include/cantera/zeroD/ReactorNet.h:49:10: note: void 
Cantera::ReactorNet::setTolerances(doublereal, doublereal)
/opt/cantera/202/include/cantera/zeroD/ReactorNet.h:49:10: note:   candidate 
expects 2 arguments, 3 provided

What version of the product are you using? On what operating system?

Cantera 2.2.0, Ubuntu Linux 12.04

Original issue reported on code.google.com by francesc...@gmail.com on 6 May 2013 at 1:52

GoogleCodeExporter commented 9 years ago
The documentation you linked to is for class CVodeInt, but you're trying to use 
the setTolerances method of a ReactorNet object, which is different. You can 
access the underlying integrator object by calling sim.integrator().

Original comment by yarmond on 8 May 2013 at 2:46