DPsim
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
DPsim::DAESolver Class Reference

Solver class which uses Differential Algebraic Equation(DAE) systems. More...

#include <DAESolver.h>

Inheritance diagram for DPsim::DAESolver:
[legend]
Collaboration diagram for DPsim::DAESolver:
[legend]

Public Member Functions

 DAESolver (String name, const CPS::SystemTopology &system, Real dt, Real mT0)
 Create solve object with given parameters.
 
 ~DAESolver ()
 Deallocate all memory.
 
void initialize () final
 Initialize Components & Nodes with initial values.
 
Real step (Real time)
 Solve system for the current time.
 
CPS::Task::List getTasks () override
 Get tasks for scheduler.
 
- Public Member Functions inherited from DPsim::Solver
 Solver (String name, CPS::Logger::Level logLevel)
 
void setTimeStep (Real timeStep)
 
void doFrequencyParallelization (Bool freqParallel)
 
virtual void setSystem (const CPS::SystemTopology &system)
 
void doSystemMatrixRecomputation (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 residualFunction (realtype ttime, N_Vector state, N_Vector dstate_dt, N_Vector resid)
 

Static Protected Member Functions

static int residualFunctionWrapper (realtype ttime, N_Vector state, N_Vector dstate_dt, N_Vector resid, void *user_data)
 Residual Function of entire System.
 

Protected Attributes

CPS::SystemTopology mSystem
 
std::vector< Int > mOffsets
 Offsets vector for adding new equations to the residual vector.
 
Real mTimestep
 Constant time step.
 
Int mNEQ
 Number of equations in problem.
 
CPS::IdentifiedObject::List mComponents
 Components of the Problem.
 
CPS::SimNode< Complex >::List mNodes
 Nodes of the Problem.
 
Real mT0
 
void * mem = NULL
 Memory block allocated by IDA.
 
N_Vector state = NULL
 Vector of problem variables.
 
N_Vector dstate_dt = NULL
 Derivates of the state vector with respect to time.
 
realtype tret
 Time IDA reached while solving.
 
realtype abstol
 Scalar absolute tolerance.
 
realtype rtol
 Relative tolerance.
 
SUNMatrix A = NULL
 Template Jacobian Matrix.
 
SUNLinearSolver LS = NULL
 Linear solver object.
 
long int interalSteps = 0
 
long int resEval = 0
 
std::vector< CPS::DAEInterface::ResFn > mResidualFunctions
 
- Protected Attributes inherited from DPsim::Solver
String mName
 Name for logging.
 
CPS::Logger::Level mLogLevel
 Logging level.
 
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
 
Bool mSystemMatrixRecomputation = false
 Enable recomputation of system matrix during simulation.
 
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  Type { MNA , DAE , NRP }
 
typedef std::shared_ptr< SolverPtr
 
typedef std::vector< Ptr > List
 
- Public Attributes inherited from DPsim::Solver
int mMaxIterations = 10
 

Detailed Description

Solver class which uses Differential Algebraic Equation(DAE) systems.

Definition at line 30 of file DAESolver.h.


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