53 const int SOLVEPROB_RESIDUAL = 2;
54 const int SOLVEPROB_JACOBIAN = 3;
55 const int SOLVEPROB_TRANSIENT = 4;
176 int solve(
int ifunc, doublereal time_scale, doublereal reltol);
182 virtual void reportState(doublereal*
const CSoln)
const;
191 virtual void setBounds(
const doublereal botBounds[],
const doublereal topBounds[]);
193 void setAtol(
const doublereal atol[]);
194 void setAtolConst(
const doublereal atolconst);
198 virtual void print_header(
int ioflag,
int ifunc, doublereal time_scale,
200 doublereal netProdRate[]);
202 #ifdef DEBUG_SOLVEPROB
204 virtual void printResJac(
int ioflag,
int neq,
const Array2D& Jac,
205 doublereal resid[], doublereal wtResid[], doublereal norm);
209 virtual void printIteration(
int ioflag, doublereal damp,
size_t label_d,
size_t label_t,
210 doublereal inv_t, doublereal t_real,
int iter,
211 doublereal update_norm, doublereal resid_norm,
212 doublereal netProdRate[], doublereal CSolnSP[],
214 doublereal wtSpecies[],
size_t dim,
bool do_time);
217 virtual void printFinal(
int ioflag, doublereal damp,
size_t label_d,
size_t label_t,
218 doublereal inv_t, doublereal t_real,
int iter,
219 doublereal update_norm, doublereal resid_norm,
220 doublereal netProdRateKinSpecies[],
const doublereal CSolnSP[],
221 const doublereal resid[],
222 const doublereal wtSpecies[],
const doublereal wtRes[],
223 size_t dim,
bool do_time);
256 virtual doublereal
calc_t(doublereal netProdRateSolnSP[], doublereal Csoln[],
257 size_t* label,
size_t* label_old,
258 doublereal* label_factor,
int ioflag);
270 virtual void calcWeights(doublereal wtSpecies[], doublereal wtResid[],
271 const doublereal CSolnSP[]);
273 #ifdef DEBUG_SOLVEPROB
284 virtual void printIterationHeader(
int ioflag, doublereal damp,
285 doublereal inv_t, doublereal t_real,
int iter,
301 virtual void fun_eval(doublereal*
const resid,
const doublereal*
const CSolnSP,
302 const doublereal*
const CSolnSPOld,
const bool do_time,
const doublereal deltaT);
317 virtual void resjac_eval(std::vector<doublereal*>& JacCol, doublereal* resid,
319 const doublereal* CSolnSPOld,
const bool do_time,
320 const doublereal deltaT);
340 virtual doublereal
calc_damping(doublereal x[], doublereal dxneg[],
size_t dim,
size_t* label);
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.
Header file for class Cantera::Array2D.
std::vector< int > vector_int
Vector of ints.
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.
doublereal m_maxstep
maximum value of the time step
vector_fp m_resid
Residual for the surface problem.
vector_fp m_CSolnSP
Solution vector.
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.