53 const int SOLVEPROB_RESIDUAL = 2;
54 const int SOLVEPROB_JACOBIAN = 3;
55 const int SOLVEPROB_TRANSIENT = 4;
177 int solve(
int ifunc, doublereal time_scale, doublereal reltol);
183 virtual void reportState(doublereal*
const CSoln)
const;
192 virtual void setBounds(
const doublereal botBounds[],
const doublereal topBounds[]);
194 void setAtol(
const doublereal atol[]);
195 void setAtolConst(
const doublereal atolconst);
199 virtual void print_header(
int ioflag,
int ifunc, doublereal time_scale,
201 doublereal netProdRate[]);
203 #ifdef DEBUG_SOLVEPROB
205 virtual void printResJac(
int ioflag,
int neq,
const Array2D& Jac,
206 doublereal resid[], doublereal wtResid[], doublereal norm);
210 virtual void printIteration(
int ioflag, doublereal damp,
size_t label_d,
size_t label_t,
211 doublereal inv_t, doublereal t_real,
int iter,
212 doublereal update_norm, doublereal resid_norm,
213 doublereal netProdRate[], doublereal CSolnSP[],
215 doublereal wtSpecies[],
size_t dim,
bool do_time);
218 virtual void printFinal(
int ioflag, doublereal damp,
size_t label_d,
size_t label_t,
219 doublereal inv_t, doublereal t_real,
int iter,
220 doublereal update_norm, doublereal resid_norm,
221 doublereal netProdRateKinSpecies[],
const doublereal CSolnSP[],
222 const doublereal resid[],
223 const doublereal wtSpecies[],
const doublereal wtRes[],
224 size_t dim,
bool do_time);
257 virtual doublereal
calc_t(doublereal netProdRateSolnSP[], doublereal Csoln[],
258 size_t* label,
size_t* label_old,
259 doublereal* label_factor,
int ioflag);
271 virtual void calcWeights(doublereal wtSpecies[], doublereal wtResid[],
272 const doublereal CSolnSP[]);
274 #ifdef DEBUG_SOLVEPROB
285 virtual void printIterationHeader(
int ioflag, doublereal damp,
286 doublereal inv_t, doublereal t_real,
int iter,
302 virtual void fun_eval(doublereal*
const resid,
const doublereal*
const CSolnSP,
303 const doublereal*
const CSolnSPOld,
const bool do_time,
const doublereal deltaT);
318 virtual void resjac_eval(std::vector<doublereal*>& JacCol, doublereal* resid,
320 const doublereal* CSolnSPOld,
const bool do_time,
321 const doublereal deltaT);
341 virtual doublereal
calc_damping(doublereal x[], doublereal dxneg[],
size_t dim,
size_t* label);
Dense, Square (not sparse) matrices.
virtual void setBounds(const doublereal botBounds[], const doublereal topBounds[])
Set the bottom and top bounds on the solution vector.
const int SOLVEPROB_INITIALIZE
Solution Methods.
virtual doublereal calc_t(doublereal netProdRateSolnSP[], doublereal Csoln[], size_t *label, size_t *label_old, doublereal *label_factor, int ioflag)
Calculate a conservative delta T to use in a pseudo-steady state algorithm.
virtual doublereal calc_damping(doublereal x[], doublereal dxneg[], size_t dim, size_t *label)
This function calculates a damping factor for the Newton iteration update vector, dxneg...
solveProb(ResidEval *resid)
Constructor for the object.
vector_fp m_wtSpecies
Weights for the species concentrations norm calculation.
int solve(int ifunc, doublereal time_scale, doublereal reltol)
Main routine that actually calculates the pseudo steady state of the surface problem.
virtual void printIteration(int ioflag, doublereal damp, size_t label_d, size_t label_t, doublereal inv_t, doublereal t_real, int iter, doublereal update_norm, doublereal resid_norm, doublereal netProdRate[], doublereal CSolnSP[], doublereal resid[], doublereal wtSpecies[], size_t dim, bool do_time)
Printing routine that gets called after every iteration.
solveProb & operator=(const solveProb &right)
Unimplemented private assignment operator.
size_t m_neq
Total number of equations to solve in the implicit problem.
vector_fp m_numEqn1
Temporary vector with length MAX(1, m_neq)
A class for 2D arrays stored in column-major (Fortran-compatible) form.
ResidEval * m_residFunc
residual function pointer to be solved.
vector_fp m_botBounds
Bottom bounds for the solution vector.
vector_fp m_CSolnSPOld
Saved solution vector at the old time step.
virtual void reportState(doublereal *const CSoln) const
Report the current state of the solution.
Virtual base class for DAE residual function evaluators.
doublereal m_rtol
m_rtol is the relative error tolerance.
vector_fp m_atol
m_atol is the absolute tolerance in real units.
A class for full (non-sparse) matrices with Fortran-compatible data storage.
doublereal m_maxstep
maximum value of the time step
vector_fp m_resid
Residual for the surface problem.
vector_fp m_CSolnSP
Solution vector.
SquareMatrix m_Jac
Jacobian.
virtual void fun_eval(doublereal *const resid, const doublereal *const CSolnSP, const doublereal *const CSolnSPOld, const bool do_time, const doublereal deltaT)
Main Function evaluation.
virtual void resjac_eval(std::vector< doublereal * > &JacCol, doublereal *resid, doublereal *CSolnSP, const doublereal *CSolnSPOld, const bool do_time, const doublereal deltaT)
Main routine that calculates the current residual and Jacobian.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
std::vector< doublereal * > m_JacCol
Vector of pointers to the top of the columns of the Jacobians.
vector_fp m_CSolnSPInit
Saved initial solution vector.
virtual void calcWeights(doublereal wtSpecies[], doublereal wtResid[], const doublereal CSolnSP[])
Calculate the solution and residual weights.
vector_fp m_netProductionRatesSave
Temporary vector with length MAX(1, m_neq)
virtual void print_header(int ioflag, int ifunc, doublereal time_scale, doublereal reltol, doublereal netProdRate[])
Printing routine that gets called at the start of every invocation.
vector_fp m_CSolnSave
Temporary vector with length MAX(1, m_neq)
vector_fp m_numEqn2
Temporary vector with length MAX(1, m_neq)
virtual void printFinal(int ioflag, doublereal damp, size_t label_d, size_t label_t, doublereal inv_t, doublereal t_real, int iter, doublereal update_norm, doublereal resid_norm, doublereal netProdRateKinSpecies[], const doublereal CSolnSP[], const doublereal resid[], const doublereal wtSpecies[], const doublereal wtRes[], size_t dim, bool do_time)
Print a summary of the solution.
vector_fp m_wtResid
Weights for the residual norm calculation.
vector_fp m_topBounds
Top bounds for the solution vector.
Method to solve a pseudo steady state of a nonlinear problem.