|
DPsim
|
Solver class for ODE (Ordinary Differential Equation) systems. More...
#include <ODESolver.h>
Classes | |
| class | SolveTask |
Public Member Functions | |
| ODESolver (String name, const CPS::ODEInterface::Ptr &comp, bool implicit_integration, Real timestep) | |
| Create solve object with corresponding component and information on the integration type. | |
| ~ODESolver () | |
| Deallocate all memory. | |
| virtual CPS::Task::List | getTasks () |
| Get tasks for scheduler. | |
| void | initialize () |
| Initialize ARKode-solve_environment. | |
| Real | step (Real initial_time) |
| Solve system for the current time. | |
Public Member Functions inherited from DPsim::Solver | |
| Solver (String name, CPS::Logger::Level logLevel) | |
| virtual | ~Solver () |
| void | setTimeStep (Real timeStep) |
| void | doFrequencyParallelization (Bool freqParallel) |
| virtual void | setSystem (const CPS::SystemTopology &system) |
| void | setSystemMatrixRecomputationMode (SystemMatrixRecomputationMode mode) |
| Set the system-matrix recomputation mode. | |
| void | doSystemMatrixRecomputation (Bool value) |
| void | setLogSolveTimes (Bool value) |
| void | doSteadyStateInit (Bool f) |
| activate steady state initialization | |
| void | setSteadStIniTimeLimit (Real v) |
| set steady state initialization time limit | |
| void | setSteadStIniAccLimit (Real v) |
| set steady state initialization accuracy limit | |
| virtual void | setSolverAndComponentBehaviour (Solver::Behaviour behaviour) |
| set solver and component to initialization or simulation behaviour | |
| void | doInitFromNodesAndTerminals (Bool f) |
| activate powerflow initialization | |
| virtual void | setDirectLinearSolverConfiguration (DirectLinearSolverConfiguration &) |
| set direct linear solver configuration (only available in MNA for now) | |
| virtual void | logLUTimes () |
| log LU decomposition times, if applicable | |
| virtual void | log (Real time, Int timeStepCount) |
| Log results. | |
| void | setMaxNumberOfIterations (int maxIterations) |
Protected Member Functions | |
| int | StateSpace (realtype t, N_Vector y, N_Vector ydot) |
| int | Jacobian (realtype t, N_Vector y, N_Vector fy, SUNMatrix J, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) |
| int | check_flag (void *flagvalue, const std::string &funcname, int opt) |
| ARKode- standard error detection function; in DAE-solver not detection function is used -> for efficiency purposes? | |
Static Protected Member Functions | |
| static int | StateSpaceWrapper (realtype t, N_Vector y, N_Vector ydot, void *user_data) |
| Use wrappers similar to DAE_Solver. | |
| static int | JacobianWrapper (realtype t, N_Vector y, N_Vector fy, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) |
Protected Attributes | |
| CPS::ODEInterface::Ptr | mComponent |
| Component to simulate, possible specialized component needed. | |
| Int | mProbDim |
| Number of differential Variables (states) | |
| void * | mArkode_mem {nullptr} |
| Memory block allocated by ARKode. | |
| N_Vector | mStates {nullptr} |
| State vector. | |
| bool | mImplicitIntegration |
| Indicates whether the ODE shall be solved using an implicit scheme. | |
| SUNMatrix | A {nullptr} |
| Empty matrix for linear solve in each Newton step while solving the Jacobian Matrix. | |
| SUNLinearSolver | LS {nullptr} |
| Empty linear solver object. | |
| Real | mTimestep |
| Constant time step. | |
| realtype | reltol = RCONST(1.0e-6) |
| Relative tolerance. | |
| realtype | abstol = RCONST(1.0e-10) |
| Scalar absolute tolerance. | |
| int | mFlag {0} |
| Reusable error-checking flag. | |
| CPS::ODEInterface::StSpFn | mStSpFunction |
| CPS::ODEInterface::JacFn | mJacFunction |
Protected Attributes inherited from DPsim::Solver | |
| String | mName |
| Name for logging. | |
| CPS::Logger::Level | mLogLevel |
| Logging level. | |
| Bool | mLogSolveTimes = true |
| Collect step time for logging. | |
| CPS::Logger::Log | mSLog |
| Logger. | |
| Real | mTimeStep |
| Time step for fixed step solvers. | |
| Bool | mFrequencyParallel = false |
| Activates parallelized computation of frequencies. | |
| Real | mSteadStIniTimeLimit = 10 |
| steady state initialization time limit | |
| Real | mSteadStIniAccLimit = 0.0001 |
| steady state initialization accuracy limit | |
| Bool | mSteadyStateInit = false |
| Activates steady state initialization. | |
| Bool | mIsInInitialization = false |
| Determines if solver is in initialization phase, which requires different behavior. | |
| Bool | mInitFromNodesAndTerminals = true |
| SystemMatrixRecomputationMode | mSystemMatrixRecomputationMode |
| Requested system-matrix recomputation mode. | |
| Bool | mSystemMatrixRecomputationEnabled = false |
| Effective system-matrix recomputation setting used by the solver. | |
| Behaviour | mBehaviour = Solver::Behaviour::Simulation |
| Solver behaviour initialization or simulation. | |
Additional Inherited Members | |
Public Types inherited from DPsim::Solver | |
| enum | Behaviour { Initialization , Simulation } |
| enum class | SystemMatrixRecomputationMode { Auto , Enabled , Disabled } |
| System-matrix recomputation mode for MNA solvers. More... | |
| enum class | Type { MNA , DAE , NRP } |
| typedef std::shared_ptr< Solver > | Ptr |
| typedef std::vector< Ptr > | List |
Public Attributes inherited from DPsim::Solver | |
| int | mMaxIterations = 10 |
Solver class for ODE (Ordinary Differential Equation) systems.
Definition at line 25 of file ODESolver.h.
| ODESolver::ODESolver | ( | String | name, |
| const CPS::ODEInterface::Ptr & | comp, | ||
| bool | implicit_integration, | ||
| Real | timestep ) |
Create solve object with corresponding component and information on the integration type.
Definition at line 14 of file ODESolver.cpp.
| ODESolver::~ODESolver | ( | ) |
Deallocate all memory.
Definition at line 196 of file ODESolver.cpp.
|
protected |
ARKode- standard error detection function; in DAE-solver not detection function is used -> for efficiency purposes?
Definition at line 165 of file ODESolver.cpp.
|
inlinevirtual |
|
virtual |
Initialize ARKode-solve_environment.
Reimplemented from DPsim::Solver.
Definition at line 22 of file ODESolver.cpp.
|
protected |
Definition at line 60 of file ODESolver.cpp.
|
staticprotected |
Definition at line 53 of file ODESolver.cpp.
|
protected |
Definition at line 48 of file ODESolver.cpp.
|
staticprotected |
Use wrappers similar to DAE_Solver.
Definition at line 42 of file ODESolver.cpp.
Solve system for the current time.
Number of integration steps
Number of error test fails
Definition at line 67 of file ODESolver.cpp.
|
protected |
Empty matrix for linear solve in each Newton step while solving the Jacobian Matrix.
Definition at line 43 of file ODESolver.h.
|
protected |
Scalar absolute tolerance.
Definition at line 54 of file ODESolver.h.
|
protected |
Empty linear solver object.
Definition at line 45 of file ODESolver.h.
|
protected |
Memory block allocated by ARKode.
Definition at line 35 of file ODESolver.h.
|
protected |
Component to simulate, possible specialized component needed.
Definition at line 28 of file ODESolver.h.
|
protected |
Reusable error-checking flag.
Definition at line 57 of file ODESolver.h.
|
protected |
Indicates whether the ODE shall be solved using an implicit scheme.
Definition at line 41 of file ODESolver.h.
|
protected |
Definition at line 61 of file ODESolver.h.
|
protected |
Number of differential Variables (states)
Definition at line 31 of file ODESolver.h.
|
protected |
State vector.
Definition at line 37 of file ODESolver.h.
|
protected |
Definition at line 60 of file ODESolver.h.
|
protected |
Constant time step.
Definition at line 48 of file ODESolver.h.
|
protected |
Relative tolerance.
Definition at line 52 of file ODESolver.h.