#include <AlgLoop.h>
|
static KinsolSolver * | NewKinsolSolver (const int algLoopNum, const unsigned int size, double absoluteTolerance, const bool useDirectionalDerivative) |
| Create new oms::KinsolSolver::KinsolSolver object. More...
|
|
|
static int | nlsKinsolJac (N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2) |
| Jacobian function for KINSOL. More...
|
|
static int | nlsKinsolResiduals (N_Vector u, N_Vector fval, void *user_data) |
| Residual function for KINSOL. More...
|
|
static void | sundialsErrorHandlerFunction (int error_code, const char *module, const char *function, char *msg, void *user_data) |
| Error handler function given to KINSOL. More...
|
|
static void | sundialsInfoHandlerFunction (const char *module, const char *function, char *msg, void *user_data) |
| Info handler function given to KINSOL. More...
|
|
◆ ~KinsolSolver()
oms::KinsolSolver::~KinsolSolver |
( |
| ) |
|
Destroy the oms::KinsolSolver::KinsolSolver object.
◆ kinsolSolve()
Solve algebraic system with KINSOL.
- Parameters
-
syst | Reference to System object |
graph | Reference to graph opbject |
- Returns
- oms_status_enu_t Return
oms_status_ok
on success, oms_status_warning
if solving was computed, but solution is not within tolerance and oms_status_error
if an error occured.
◆ NewKinsolSolver()
oms::KinsolSolver * oms::KinsolSolver::NewKinsolSolver |
( |
const int |
algLoopNum, |
|
|
const unsigned int |
size, |
|
|
double |
absoluteTolerance, |
|
|
const bool |
useDirectionalDerivative |
|
) |
| |
|
static |
Create new oms::KinsolSolver::KinsolSolver object.
- Parameters
-
algLoopNum | Number of algebraic loop |
size | Dimension of algebraic loop |
absoluteTolerance | Tolerance used for solving the loop |
- Returns
- oms::KinsolSolver* Retruns pointer to KinsolSolver object
◆ nlsKinsolJac()
int oms::KinsolSolver::nlsKinsolJac |
( |
N_Vector |
u, |
|
|
N_Vector |
fu, |
|
|
SUNMatrix |
J, |
|
|
void * |
user_data, |
|
|
N_Vector |
tmp1, |
|
|
N_Vector |
tmp2 |
|
) |
| |
|
staticprivate |
Jacobian function for KINSOL.
- Parameters
-
u | is the current (unscaled) iterate |
fu | is the current value of the vector F(u) |
J | is the output approximate Jacobian matrix, J = ∂F/∂u, of type SUNMatrix |
data | is a pointer to user data, the same as the user data parameter passed to KINSetUserData |
tmp1 | pointer to memory allocated for variables of type N_Vector which can be used by the KINJacFn function as temporary storage or work space |
tmp2 | pointer to memory allocated for variables of type N_Vector which can be used by the KINJacFn function as temporary storage or work space |
- Returns
- int A function of type KINLsJacFn should return 0 if successful or a non-zero value otherwise
◆ nlsKinsolResiduals()
int oms::KinsolSolver::nlsKinsolResiduals |
( |
N_Vector |
u, |
|
|
N_Vector |
fval, |
|
|
void * |
user_data |
|
) |
| |
|
staticprivate |
Residual function for KINSOL.
This function computes F(u) (or G(u) for fixed-point iteration and Anderson acceleration) for a given value of the vector u.
- Parameters
-
u | is the current value of the variable vector, u |
fval | is the output vector F(u) |
user_data | a is a pointer to user data, the pointer user data passed to KINSetUserData |
- Returns
- int A KINSysFn function should return 0 if successful, a positive value if a recoverable error occurred (in which case kinsol will attempt to correct), or a negative value if it failed unrecoverably (in which case the solution process is halted and KIN SYSFUNC FAIL is returned).
◆ sundialsErrorHandlerFunction()
void oms::KinsolSolver::sundialsErrorHandlerFunction |
( |
int |
errorCode, |
|
|
const char * |
module, |
|
|
const char * |
function, |
|
|
char * |
msg, |
|
|
void * |
user_data |
|
) |
| |
|
staticprivate |
Error handler function given to KINSOL.
- Parameters
-
errorCode | Error code from KINSOL |
module | Name of the module reporting the error. |
function | Name of the function in which the error occurred. |
msg | Error Message. |
user_data | Pointer to user data. Unused. |
◆ sundialsInfoHandlerFunction()
void oms::KinsolSolver::sundialsInfoHandlerFunction |
( |
const char * |
module, |
|
|
const char * |
function, |
|
|
char * |
msg, |
|
|
void * |
user_data |
|
) |
| |
|
staticprivate |
Info handler function given to KINSOL.
Will only print information when debug loging is active.
- Parameters
-
module | Name of the module reporting the information. |
function | Name of the function reporting the information. |
msg | Message. |
user_data | Pointer to user data. Unused. |
◆ fnormtol
double oms::KinsolSolver::fnormtol |
|
private |
◆ fScale
N_Vector oms::KinsolSolver::fScale |
|
private |
◆ fTmp
N_Vector oms::KinsolSolver::fTmp |
|
private |
◆ initialGuess
N_Vector oms::KinsolSolver::initialGuess |
|
private |
SUNMatrix oms::KinsolSolver::J |
|
private |
◆ kinsolMemory
void* oms::KinsolSolver::kinsolMemory |
|
private |
◆ linSol
SUNLinearSolver oms::KinsolSolver::linSol |
|
private |
◆ size
int oms::KinsolSolver::size |
|
private |
◆ uScale
N_Vector oms::KinsolSolver::uScale |
|
private |
◆ user_data
void* oms::KinsolSolver::user_data |
|
private |
N_Vector oms::KinsolSolver::y |
|
private |
The documentation for this class was generated from the following files:
- /var/lib/jenkins/ws/OMSimulator_master/src/OMSimulatorLib/AlgLoop.h
- /var/lib/jenkins/ws/OMSimulator_master/src/OMSimulatorLib/AlgLoop.cpp