From 0db629dcd924f73ad08300f66e943567f928891b Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Sat, 20 May 2006 21:12:37 +0000 Subject: [PATCH] *** empty log message *** --- Cantera/cxx/include/integrators.h | 2 +- Cantera/src/CVodesIntegrator.cpp | 16 +++++++++++++++- Cantera/src/CVodesIntegrator.h | 7 +++++-- Cantera/src/Integrator.h | 5 ++++- preconfig | 2 +- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Cantera/cxx/include/integrators.h b/Cantera/cxx/include/integrators.h index 8dca72cfb..69a603dae 100755 --- a/Cantera/cxx/include/integrators.h +++ b/Cantera/cxx/include/integrators.h @@ -5,6 +5,6 @@ #ifndef CT_INTEG_H_INCL #define CT_INTEG_H_INCL -#include "kernel/CVode.h" +#include "kernel/Integrator.h" #endif diff --git a/Cantera/src/CVodesIntegrator.cpp b/Cantera/src/CVodesIntegrator.cpp index 6f509b5b1..7132ec97f 100644 --- a/Cantera/src/CVodesIntegrator.cpp +++ b/Cantera/src/CVodesIntegrator.cpp @@ -20,6 +20,7 @@ using namespace std; #include #include #include +#include #include #include #include @@ -107,7 +108,8 @@ namespace Cantera { m_abstolsens(1.0e-4), m_nabs(0), m_hmax(0.0), - m_maxsteps(20000), m_np(0) + m_maxsteps(20000), m_np(0), + m_mupper(0), m_mlower(0) { //m_ropt.resize(OPT_SIZE,0.0); //m_iopt = new long[OPT_SIZE]; @@ -282,6 +284,12 @@ namespace Cantera { else if (m_type == GMRES) { CVSpgmr(m_cvode_mem, PREC_NONE, 0); } + else if (m_type == BAND + NOJAC) { + long int N = m_neq; + long int nu = m_mupper; + long int nl = m_mlower; + CVBand(m_cvode_mem, N, nu, nl); + } else { throw CVodesErr("unsupported option"); } @@ -343,6 +351,12 @@ namespace Cantera { else if (m_type == DIAG) { CVDiag(m_cvode_mem); } + else if (m_type == BAND + NOJAC) { + long int N = m_neq; + long int nu = m_mupper; + long int nl = m_mlower; + CVBand(m_cvode_mem, N, nu, nl); + } else if (m_type == GMRES) { CVSpgmr(m_cvode_mem, PREC_NONE, 0); } diff --git a/Cantera/src/CVodesIntegrator.h b/Cantera/src/CVodesIntegrator.h index 7a5b997c1..fb40c2895 100644 --- a/Cantera/src/CVodesIntegrator.h +++ b/Cantera/src/CVodesIntegrator.h @@ -71,7 +71,10 @@ namespace Cantera { virtual void setMaxStepSize(double hmax); virtual void setMinStepSize(double hmin); virtual void setMaxSteps(int nmax); - + virtual void setBandwidth(int N_Upper, int N_Lower) { + m_mupper = N_Upper; + m_mlower = N_Lower; + } virtual int nSensParams() { return m_np; } virtual double sensitivity(int k, int p); @@ -97,7 +100,7 @@ namespace Cantera { FuncData* m_fdata; N_Vector* m_yS; int m_np; - + int m_mupper, m_mlower; }; } // namespace diff --git a/Cantera/src/Integrator.h b/Cantera/src/Integrator.h index d0983abe6..d750a2ad2 100755 --- a/Cantera/src/Integrator.h +++ b/Cantera/src/Integrator.h @@ -32,7 +32,7 @@ #define NOJAC 4 #define JAC 8 #define GMRES 16 - +#define BAND 32 namespace Cantera { @@ -160,6 +160,9 @@ namespace Cantera { virtual void setMaxSteps(int nmax) { warn("setMaxStep"); } + virtual void setBandwidth(int N_Upper, int N_Lower) + { warn("setBandwidth"); } + virtual int nSensParams() { warn("nSensParams()"); return 0; } diff --git a/preconfig b/preconfig index 1ef4cf8b9..908deba24 100755 --- a/preconfig +++ b/preconfig @@ -243,7 +243,7 @@ ENABLE_TPX='y' # # See: http://www.llnl.gov/CASC/sundials # -USE_SUNDIALS=${USE_SUNDIALS:='n'} +USE_SUNDIALS=${USE_SUNDIALS:='y'} SUNDIALS_HOME=${SUNDIALS_HOME:=/usr/local/sundials} #-----------------------------------------------------------------