Fixed a memory overwrite error in solveProb
This commit is contained in:
parent
9b5560f425
commit
fae826750f
3 changed files with 1282 additions and 1318 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -28,6 +28,7 @@
|
|||
#include "NonlinearSolver.h"
|
||||
|
||||
#include "mdp_allo.h"
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX(x,y) (( (x) > (y) ) ? (x) : (y))
|
||||
#endif
|
||||
|
|
@ -68,10 +69,10 @@ namespace Cantera {
|
|||
class BEulerInt : public Integrator {
|
||||
|
||||
public:
|
||||
/**
|
||||
* The default constructor doesn't take an argument.
|
||||
*/
|
||||
|
||||
//! The default constructor doesn't take an argument.
|
||||
BEulerInt();
|
||||
//! Destructor
|
||||
virtual ~BEulerInt();
|
||||
virtual void setTolerances(double reltol, int n, double* abstol);
|
||||
virtual void setTolerances(double reltol, double abstol);
|
||||
|
|
|
|||
|
|
@ -66,6 +66,8 @@ namespace Cantera {
|
|||
|
||||
// Dimension solution vector
|
||||
int dim1 = MAX(1, m_neq);
|
||||
|
||||
m_atol.resize(dim1, 0.0);
|
||||
m_netProductionRatesSave.resize(dim1, 0.0);
|
||||
m_numEqn1.resize(dim1, 0.0);
|
||||
m_numEqn2.resize(dim1, 0.0);
|
||||
|
|
@ -76,13 +78,14 @@ namespace Cantera {
|
|||
m_wtResid.resize(dim1, 0.0);
|
||||
m_wtSpecies.resize(dim1, 0.0);
|
||||
m_resid.resize(dim1, 0.0);
|
||||
m_ipiv.resize(dim1, 0);
|
||||
|
||||
m_ipiv.resize(dim1, 0);
|
||||
|
||||
m_Jac.resize(dim1, dim1, 0.0);
|
||||
m_JacCol.resize(dim1, 0);
|
||||
for (int k = 0; k < dim1; k++) {
|
||||
m_JacCol[k] = m_Jac.ptrColumn(k);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//================================================================================================
|
||||
// Empty destructor
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue