changes to make solution of user-defined BVPs simpler.

This commit is contained in:
Dave Goodwin 2005-09-15 03:50:04 +00:00
parent cfad5d0430
commit 2db47e4018
6 changed files with 24 additions and 20 deletions

View file

@ -65,7 +65,7 @@ namespace Cantera {
m_atol_ss[n] = atol;
}
}
void Domain1D::
eval(int jg, doublereal* xg, doublereal* rg,
integer* mask, doublereal rdt) {
@ -108,24 +108,27 @@ namespace Cantera {
}
}
}
// called to set up initial grid, and after grid refinement
void Domain1D::setupGrid(int n, const doublereal* z) {
resize(m_nv, n);
int j;
for (j = 0; j < m_points; j++) m_z[j] = z[j];
if (n > 1) {
resize(m_nv, n);
int j;
for (j = 0; j < m_points; j++) m_z[j] = z[j];
}
}
void drawline() {
writelog("\n-------------------------------------"
"------------------------------------------");
}
/**
* Print the solution.
*/
*/
void Domain1D::showSolution(const doublereal* x) {
int nn = m_nv/5;
int i, j, n;
@ -173,6 +176,7 @@ namespace Cantera {
writelog("\n");
}
// initial solution
void Domain1D::_getInitialSoln(doublereal* x) {
for (int j = 0; j < m_points; j++) {
@ -186,5 +190,6 @@ namespace Cantera {
throw CanteraError("Domain1D::initialValue",
"base class method called!");
}
} // namespace

View file

@ -142,10 +142,10 @@ namespace Cantera {
int pt = offset/dom.nComponents();
int comp = offset - pt*dom.nComponents();
throw CanteraError("MultiNewton::step",
"Jacobian is singular for domain "+
dom.id() + ", component "
+dom.componentName(comp)+" at point "
+int2str(pt)+"\nsee file bandmatrix.csv\n");
"Jacobian is singular for domain "+
dom.id() + ", component "
+dom.componentName(comp)+" at point "
+int2str(pt)+"\n(Matrix row "+int2str(iok)+") \nsee file bandmatrix.csv\n");
}
else if (iok < 0)
throw CanteraError("MultiNewton::step",

View file

@ -201,9 +201,8 @@ namespace Cantera {
/**
* Change the grid size. Called after grid refinement.
*/
void StFlow::resize(int points) {
Domain1D::resize(m_nv, points);
void StFlow::resize(int ncomponents, int points) {
Domain1D::resize(ncomponents, points);
m_rho.resize(m_points, 0.0);
m_wtm.resize(m_points, 0.0);
m_cp.resize(m_points, 0.0);
@ -230,8 +229,8 @@ namespace Cantera {
}
void StFlow::setupGrid(int n, const doublereal* z) {
resize(n);
void StFlow::setupGrid(int n, const doublereal* z) {
resize(m_nv, n);
int j;
m_z[0] = z[0];

View file

@ -233,7 +233,7 @@ namespace Cantera {
void integrateChem(doublereal* x,doublereal dt);
void resize(int points);
void resize(int components, int points);
virtual void setFixedPoint(int j0, doublereal t0){}

View file

@ -403,7 +403,7 @@ namespace Cantera {
string Outlet1D::componentName(int n) const {
switch (n) {
case 0: return "dummy"; break;
case 0: return "outlet dummy"; break;
default: return "<unknown>";
}
}

View file

@ -5,5 +5,5 @@
#include "StFlow.cpp"
#include "boundaries1D.cpp"
#include "refine.cpp"
#include "Sim1D.cpp"
#include "Sim1D.cpp"
#include "Domain1D.cpp"