Skip to content

Commit

Permalink
Fix sphinx and doxygen, add test debug statement, change tolerance
Browse files Browse the repository at this point in the history
This commit fixes all sphinx or doxygen warnings, adds a statement to
debug the python reactor test, test_tolerances, and changes the problem
tolerance from 1e-6 to 1e-5. This test should still test what intended.
The change fixes the test for the MoleReactor class on Windows. Thought
about how tolerances are set for mole reactors is needed.
  • Loading branch information
anthony-walker committed Aug 13, 2022
1 parent cc4435c commit 1cd3b33
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 8 additions & 0 deletions doc/sphinx/cython/zerodim.rst
Expand Up @@ -42,6 +42,10 @@ Reactor
^^^^^^^
.. autoclass:: Reactor

MoleReactor
^^^^^^^^^^^
.. autoclass:: MoleReactor(contents=None, *, name=None, energy='on')

IdealGasReactor
^^^^^^^^^^^^^^^
.. autoclass:: IdealGasReactor(contents=None, *, name=None, energy='on')
Expand All @@ -54,6 +58,10 @@ ConstPressureReactor
^^^^^^^^^^^^^^^^^^^^
.. autoclass:: ConstPressureReactor(contents=None, *, name=None, energy='on')

ConstPressureMoleReactor
^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: ConstPressureMoleReactor(contents=None, *, name=None, energy='on')

IdealGasConstPressureReactor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: IdealGasConstPressureReactor(contents=None, *, name=None, energy='on')
Expand Down
4 changes: 2 additions & 2 deletions include/cantera/zeroD/MoleReactor.h
Expand Up @@ -38,11 +38,11 @@ class MoleReactor : public Reactor

protected:
//! Get moles of the system from mass fractions stored by thermo object
//! @param y[out] vector for system moles to be put into
//! @param y vector for moles to be put into
virtual void getMoles(double* y);

//! Set internal mass variable based on moles given
//! @param y[in] vector of moles of the system
//! @param y vector of moles of the system
virtual void setMassFromMoles(double* y);

virtual void evalSurfaces(double* LHS, double* RHS, double* sdot);
Expand Down
7 changes: 3 additions & 4 deletions test/python/test_reactor.py
Expand Up @@ -220,10 +220,9 @@ def integrate(atol, rtol):

n_baseline = integrate(1e-10, 1e-20)
n_rtol = integrate(5e-7, 1e-20)
n_atol = integrate(1e-10, 1e-6)

self.assertTrue(n_baseline > n_rtol)
self.assertTrue(n_baseline > n_atol)
n_atol = integrate(1e-10, 1e-5)
self.assertTrue(n_baseline > n_rtol, f"{n_baseline} is less than {n_rtol}")
self.assertTrue(n_baseline > n_atol, f"{n_baseline} is less than {n_atol}")

def test_advance_limits(self):
P0 = 10 * ct.one_atm
Expand Down

0 comments on commit 1cd3b33

Please sign in to comment.