SIMLIB/C++
3.07
|
IntegrationMethod - Abstract base class for integration methods. More...
#include <simlib.h>
Classes | |
class | Memory |
Public Member Functions | |
IntegrationMethod (const char *name) | |
register method to list of methods and name it More... | |
virtual | ~IntegrationMethod () |
destroy integration method (remove from list) More... | |
virtual bool | IsSingleStep (void)=0 |
virtual void | TurnOff (void) |
turn off integration method: flush memories etc... More... | |
virtual void | Integrate (void)=0 |
virtual bool | PrepareStep (void) |
prepare object for integration step More... | |
virtual void | Resize (size_t size) |
resize all the memories to the given size More... | |
Static Public Member Functions | |
static void | StepSim (void) |
step of numerical integration method More... | |
static void | IntegrationDone (void) |
static void | SetMethod (const char *name) |
set method which will be used More... | |
static const char * | GetMethod (void) |
static void | InitStep (double step_frag) |
initialize step More... | |
static void | FunCall (double step_frag) |
static void | SetOptStep (double opt_step) |
static void | SetStepSize (double step_size) |
static bool | IsConditionFlag (void) |
static int | GetErrNo (void) |
static void | SetErrNo (int num) |
Protected Types | |
typedef IntegratorContainer::iterator | Iterator |
Static Protected Member Functions | |
static Iterator | FirstIntegrator (void) |
static Iterator | LastIntegrator (void) |
static bool | StateCond (void) |
check on changes of state conditions More... | |
static IntegrationMethod * | SearchMethod (const char *name) |
search method in the list of registrated methods More... | |
Static Protected Attributes | |
static bool | IsEndStepEvent =false |
Private Member Functions | |
IntegrationMethod (const IntegrationMethod &)=delete | |
IntegrationMethod & | operator= (const IntegrationMethod &)=delete |
IntegrationMethod () | |
IntegrationMethod (IntegrationMethod &) | |
Static Private Member Functions | |
static bool | Prepare (void) |
initialize integration step More... | |
static void | Iterate (void) |
compute new values of state blocks in model without integrators More... | |
static void | Summarize (void) |
set up new state after execution of integration step More... | |
Private Attributes | |
std::list< IntegrationMethod * >::iterator | ItList |
const char * | method_name |
size_t | PrevINum |
std::list< Memory * > | MList |
Static Private Attributes | |
static IntegrationMethod * | CurrentMethodPtr = &rke |
pointer to the method currently used "rke" is a predefined method (historical reasons, we need rk45) More... | |
static std::list< IntegrationMethod * > * | MthLstPtr =NULL |
static std::list< Memory * > * | PtrMList |
Friends | |
class | Memory |
IntegrationMethod - Abstract base class for integration methods.
|
protected |
|
privatedelete |
|
private |
|
private |
|
explicit |
register method to list of methods and name it
Definition at line 194 of file numint.cc.
References Dprintf, ItList, method_name, MList, MthLstPtr, simlib3::NI_MultDefMeth, PtrMList, and simlib3::SIMLIB_error().
|
virtual |
destroy integration method (remove from list)
Definition at line 222 of file numint.cc.
References Dprintf, ItList, method_name, MthLstPtr, and SIMLIB_internal_error.
|
inlinestaticprotected |
Definition at line 1081 of file simlib.h.
References simlib3::IntegratorContainer::Begin().
Referenced by simlib3::RKF3::Integrate(), simlib3::RKF5::Integrate(), simlib3::EULER::Integrate(), simlib3::RKF8::Integrate(), simlib3::RKE::Integrate(), simlib3::FW::Integrate(), and simlib3::ABM4::Integrate().
|
static |
Definition at line 337 of file numint.cc.
References _SetTime, simlib3::SIMLIB_DeltaTime, simlib3::SIMLIB_Dynamic(), simlib3::SIMLIB_StepSize, simlib3::SIMLIB_StepStartTime, and simlib3::Time.
|
static |
Definition at line 322 of file numint.cc.
References simlib3::SIMLIB_ERRNO.
|
inlinestatic |
Definition at line 1125 of file simlib.h.
References method_name, and simlib3::SetErrNo().
Referenced by simlib3::GetMethod(), simlib3::GetStarter(), and simlib3::SetStarter().
|
static |
initialize step
Definition at line 298 of file numint.cc.
References simlib3::max(), simlib3::min(), simlib3::SIMLIB_ContractStep, simlib3::SIMLIB_ContractStepFlag, simlib3::SIMLIB_MaxStep, simlib3::SIMLIB_MinStep, and simlib3::SIMLIB_StepSize.
|
pure virtual |
Implemented in simlib3::ABM4, simlib3::FW, simlib3::RKE, simlib3::EULER, simlib3::RKF8, simlib3::RKF3, and simlib3::RKF5.
Referenced by simlib3::ABM4::Integrate(), and StepSim().
|
inlinestatic |
Definition at line 1121 of file simlib.h.
References simlib3::SetMethod(), and TurnOff().
Referenced by simlib3::Run().
|
static |
Definition at line 317 of file numint.cc.
References simlib3::SIMLIB_ConditionFlag.
|
pure virtual |
Implemented in simlib3::MultiStepMethod, and simlib3::SingleStepMethod.
|
staticprivate |
compute new values of state blocks in model without integrators
Definition at line 88 of file numint.cc.
References _SetTime, Dprintf, IsEndStepEvent, simlib3::StatusContainer::LtoN(), simlib3::max(), simlib3::SIMLIB_ContractStep, simlib3::SIMLIB_ContractStepFlag, simlib3::SIMLIB_DeltaTime, simlib3::SIMLIB_Dynamic(), simlib3::SIMLIB_MinStep, simlib3::SIMLIB_StepSize, simlib3::SIMLIB_StepStartTime, simlib3::aCondition::TestAll(), and simlib3::Time.
Referenced by StepSim().
|
inlinestaticprotected |
Definition at line 1084 of file simlib.h.
References simlib3::IntegratorContainer::End().
Referenced by simlib3::RKF3::Integrate(), simlib3::RKF5::Integrate(), simlib3::EULER::Integrate(), simlib3::RKF8::Integrate(), simlib3::RKE::Integrate(), simlib3::FW::Integrate(), and simlib3::ABM4::Integrate().
|
privatedelete |
|
staticprivate |
initialize integration step
Definition at line 128 of file numint.cc.
References CurrentMethodPtr, Dprintf, IsEndStepEvent, simlib3::NextTime, simlib3::NI_IlStepSize, simlib3::IntegratorContainer::NtoL(), simlib3::StatusContainer::NtoL(), PrepareStep(), simlib3::SIMLIB_ConditionFlag, simlib3::SIMLIB_DeltaTime, simlib3::SIMLIB_Dynamic(), simlib3::SIMLIB_error(), simlib3::SIMLIB_OptStep, simlib3::SIMLIB_ResetStatus, simlib3::SIMLIB_StepSize, simlib3::SIMLIB_StepStartTime, simlib3::aCondition::TestAll(), and simlib3::Time.
Referenced by StepSim().
|
virtual |
prepare object for integration step
Reimplemented in simlib3::StatusMethod, simlib3::MultiStepMethod, simlib3::ABM4, and simlib3::FW.
Definition at line 282 of file numint.cc.
References Dprintf, PrevINum, Resize(), and simlib3::IntegratorContainer::Size().
Referenced by Prepare(), simlib3::FW::PrepareStep(), simlib3::MultiStepMethod::PrepareStep(), and simlib3::StatusMethod::PrepareStep().
|
virtual |
|
staticprotected |
search method in the list of registrated methods
Definition at line 239 of file numint.cc.
References Dprintf, MthLstPtr, simlib3::NI_UnknownMeth, and simlib3::SIMLIB_error().
Referenced by simlib3::MultiStepMethod::GetStarter(), SetMethod(), simlib3::MultiStepMethod::SetStarter(), and simlib3::MultiStepMethod::SlavePtr().
|
static |
|
static |
set method which will be used
Definition at line 75 of file numint.cc.
References CurrentMethodPtr, Dprintf, simlib3::NI_CantSetMethod, SearchMethod(), simlib3::SIMLIB_DynamicFlag, simlib3::SIMLIB_error(), and TurnOff().
Referenced by simlib3::SetMethod().
|
static |
Definition at line 307 of file numint.cc.
References simlib3::SIMLIB_OptStep.
|
static |
Definition at line 312 of file numint.cc.
References simlib3::SIMLIB_StepSize.
|
staticprotected |
check on changes of state conditions
Definition at line 175 of file numint.cc.
References Dprintf, IsEndStepEvent, simlib3::SIMLIB_ContractStep, simlib3::SIMLIB_ContractStepFlag, simlib3::SIMLIB_MinStep, simlib3::SIMLIB_StepSize, and simlib3::aCondition::TestAll().
Referenced by simlib3::RKF3::Integrate(), simlib3::RKF5::Integrate(), simlib3::EULER::Integrate(), simlib3::RKF8::Integrate(), simlib3::RKE::Integrate(), simlib3::FW::Integrate(), and simlib3::ABM4::Integrate().
|
static |
step of numerical integration method
Definition at line 52 of file numint.cc.
References CurrentMethodPtr, Dprintf, Integrate(), simlib3::IntegratorContainer::isAny(), Iterate(), Prepare(), simlib3::SIMLIB_DynamicFlag, Summarize(), and simlib3::Time.
Referenced by simlib3::Run().
|
staticprivate |
set up new state after execution of integration step
Definition at line 114 of file numint.cc.
References _SetTime, Dprintf, IsEndStepEvent, simlib3::NextTime, simlib3::IntegratorContainer::NtoL(), simlib3::StatusContainer::NtoL(), simlib3::SIMLIB_DeltaTime, simlib3::SIMLIB_StepStartTime, and simlib3::Time.
Referenced by StepSim().
|
virtual |
turn off integration method: flush memories etc...
Reimplemented in simlib3::StatusMethod, and simlib3::MultiStepMethod.
Definition at line 261 of file numint.cc.
References Dprintf, PrevINum, and Resize().
Referenced by IntegrationDone(), SetMethod(), simlib3::MultiStepMethod::TurnOff(), and simlib3::StatusMethod::TurnOff().
|
staticprivate |
pointer to the method currently used "rke" is a predefined method (historical reasons, we need rk45)
Definition at line 1062 of file simlib.h.
Referenced by simlib3::StatusMethod::GoToState(), Prepare(), SetMethod(), and StepSim().
|
staticprotected |
Definition at line 1079 of file simlib.h.
Referenced by simlib3::StatusMethod::GoToState(), simlib3::RKF3::Integrate(), simlib3::RKF5::Integrate(), simlib3::EULER::Integrate(), simlib3::RKF8::Integrate(), simlib3::RKE::Integrate(), simlib3::FW::Integrate(), simlib3::ABM4::Integrate(), Iterate(), Prepare(), simlib3::StatusMethod::RestoreState(), StateCond(), and Summarize().
|
private |
Definition at line 1064 of file simlib.h.
Referenced by IntegrationMethod(), and ~IntegrationMethod().
|
private |
Definition at line 1065 of file simlib.h.
Referenced by GetMethod(), IntegrationMethod(), and ~IntegrationMethod().
|
private |
Definition at line 1071 of file simlib.h.
Referenced by IntegrationMethod(), and Resize().
|
staticprivate |
Definition at line 1063 of file simlib.h.
Referenced by simlib3::StatusMethod::GoToState(), IntegrationMethod(), SearchMethod(), and ~IntegrationMethod().
|
private |
Definition at line 1070 of file simlib.h.
Referenced by PrepareStep(), and TurnOff().
|
staticprivate |
Definition at line 1072 of file simlib.h.
Referenced by simlib3::StatusMethod::GoToState(), and IntegrationMethod().