DPsim
Loading...
Searching...
No Matches
DPsim::MnaSolverDirect< VarType > Class Template Reference

Solver class using Modified Nodal Analysis (MNA). More...

#include <MNASolverDirect.h>

Inheritance diagram for DPsim::MnaSolverDirect< VarType >:
[legend]
Collaboration diagram for DPsim::MnaSolverDirect< VarType >:
[legend]

Classes

class  LogTask
 
struct  ProfileMeasurement
 
struct  RightVectorStamp
 
class  SolveTask
 
class  SolveTaskHarm
 
class  SolveTaskRecomp
 
class  StateSpaceExtractionTask
 State-space extraction task. More...
 

Public Member Functions

 MnaSolverDirect (String name, CPS::Domain domain=CPS::Domain::DP, CPS::Logger::Level logLevel=CPS::Logger::Level::info)
 
virtual ~MnaSolverDirect ()
 Destructor.
 
void setDirectLinearSolverImplementation (DirectLinearSolverImpl implementation)
 Sets the linear solver to "implementation" and creates an object.
 
void setDirectLinearSolverConfiguration (DirectLinearSolverConfiguration &configuration) override
 Sets the linear solver configuration.
 
void logLUTimes () override
 log LU decomposition times
 
- Public Member Functions inherited from DPsim::MnaSolver< VarType >
virtual ~MnaSolver ()
 Destructor.
 
virtual void initialize () override
 Calls subroutines to set up everything that is required before simulation.
 
virtual void setSystem (const CPS::SystemTopology &system) override
 
Matrix & leftSideVector ()
 
Matrix & rightSideVector ()
 
virtual CPS::Task::List getTasks () override
 Get tasks for scheduler.
 
void doStateSpaceExtraction (Bool value=true)
 Enable or disable MNA state-space extraction.
 
const MNAStateSpaceExtractor & getStateSpaceExtractor () const
 Read-only access to the MNA state-space extractor.
 
- Public Member Functions inherited from DPsim::Solver
 Solver (String name, CPS::Logger::Level logLevel)
 
virtual ~Solver ()
 
void setTimeStep (Real timeStep)
 
void doFrequencyParallelization (Bool freqParallel)
 
void setSystemMatrixRecomputationMode (SystemMatrixRecomputationMode mode)
 Set the system-matrix recomputation mode.
 
void doSystemMatrixRecomputation (Bool value)
 
void setLogSolveTimes (Bool value)
 
void setZeroSkipping (Bool enabled)
 Enable or disable skipping exact zero matrix contributions.
 
Bool getZeroSkipping () const
 
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
 
void setMaxNumberOfIterations (int maxIterations)
 

Public Attributes

int mIter = 0
 
- Public Attributes inherited from DPsim::MnaSolver< VarType >
CPS::Attribute< Matrix >::Ptr mLeftSideVector
 Solution vector of unknown quantities.
 
Matrix * mLeftSideVectorValue = nullptr
 Cached payload for the per-step solver hot path.
 
std::vector< CPS::Attribute< Matrix >::Ptr > mLeftSideVectorHarm
 Solution vector of unknown quantities (parallel frequencies)
 
- Public Attributes inherited from DPsim::Solver
int mMaxIterations = 10
 

Protected Member Functions

void recordProfileMeasurement (const String &phase, std::chrono::steady_clock::time_point start, std::chrono::steady_clock::time_point end)
 
void createEmptySystemMatrix () override
 Create system matrix.
 
void prepareCompactRightVectorStamps ()
 
void addRightVectorStamps (Matrix &rightVector)
 
void switchedMatrixEmpty (std::size_t index) override
 Sets all entries in the matrix with the given switch index to zero.
 
void switchedMatrixEmpty (std::size_t swIdx, Int freqIdx) override
 Sets all entries in the matrix with the given switch index and frequency index to zero.
 
void switchedMatrixStamp (std::size_t index, std::vector< std::shared_ptr< CPS::MNAInterface > > &comp) override
 Applies a component stamp to the matrix with the given switch index.
 
void switchedMatrixStamp (std::size_t swIdx, Int freqIdx, CPS::MNAInterface::List &components, CPS::MNASwitchInterface::List &switches) override
 Applies component and switch stamps for one frequency and factorizes it.
 
void stampVariableSystemMatrix () override
 Stamps components into the variable system matrix.
 
void solveWithSystemMatrixRecomputation (Real time, Int timeStepCount) override
 Solves the system with variable system matrix.
 
std::shared_ptr< CPS::Task > createSolveTaskRecomp () override
 Create a solve task for recomputation solver.
 
virtual void recomputeSystemMatrix (Real time)
 Recomputes systems matrix.
 
void extractStateSpace (Real time)
 Runs state-space extraction using the active linear solver.
 
std::shared_ptr< CPS::Task > createSolveTask () override
 Create a solve task for this solver implementation.
 
std::shared_ptr< CPS::Task > createLogTask () override
 Create a solve task for this solver implementation.
 
std::shared_ptr< CPS::Task > createSolveTaskHarm (UInt freqIdx) override
 Create a solve task for this solver implementation.
 
std::shared_ptr< CPS::Task > createStateSpaceExtractionTask () override
 Create state-space extraction task for this solver implementation.
 
void logSystemMatrices () override
 Logging of system matrices and source vector.
 
void solve (Real time, Int timeStepCount) override
 Solves system for single frequency.
 
void solveWithHarmonics (Real time, Int timeStepCount, Int freqIdx) override
 Solves system for multiple frequencies.
 
void logSolveTime ()
 Logging of the right-hand-side solution time.
 
void logFactorizationTime ()
 Logging of the LU factorization time.
 
void logRecomputationTime ()
 Logging of the LU refactorization time.
 
std::shared_ptr< DirectLinearSolver > createDirectSolverImplementation (CPS::Logger::Log mSLog)
 Returns a pointer to an object of type DirectLinearSolver.
 
void createEmptySystemMatrix ()
 Create system matrix.
 
void createEmptySystemMatrix ()
 Create system matrix.
 
- Protected Member Functions inherited from DPsim::MnaSolver< VarType >
void updateSwitchStatus ()
 Collects the status of switches to select correct system matrix.
 
 MnaSolver (String name, CPS::Domain domain=CPS::Domain::DP, CPS::Logger::Level logLevel=CPS::Logger::Level::info)
 Constructor should not be called by users but by Simulation.
 
void initializeComponents ()
 Initialization of individual components.
 
void addRightVectorStamp (const CPS::MNAInterface::Ptr &component)
 Add a component's RHS stamp and cache any known structural row indices.
 
void addRightVectorStamps (Matrix &rightVector, Int stampColumn=-1) const
 Accumulate component RHS stamps, using sparse indices when available.
 
virtual void initializeSystem ()
 Initialization of system matrices and source vector.
 
void initializeSystemWithParallelFrequencies ()
 Initialization of system matrices and source vector.
 
void initializeSystemWithPrecomputedMatrices ()
 Initialization of system matrices and source vector.
 
void initializeSystemWithVariableMatrix ()
 Initialization of system matrices and source vector.
 
void initializeStateSpaceExtractor ()
 Initialization of state-space extraction.
 
void identifyTopologyObjects ()
 Identify Nodes and SimPowerComps and SimSignalComps.
 
void resolveSystemMatrixRecomputationMode ()
 Resolve the requested system-matrix recomputation mode.
 
void assignMatrixNodeIndices ()
 Assign simulation node index according to index in the vector.
 
void collectVirtualNodes ()
 
void steadyStateInitialization ()
 
void createEmptyVectors ()
 Create left and right side vector.
 
Bool hasVariableComponentChanged ()
 Checks whether the status of variable MNA elements have changed.
 
virtual void log (Real time, Int timeStepCount) override
 Logs left and right vector.
 
void initializeComponents ()
 
void initializeComponents ()
 
void createEmptyVectors ()
 
void createEmptyVectors ()
 

Protected Attributes

std::unordered_map< std::bitset< SWITCH_NUM >, std::vector< SparseMatrix > > mSwitchedMatrices
 Map of system matrices where the key is the bitset describing the switch states.
 
std::unordered_map< std::bitset< SWITCH_NUM >, std::vector< std::shared_ptr< DirectLinearSolver > > > mDirectLinearSolvers
 Map of direct linear solvers related to the system matrices.
 
std::vector< RightVectorStamp > mRightVectorStampOperations
 
std::size_t mDenseRightVectorStampCalls = 0
 
std::size_t mCompactRightVectorStampCalls = 0
 
SparseMatrix mBaseSystemMatrix
 System matrix including all static elements.
 
SparseMatrix mVariableSystemMatrix
 System matrix including stamp of static and variable elements.
 
std::shared_ptr< DirectLinearSolver > mDirectLinearSolverVariableSystemMatrix
 LU factorization of variable system matrix.
 
DirectLinearSolverImpl mImplementationInUse
 LU factorization indicator.
 
DirectLinearSolverConfiguration mConfigurationInUse
 LU factorization configuration.
 
Bool mVariableComponentChanged = false
 Tracks variable-component changes from the last solve step.
 
Bool mSystemMatrixChanged = false
 Tracks active MNA system-matrix changes from the last solve step.
 
std::map< String, ProfileMeasurement > mProfileMeasurements
 
- Protected Attributes inherited from DPsim::MnaSolver< VarType >
CPS::Domain mDomain
 Simulation domain, which can be dynamic phasor (DP) or EMT.
 
UInt mNumNodes = 0
 Number of network and virtual nodes, single line equivalent.
 
UInt mNumNetNodes = 0
 Number of network nodes, single line equivalent.
 
UInt mNumVirtualNodes = 0
 Number of virtual nodes, single line equivalent.
 
UInt mNumMatrixNodeIndices = 0
 Number of network and virtual nodes, considering individual phases.
 
UInt mNumNetMatrixNodeIndices = 0
 Number of network nodes, considering individual phases.
 
UInt mNumVirtualMatrixNodeIndices = 0
 Number of virtual nodes, considering individual phases.
 
UInt mNumHarmMatrixNodeIndices = 0
 Number of nodes, excluding the primary frequency.
 
UInt mNumTotalMatrixNodeIndices = 0
 Total number of network and virtual nodes, considering individual phases and additional frequencies.
 
std::vector< std::pair< UInt, UInt > > mListVariableSystemMatrixEntries
 List of index pairs of varying matrix entries.
 
CPS::SystemTopology mSystem
 System topology.
 
CPS::SimNode< VarType >::List mNodes
 List of simulation nodes.
 
CPS::MNAInterface::List mMNAComponents
 List of MNA components with static stamp into system matrix.
 
CPS::MNASwitchInterface::List mSwitches
 
CPS::MNAInterface::List mMNAIntfSwitches
 List of switches if they must be accessed as MNAInterface objects.
 
CPS::SimSignalComp::List mSimSignalComps
 List of signal type components that do not directly interact with the MNA solver.
 
std::bitset< SWITCH_NUM > mCurrentSwitchStatus
 Current status of all switches encoded as bitset.
 
CPS::MNASyncGenInterface::List mSyncGen
 List of synchronous generators that need iterate to solve the differential equations.
 
CPS::MNANonlinearCompInterface::List mNonlinearComps
 
Matrix mRightSideVector
 Source vector of known quantities.
 
std::vector< CPS::Attribute< Matrix >::Ptr > mRightVectorStamps
 List of all right side vector contributions.
 
std::vector< std::vector< UInt > > mRightVectorStampIndices
 Sparse row indices for stamps that can provide their structural support.
 
std::vector< Bool > mRightVectorStampUsesIndices
 Whether each RHS stamp has valid sparse row indices.
 
std::vector< Matrix > mRightSideVectorHarm
 Source vector of known quantities.
 
Int mNumRecomputations = 0
 Number of system matrix recomputations.
 
CPS::MNAVariableCompInterface::List mVariableComps
 
std::vector< Bool > mVariableCompAlwaysDirty
 
CPS::MNAInterface::List mMNAIntfVariableComps
 List of variable components if they must be accessed as MNAInterface objects.
 
UInt mSwitchTimeIndex = 0
 Index of the next switching event.
 
std::vector< SwitchConfiguration > mSwitchEvents
 Vector of switch times.
 
Int mLastLogTimeStep = 0
 Last simulation time step when log was updated.
 
std::shared_ptr< DataLogger > mLeftVectorLog
 Left side vector logger.
 
std::shared_ptr< DataLogger > mRightVectorLog
 Right side vector logger.
 
std::vector< Real > mFactorizeTimes
 LU factorization measurements.
 
std::vector< Real > mSolveTimes
 Right-hand side solution measurements.
 
std::vector< Real > mRecomputationTimes
 LU refactorization measurements.
 
Bool mStateSpaceExtraction = false
 Enables extraction of the MNA-coupled discrete-time state matrix.
 
MNAStateSpaceExtractor::Ptr mStateSpaceExtractor
 Extractor for the MNA-coupled state-space model.
 
- 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 = DEFAULT_STEAD_ST_INI_TIME_LIMIT
 steady state initialization time limit
 
Real mSteadStIniAccLimit = DEFAULT_STEAD_ST_INI_ACC_LIMIT
 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.
 
Bool mZeroSkipping = true
 Skip exact zero contributions during matrix assembly (enabled by default).
 
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
 
- Static Public Attributes inherited from DPsim::Solver
static constexpr Real DEFAULT_STEAD_ST_INI_TIME_LIMIT = 10
 Default steady state initialization time limit.
 
static constexpr Real DEFAULT_STEAD_ST_INI_ACC_LIMIT = 1e-8
 Default steady state initialization accuracy limit.
 

Detailed Description

template<typename VarType>
class DPsim::MnaSolverDirect< VarType >

Solver class using Modified Nodal Analysis (MNA).

Definition at line 81 of file MNASolverDirect.h.

Constructor & Destructor Documentation

◆ MnaSolverDirect()

template<typename VarType>
DPsim::MnaSolverDirect< VarType >::MnaSolverDirect ( String name,
CPS::Domain domain = CPS::Domain::DP,
CPS::Logger::Level logLevel = CPS::Logger::Level::info )

Constructor should not be called by users but by Simulation sovlerImpl: choose the most advanced solver implementation available by default

Definition at line 43 of file MNASolverDirect.cpp.

◆ ~MnaSolverDirect()

template<typename VarType>
DPsim::MnaSolverDirect< VarType >::~MnaSolverDirect ( )
virtual

Destructor.

Definition at line 183 of file MNASolverDirect.cpp.

Member Function Documentation

◆ addRightVectorStamps()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::addRightVectorStamps ( Matrix & rightVector)
protected

Definition at line 548 of file MNASolverDirect.cpp.

◆ createDirectSolverImplementation()

template<typename VarType>
std::shared_ptr< DirectLinearSolver > DPsim::MnaSolverDirect< VarType >::createDirectSolverImplementation ( CPS::Logger::Log mSLog)
protected

Returns a pointer to an object of type DirectLinearSolver.

Definition at line 936 of file MNASolverDirect.cpp.

◆ createEmptySystemMatrix() [1/3]

void DPsim::MnaSolverDirect< Real >::createEmptySystemMatrix ( )
protectedvirtual

Create system matrix.

Implements DPsim::MnaSolver< VarType >.

Definition at line 370 of file MNASolverDirect.cpp.

◆ createEmptySystemMatrix() [2/3]

void DPsim::MnaSolverDirect< Complex >::createEmptySystemMatrix ( )
protectedvirtual

Create system matrix.

Implements DPsim::MnaSolver< VarType >.

Definition at line 390 of file MNASolverDirect.cpp.

◆ createEmptySystemMatrix() [3/3]

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::createEmptySystemMatrix ( )
overrideprotectedvirtual

Create system matrix.

Implements DPsim::MnaSolver< VarType >.

◆ createLogTask()

template<typename VarType>
std::shared_ptr< CPS::Task > DPsim::MnaSolverDirect< VarType >::createLogTask ( )
overrideprotectedvirtual

Create a solve task for this solver implementation.

Implements DPsim::MnaSolver< VarType >.

Definition at line 590 of file MNASolverDirect.cpp.

◆ createSolveTask()

template<typename VarType>
std::shared_ptr< CPS::Task > DPsim::MnaSolverDirect< VarType >::createSolveTask ( )
overrideprotectedvirtual

Create a solve task for this solver implementation.

Implements DPsim::MnaSolver< VarType >.

Definition at line 421 of file MNASolverDirect.cpp.

◆ createSolveTaskHarm()

template<typename VarType>
std::shared_ptr< CPS::Task > DPsim::MnaSolverDirect< VarType >::createSolveTaskHarm ( UInt freqIdx)
overrideprotectedvirtual

Create a solve task for this solver implementation.

Implements DPsim::MnaSolver< VarType >.

Definition at line 577 of file MNASolverDirect.cpp.

◆ createSolveTaskRecomp()

template<typename VarType>
std::shared_ptr< CPS::Task > DPsim::MnaSolverDirect< VarType >::createSolveTaskRecomp ( )
overrideprotectedvirtual

Create a solve task for recomputation solver.

Implements DPsim::MnaSolver< VarType >.

Definition at line 430 of file MNASolverDirect.cpp.

◆ createStateSpaceExtractionTask()

template<typename VarType>
std::shared_ptr< CPS::Task > DPsim::MnaSolverDirect< VarType >::createStateSpaceExtractionTask ( )
overrideprotectedvirtual

Create state-space extraction task for this solver implementation.

Implements DPsim::MnaSolver< VarType >.

Definition at line 584 of file MNASolverDirect.cpp.

◆ extractStateSpace()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::extractStateSpace ( Real time)
protected

Runs state-space extraction using the active linear solver.

Definition at line 355 of file MNASolverDirect.cpp.

◆ logFactorizationTime()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::logFactorizationTime ( )
protected

Logging of the LU factorization time.

Definition at line 906 of file MNASolverDirect.cpp.

◆ logLUTimes()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::logLUTimes ( )
overridevirtual

log LU decomposition times

Reimplemented from DPsim::Solver.

Definition at line 792 of file MNASolverDirect.cpp.

◆ logRecomputationTime()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::logRecomputationTime ( )
protected

Logging of the LU refactorization time.

Definition at line 913 of file MNASolverDirect.cpp.

◆ logSolveTime()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::logSolveTime ( )
protected

Logging of the right-hand-side solution time.

Definition at line 890 of file MNASolverDirect.cpp.

◆ logSystemMatrices()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::logSystemMatrices ( )
overrideprotectedvirtual

Logging of system matrices and source vector.

Implements DPsim::MnaSolver< VarType >.

Definition at line 752 of file MNASolverDirect.cpp.

◆ prepareCompactRightVectorStamps()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::prepareCompactRightVectorStamps ( )
protected

Definition at line 519 of file MNASolverDirect.cpp.

◆ recomputeSystemMatrix()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::recomputeSystemMatrix ( Real time)
protectedvirtual

Recomputes systems matrix.

Reimplemented in DPsim::MnaSolverPlugin< VarType >.

Definition at line 324 of file MNASolverDirect.cpp.

◆ recordProfileMeasurement()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::recordProfileMeasurement ( const String & phase,
std::chrono::steady_clock::time_point start,
std::chrono::steady_clock::time_point end )
protected

Definition at line 873 of file MNASolverDirect.cpp.

◆ setDirectLinearSolverConfiguration()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::setDirectLinearSolverConfiguration ( DirectLinearSolverConfiguration & configuration)
overridevirtual

Sets the linear solver configuration.

Reimplemented from DPsim::Solver.

Definition at line 994 of file MNASolverDirect.cpp.

◆ setDirectLinearSolverImplementation()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::setDirectLinearSolverImplementation ( DirectLinearSolverImpl implementation)

Sets the linear solver to "implementation" and creates an object.

Definition at line 988 of file MNASolverDirect.cpp.

◆ solve()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::solve ( Real time,
Int timeStepCount )
overrideprotectedvirtual

Solves system for single frequency.

Implements DPsim::MnaSolver< VarType >.

Reimplemented in DPsim::MnaSolverPlugin< VarType >.

Definition at line 595 of file MNASolverDirect.cpp.

◆ solveWithHarmonics()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::solveWithHarmonics ( Real time,
Int timeStepCount,
Int freqIdx )
overrideprotectedvirtual

Solves system for multiple frequencies.

Implements DPsim::MnaSolver< VarType >.

Definition at line 733 of file MNASolverDirect.cpp.

◆ solveWithSystemMatrixRecomputation()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::solveWithSystemMatrixRecomputation ( Real time,
Int timeStepCount )
overrideprotectedvirtual

Solves the system with variable system matrix.

Implements DPsim::MnaSolver< VarType >.

Definition at line 188 of file MNASolverDirect.cpp.

◆ stampVariableSystemMatrix()

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::stampVariableSystemMatrix ( )
overrideprotectedvirtual

Stamps components into the variable system matrix.

Implements DPsim::MnaSolver< VarType >.

Definition at line 108 of file MNASolverDirect.cpp.

◆ switchedMatrixEmpty() [1/2]

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::switchedMatrixEmpty ( std::size_t index)
overrideprotectedvirtual

Sets all entries in the matrix with the given switch index to zero.

Implements DPsim::MnaSolver< VarType >.

Definition at line 56 of file MNASolverDirect.cpp.

◆ switchedMatrixEmpty() [2/2]

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::switchedMatrixEmpty ( std::size_t swIdx,
Int freqIdx )
overrideprotectedvirtual

Sets all entries in the matrix with the given switch index and frequency index to zero.

Implements DPsim::MnaSolver< VarType >.

Definition at line 61 of file MNASolverDirect.cpp.

◆ switchedMatrixStamp() [1/2]

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::switchedMatrixStamp ( std::size_t index,
std::vector< std::shared_ptr< CPS::MNAInterface > > & comp )
overrideprotectedvirtual

Applies a component stamp to the matrix with the given switch index.

Implements DPsim::MnaSolver< VarType >.

Definition at line 67 of file MNASolverDirect.cpp.

◆ switchedMatrixStamp() [2/2]

template<typename VarType>
void DPsim::MnaSolverDirect< VarType >::switchedMatrixStamp ( std::size_t swIdx,
Int freqIdx,
CPS::MNAInterface::List & components,
CPS::MNASwitchInterface::List & switches )
overrideprotectedvirtual

Applies component and switch stamps for one frequency and factorizes it.

Reimplemented from DPsim::MnaSolver< VarType >.

Definition at line 88 of file MNASolverDirect.cpp.

Member Data Documentation

◆ mBaseSystemMatrix

template<typename VarType>
SparseMatrix DPsim::MnaSolverDirect< VarType >::mBaseSystemMatrix
protected

System matrix including all static elements.

Definition at line 104 of file MNASolverDirect.h.

◆ mCompactRightVectorStampCalls

template<typename VarType>
std::size_t DPsim::MnaSolverDirect< VarType >::mCompactRightVectorStampCalls = 0
protected

Definition at line 100 of file MNASolverDirect.h.

◆ mConfigurationInUse

template<typename VarType>
DirectLinearSolverConfiguration DPsim::MnaSolverDirect< VarType >::mConfigurationInUse
protected

LU factorization configuration.

Definition at line 112 of file MNASolverDirect.h.

◆ mDenseRightVectorStampCalls

template<typename VarType>
std::size_t DPsim::MnaSolverDirect< VarType >::mDenseRightVectorStampCalls = 0
protected

Definition at line 99 of file MNASolverDirect.h.

◆ mDirectLinearSolvers

template<typename VarType>
std::unordered_map<std::bitset<SWITCH_NUM>, std::vector<std::shared_ptr<DirectLinearSolver> > > DPsim::MnaSolverDirect< VarType >::mDirectLinearSolvers
protected

Map of direct linear solvers related to the system matrices.

Definition at line 91 of file MNASolverDirect.h.

◆ mDirectLinearSolverVariableSystemMatrix

template<typename VarType>
std::shared_ptr<DirectLinearSolver> DPsim::MnaSolverDirect< VarType >::mDirectLinearSolverVariableSystemMatrix
protected

LU factorization of variable system matrix.

Definition at line 108 of file MNASolverDirect.h.

◆ mImplementationInUse

template<typename VarType>
DirectLinearSolverImpl DPsim::MnaSolverDirect< VarType >::mImplementationInUse
protected

LU factorization indicator.

Definition at line 110 of file MNASolverDirect.h.

◆ mIter

template<typename VarType>
int DPsim::MnaSolverDirect< VarType >::mIter = 0

SynGen Interface

Definition at line 249 of file MNASolverDirect.h.

◆ mProfileMeasurements

template<typename VarType>
std::map<String, ProfileMeasurement> DPsim::MnaSolverDirect< VarType >::mProfileMeasurements
protected

Definition at line 154 of file MNASolverDirect.h.

◆ mRightVectorStampOperations

template<typename VarType>
std::vector<RightVectorStamp> DPsim::MnaSolverDirect< VarType >::mRightVectorStampOperations
protected

Definition at line 98 of file MNASolverDirect.h.

◆ mSwitchedMatrices

template<typename VarType>
std::unordered_map<std::bitset<SWITCH_NUM>, std::vector<SparseMatrix> > DPsim::MnaSolverDirect< VarType >::mSwitchedMatrices
protected

Map of system matrices where the key is the bitset describing the switch states.

Definition at line 87 of file MNASolverDirect.h.

◆ mSystemMatrixChanged

template<typename VarType>
Bool DPsim::MnaSolverDirect< VarType >::mSystemMatrixChanged = false
protected

Tracks active MNA system-matrix changes from the last solve step.

Definition at line 117 of file MNASolverDirect.h.

◆ mVariableComponentChanged

template<typename VarType>
Bool DPsim::MnaSolverDirect< VarType >::mVariableComponentChanged = false
protected

Tracks variable-component changes from the last solve step.

Definition at line 115 of file MNASolverDirect.h.

◆ mVariableSystemMatrix

template<typename VarType>
SparseMatrix DPsim::MnaSolverDirect< VarType >::mVariableSystemMatrix
protected

System matrix including stamp of static and variable elements.

Definition at line 106 of file MNASolverDirect.h.


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