roadrunner
2.6.0
Fast simulator for SBML models
|
Implementation of the fixed point iteration form of the kinsol steady state solver. More...
#include <FixedPointIteration.h>
Public Member Functions | |
FixedPointIteration (ExecutableModel *executableModel) | |
std::string | getName () const override |
Get the name of this solver. | |
std::string | getDescription () const override |
Get the description of this solver. | |
std::string | getHint () const override |
Get a (user-readable) hint for this solver. | |
double | solve () override |
void | createKinsol () override |
Initialize kinsol objects. More... | |
void | freeKinsol () override |
Destory kinsol objects. More... | |
void | updateKinsol () override |
Calls methods for updating options in kinsol. More... | |
void | resetSettings () override |
Reset all settings to their respective default values. | |
KinsolSteadyStateSolver (ExecutableModel *executableModel) | |
constructor for creating KinsolSteadyStateSolver from an executable model only. More... | |
KinsolSteadyStateSolver ()=default | |
The default constructor for constructing without a model. More... | |
![]() | |
KinsolSteadyStateSolver (ExecutableModel *executableModel) | |
constructor for creating KinsolSteadyStateSolver from an executable model only. More... | |
KinsolSteadyStateSolver ()=default | |
The default constructor for constructing without a model. More... | |
~KinsolSteadyStateSolver () override=default | |
virtual destructor | |
void | syncWithModel (ExecutableModel *m) override |
implementation of Solver::syncWithModel. More... | |
void | setFScale (double value) |
set all elements of the fscale variable to More... | |
void | setFScale (const std::vector< double > &value) |
set elements of the fscale variable to More... | |
void | setUScale (double value) |
set all elements of the uscale variable to More... | |
void | setUScale (std::vector< double > value) |
set elements of the uscale variable to value. More... | |
double | solveForSteadyState (KinsolSteadyStateSolver *solverInstance, int kinsolStrategy) |
Generic solver method. More... | |
void * | getKinsolMemory () const |
getter for the underlying memory block that is used by kinsol. More... | |
std::unordered_map< std::string, Setting > & | getSolverStats () |
return a mapping containing solver statistics. More... | |
void | printSolverStats () |
display solver stats to console | |
![]() | |
virtual void | loadConfigSettings () |
std::string | toString () const override |
Return a std::string representation of the solver. More... | |
std::string | toRepr () const override |
Return std::string representation a la Python repr method. More... | |
void | resetSettings () override |
Implements settings shared by all steady state solvers. | |
Solver ()=default | |
Solver (ExecutableModel *model) | |
![]() | |
Solver (ExecutableModel *model) | |
void | updateSettings (Dictionary *inputSettings) |
Update settings values. More... | |
std::vector< std::string > | getSettings () const |
Get a list of all settings for this solver. More... | |
std::unordered_map< std::string, Setting > & | getSettingsMap () |
get settings for this solver More... | |
virtual Setting | getValue (const std::string &key) const |
Get the value of an integrator setting. More... | |
virtual Setting | hasValue (const std::string &key) const |
Return true if this setting is supported by the integrator. More... | |
virtual size_t | getNumParams () const |
Get the number of parameters. More... | |
virtual std::string | getParamName (size_t n) const |
Get the name of the parameter at index n. More... | |
virtual std::string | getParamDisplayName (int n) const |
Get the display name of the parameter at index n. More... | |
virtual std::string | getParamHint (int n) const |
Get the hint of the parameter at index n. More... | |
virtual std::string | getParamDesc (int n) const |
Get the description of the parameter at index n. More... | |
virtual std::string | getValueAsString (const std::string &key) |
Wrapper for getValue which converts output to a specific type. More... | |
virtual void | setValue (const std::string &key, Setting value) |
virtual std::string | getSettingsRepr () const |
Get the solver settings as a std::string. More... | |
virtual std::string | settingsPyDictRepr () const |
Python dictionary-style std::string representation of settings. More... | |
const std::string & | getDisplayName (const std::string &key) const |
Gets the hint associated with a given key. More... | |
const std::string & | getHint (const std::string &key) const |
Gets the hint associated with a given key. More... | |
const std::string & | getDescription (const std::string &key) const |
Gets the description associated with a given key. More... | |
Setting::TypeId | getType (const std::string &key) const |
Gets the type associated with a given key. More... | |
virtual ExecutableModel * | getModel () const |
returns the pointer to the ExecutableModel | |
virtual std::string | getName () const=0 |
Gets the name associated with this Solver type. More... | |
virtual std::string | getHint () const=0 |
Gets the hint associated with this Solver type. More... | |
virtual std::string | getDescription () const=0 |
Gets the description associated with this Solver type. More... | |
![]() | |
virtual Solver * | construct (ExecutableModel *model) const =0 |
Constructs a new Solver of a given type. More... | |
Additional Inherited Members | |
![]() | |
using | SettingsList = std::vector< std::string > |
using | SettingsMap = std::unordered_map< std::string, Setting > |
using | DisplayNameMap = std::unordered_map< std::string, std::string > |
using | HintMap = std::unordered_map< std::string, std::string > |
using | DescriptionMap = std::unordered_map< std::string, std::string > |
![]() | |
template<class KinsolSteadyStateSolverType > | |
static int | kinsolDyDtFcn (N_Vector stateVecIn, N_Vector stateVecOut, void *userData) |
kinsol callback function that implements system equations More... | |
![]() | |
SettingsList | sorted_settings |
SettingsMap | settings |
DisplayNameMap | display_names_ |
HintMap | hints |
DescriptionMap | descriptions |
![]() | |
void | resetSettings () override |
add settings to the Solver::settings std::map when called for the first time or reset the settings std::map back to default values when called subsequent times. | |
virtual void | getSolverStatsFromKinsol () |
after solve() has been called, this method collects some details such as number of function evals | |
![]() | |
void | addSetting (const std::string &name, const Setting &val, const std::string &display_name, const std::string &hint, const std::string &description) |
![]() | |
void * | mKinsol_Memory = nullptr |
Pointer to the kinsol memory block. | |
N_Vector | mStateVector = nullptr |
a sundials N_Vector for storing system state variables | |
N_Vector | fscale = nullptr |
std::vector containing diagonal elements of scaling matrix DF for F(u) chosen so that the components of D_F*F(u) (as a matrix multiplication) all have roughly the same magnitude when u is not too near a root of F(u). More... | |
N_Vector | uscale = nullptr |
std::vector containing diagonal elements of scaling matrix Du for std::vector u chosen so that the components of D_u*u (as a matrix multiplication) all have roughly the same magnitude when u is close to a root of F(u). More... | |
N_Vector | constraints = nullptr |
vector of constraints used to ensure positive solution. More... | |
long int | numFuncEvals |
kinsol output variables. More... | |
long int | numNolinSolvIters |
long int | numBetaCondFails |
long int | numBacktrackOps |
double | funcNorm |
double | stepLength |
long int | numJacEvals |
long int | numJtimesEvals |
long int | numLinConvFails |
long int | numLinFuncEvals |
long int | numLinIters |
long int | numNonlinSolvIters |
long int | numPrecEvals |
long int | numPrecSolves |
long int | nSolverIterations = 0 |
stores the number of iterations required by the solver to converge. More... | |
std::unordered_map< std::string, Setting > | solverStats |
![]() | |
ExecutableModel * | mModel = nullptr |
non-owning pointer to model | |
Implementation of the fixed point iteration form of the kinsol steady state solver.
|
overridevirtual |
Initialize kinsol objects.
All subclasses require some of the same initial calls (such as N_VNew_Serial and KINCreate).
Reimplemented from rr::KinsolSteadyStateSolver.
|
overridevirtual |
Destory kinsol objects.
Destroys the kinsol objects that are shared among KinsolSteadyStateSolvers
Reimplemented from rr::KinsolSteadyStateSolver.
|
default |
The default constructor for constructing without a model.
useful only for testing.
|
explicit |
constructor for creating KinsolSteadyStateSolver from an executable model only.
This constructor should be inherited by subclasses
|
overridevirtual |
Calls methods for updating options in kinsol.
The settings configuration system in roadrunner make this particular aspect of interacting with sundials libraries a little akward.
User passes in arguments like uScale and they are stored at the class level. This method passed them on to kinsol.
When a user updates a setting with setValue, they are only updating the value in roadrunner. The change doesn't occur in sundials until we call the corresponding sundials function with the new value. We cannot use regular "setters" because they won't get called when a user changes a value. Instead, here we update all kinsol options at once, and this method is called before we call KIN_Solve.
Reimplemented from rr::KinsolSteadyStateSolver.