[1D] Add 'clearStats' function for clearing accumulated solver stats
This commit is contained in:
parent
959cbb7d7a
commit
a837dfdc6d
4 changed files with 21 additions and 0 deletions
|
|
@ -241,6 +241,9 @@ public:
|
|||
*/
|
||||
void saveStats();
|
||||
|
||||
//! Clear saved statistics
|
||||
void clearStats();
|
||||
|
||||
//! Set a function that will be called every time #eval is called.
|
||||
//! Can be used to provide keyboard interrupt support in the high-level
|
||||
//! language interfaces.
|
||||
|
|
|
|||
|
|
@ -462,6 +462,7 @@ cdef extern from "cantera/oneD/Sim1D.h":
|
|||
void save(string, string, string, int) except +
|
||||
void restore(string, string, int) except +
|
||||
void writeStats(int) except +
|
||||
void clearStats()
|
||||
int domainIndex(string) except +
|
||||
double value(size_t, size_t, size_t) except +
|
||||
double workValue(size_t, size_t, size_t) except +
|
||||
|
|
|
|||
|
|
@ -787,5 +787,11 @@ cdef class Sim1D:
|
|||
"""
|
||||
self.sim.writeStats(print_time)
|
||||
|
||||
def clear_stats(self):
|
||||
"""
|
||||
Clear solver statistics.
|
||||
"""
|
||||
self.sim.clearStats()
|
||||
|
||||
def __dealloc__(self):
|
||||
del self.sim
|
||||
|
|
|
|||
|
|
@ -129,6 +129,17 @@ void OneDim::saveStats()
|
|||
}
|
||||
}
|
||||
|
||||
void OneDim::clearStats()
|
||||
{
|
||||
m_gridpts.clear();
|
||||
m_jacEvals.clear();
|
||||
m_jacElapsed.clear();
|
||||
m_funcEvals.clear();
|
||||
m_funcElapsed.clear();
|
||||
m_nevals = 0;
|
||||
m_evaltime = 0.0;
|
||||
}
|
||||
|
||||
void OneDim::resize()
|
||||
{
|
||||
m_bw = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue