*** empty log message ***

This commit is contained in:
Dave Goodwin 2006-05-17 15:14:56 +00:00
parent cbb2eb6beb
commit 275865b5a9
7 changed files with 49 additions and 6 deletions

View file

@ -622,4 +622,26 @@ extern "C" {
catch (CanteraError) { return -1; }
}
int DLL_EXPORT sim1D_evalSSJacobian(int i) {
try {
_sim1D(i)->evalSSJacobian();
return 0;
}
catch (CanteraError) { return -1; }
}
double DLL_EXPORT sim1D_jacobian(int i, int m, int n) {
try {
return _sim1D(i)->jacobian(m,n);
}
catch (CanteraError) { return DERR; }
}
int DLL_EXPORT sim1D_size(int i) {
try {
return _sim1D(i)->size();
}
catch (CanteraError) { return -1; }
}
}

View file

@ -81,6 +81,9 @@ extern "C" {
int DLL_IMPORT sim1D_timeStepFactor(int i, double tfactor);
int DLL_IMPORT sim1D_setTimeStepLimits(int i, double tsmin, double tsmax);
int DLL_IMPORT sim1D_setFixedTemperature(int i, double temp);
int DLL_IMPORT sim1D_evalSSJacobian(int i);
double DLL_IMPORT sim1D_jacobian(int i, int m, int n);
int DLL_IMPORT sim1D_size(int i);
}

View file

@ -94,12 +94,6 @@ namespace Cantera {
for (m = 0; m < mv; m++) {
value(m+iloc,ipt) = (m_r1[m+iloc]
- resid0[m+iloc])*rdx;
//if (__isnand(value(m+iloc,ipt))) {
// cout << "NaN detected at i, j, n, m: " << i
// << " " << j << " " << n << " " << m <<
// " " << m_r1[m+iloc] << " " << resid0[m+iloc]
// << " " << rdx << endl;
//}
}
}
}

View file

@ -209,6 +209,15 @@ namespace Cantera {
return m;
}
void OneDim::evalSSJacobian(doublereal* x, doublereal* xnew) {
doublereal rdt_save = m_rdt;
m_jac_ok = false;
setSteadyMode();
eval(-1, x, xnew, 0.0, 0);
m_jac->eval(x, xnew, 0.0);
m_rdt = rdt_save;
}
/**
* Return a pointer to the domain that contains component i of the
* global solution vector. The domains are scanned right-to-left,

View file

@ -156,6 +156,8 @@ namespace Cantera {
protected:
void evalSSJacobian(doublereal* x, doublereal* xnew);
doublereal m_tmin; // minimum timestep size
doublereal m_tmax; // maximum timestep size
doublereal m_tfactor; // factor time step is multiplied by

View file

@ -9,6 +9,7 @@
*/
#include "Sim1D.h"
#include "MultiJac.h"
namespace Cantera {
@ -566,4 +567,12 @@ namespace Cantera {
}
}
}
doublereal Sim1D::jacobian(int i, int j) {
return OneDim::jacobian().value(i,j);
}
void Sim1D::evalSSJacobian() {
OneDim::evalSSJacobian(DATA_PTR(m_x), DATA_PTR(m_xnew));
}
}

View file

@ -109,6 +109,10 @@ namespace Cantera {
const doublereal* solution() const { return DATA_PTR(m_x); }
doublereal jacobian(int i, int j);
void evalSSJacobian();
protected:
vector_fp m_x; // the solution vector