Ignis
Loading...
Searching...
No Matches
solver_kinsol Class Reference

#include <solver_kinsol.h>

Public Member Functions

 solver_kinsol (void *_user_data, const size_t _nvar, const std::vector< double > &_scales_v, const std::vector< double > &_scales_f, const std::vector< double > &_constraints, const int mu, const int ml, const double ftol=1E-5, const double stol=1E-5)
 
int solve (int(*Func)(N_Vector, N_Vector, void *), std::vector< double > &y)
 
 ~solver_kinsol ()
 

Public Attributes

void * user_data
 pointer to user data/functions
 
size_t nvar
 number of variables being solved
 
SUNContext sun
 sundials object
 
void * kmem
 kinsol object
 
N_Vector vars
 variables being solved
 
N_Vector scales_v
 scales for variables being solved: f(v)
 
N_Vector scales_f
 scales for functions being solved: f(v)
 
N_Vector constraints
 constraints on the scalars (e.g., >0 etc.)
 
SUNMatrix J
 Jacobian matrix.
 
SUNLinearSolver LS
 linear solver
 
int rv
 function return value
 
int solver_type
 KIN_NONE, KIN_LINESEARCH, KIN_FP, KIN_PICARD.
 
int exact_or_modified_newton
 1 or 0, respectively
 

Detailed Description

Inferface class for KinSol solver for nonlinear systems of equations Header only

Definition at line 21 of file solver_kinsol.h.

Constructor & Destructor Documentation

◆ solver_kinsol()

solver_kinsol::solver_kinsol ( void *  _user_data,
const size_t  _nvar,
const std::vector< double > &  _scales_v,
const std::vector< double > &  _scales_f,
const std::vector< double > &  _constraints,
const int  mu,
const int  ml,
const double  ftol = 1E-5,
const double  stol = 1E-5 
)
inline

Constructor function

Parameters
_user_datainput/output: point to user's class object with data and functions needed to compute the rates
_nvarinput: number of variables being solved
_scales_vinput: scales for variables being solved: f(v)
_scales_finput: scales for functions being solved: f(v)
_constraintsinput: vector of constraints (if any) for variables (e.g., >0, etc.)
muinput: location of upper diagonal in the banded matrix for solution
mlinput: location of lower diagonal in the banded matrix for solution
ftolinput: function tolerance
stolinput: scalar tolerance

Definition at line 59 of file solver_kinsol.h.

◆ ~solver_kinsol()

solver_kinsol::~solver_kinsol ( )
inline

Destructor, cleans up CVODE objects

Definition at line 140 of file solver_kinsol.h.

Member Function Documentation

◆ solve()

int solver_kinsol::solve ( int(*)(N_Vector, N_Vector, void *)  Func,
std::vector< double > &  y 
)
inline

Main interface: solve the f(v)=0 system

Parameters
Funcinput: pointer to function defining the problem
yinput/output: vector of variables being solved (and initial guess)

Definition at line 109 of file solver_kinsol.h.

Here is the caller graph for this function:

Member Data Documentation

◆ user_data

void* solver_kinsol::user_data

pointer to user data/functions

Definition at line 27 of file solver_kinsol.h.

◆ nvar

size_t solver_kinsol::nvar

number of variables being solved

Definition at line 28 of file solver_kinsol.h.

◆ sun

SUNContext solver_kinsol::sun

sundials object

Definition at line 30 of file solver_kinsol.h.

◆ kmem

void* solver_kinsol::kmem

kinsol object

Definition at line 31 of file solver_kinsol.h.

◆ vars

N_Vector solver_kinsol::vars

variables being solved

Definition at line 32 of file solver_kinsol.h.

◆ scales_v

N_Vector solver_kinsol::scales_v

scales for variables being solved: f(v)

Definition at line 33 of file solver_kinsol.h.

◆ scales_f

N_Vector solver_kinsol::scales_f

scales for functions being solved: f(v)

Definition at line 34 of file solver_kinsol.h.

◆ constraints

N_Vector solver_kinsol::constraints

constraints on the scalars (e.g., >0 etc.)

Definition at line 35 of file solver_kinsol.h.

◆ J

SUNMatrix solver_kinsol::J

Jacobian matrix.

Definition at line 36 of file solver_kinsol.h.

◆ LS

SUNLinearSolver solver_kinsol::LS

linear solver

Definition at line 37 of file solver_kinsol.h.

◆ rv

int solver_kinsol::rv

function return value

Definition at line 38 of file solver_kinsol.h.

◆ solver_type

int solver_kinsol::solver_type

KIN_NONE, KIN_LINESEARCH, KIN_FP, KIN_PICARD.

Definition at line 39 of file solver_kinsol.h.

◆ exact_or_modified_newton

int solver_kinsol::exact_or_modified_newton

1 or 0, respectively

Definition at line 40 of file solver_kinsol.h.


The documentation for this class was generated from the following file: