12template <
typename VarType>
21 using Ptr = std::shared_ptr<MNASimPowerComp<VarType>>;
22 using List = std::vector<Ptr>;
35 mHasPostStep(hasPostStep),
41 Bool hasPostStep =
true,
109 :
Task(**comp.
mName +
".MnaPreStep"), mComp(comp) {
110 mComp.mnaAddPreStepDependencies(
114 mComp.mnaPreStep(time, timeStepCount);
125 :
Task(**comp.
mName +
".MnaPostStep"), mComp(comp),
126 mLeftVector(leftVector) {
132 mComp.mnaPostStep(time, timeStepCount, mLeftVector);
AttributePointer< Attribute< T > > Ptr
String uid()
Returns unique id.
AttributeList::Ptr mAttributes
Attribute List.
spdlog::level::level_enum Level
Interface to be implemented by all models used by the MNA solver.
MnaPostStep(MNASimPowerComp< VarType > &comp, Attribute< Matrix >::Ptr leftVector)
void execute(Real time, Int timeStepCount) override
void execute(Real time, Int timeStepCount) override
MnaPreStep(MNASimPowerComp< VarType > &comp)
virtual void mnaCompPreStep(Real time, Int timeStepCount)
void mnaAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) final
Add MNA pre step dependencies.
virtual void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector)
virtual void mnaCompInitializeHarm(Real omega, Real timeStep, std::vector< Attribute< Matrix >::Ptr > leftVector)
Attribute< Matrix >::Ptr getRightVector() const final
virtual ~MNASimPowerComp()=default
Destructor - does not do anything.
Task::List mMnaTasks
List of tasks that relate to using MNA for this component (usually pre-step and/or post-step)
void mnaApplyRightSideVectorStampHarm(Matrix &sourceVector) final
Stamps right side (source) vector considering the frequency index.
virtual void mnaCompUpdateVoltage(const Matrix &leftVector)
void mnaApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) final
Stamps system matrix.
virtual void mnaCompAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes)
virtual void mnaCompInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector)
void mnaAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) final
virtual void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix)
void mnaUpdateCurrent(const Matrix &leftVector) final
Update interface current from MNA system result.
void mnaUpdateVoltage(const Matrix &leftVector) final
Update interface voltage from MNA system result.
virtual void mnaCompUpdateCurrent(const Matrix &leftVector)
const Task::List & mnaTasks() const final
Return list of MNA tasks.
void mnaInitialize(Real omega, Real timeStep) final
Initializes variables of components.
virtual void mnaCompApplyRightSideVectorStampHarm(Matrix &sourceVector)
std::shared_ptr< MNASimPowerComp< VarType > > Ptr
MNASimPowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
Basic constructor that takes UID, name and log level.
Attribute< Matrix >::Ptr mRightVector
MNASimPowerComp(String name, Bool hasPreStep=true, Bool hasPostStep=true, Logger::Level logLevel=Logger::Level::off)
Basic constructor that takes name and log level and sets the UID to name as well.
void mnaInitializeHarm(Real omega, Real timeStep, std::vector< Attribute< Matrix >::Ptr > leftVector) final
void mnaPreStep(Real time, Int timeStepCount) final
MNA pre step operations.
void mnaApplySystemMatrixStampHarm(SparseMatrixRow &systemMatrix, Int freqIdx) final
Stamps system matrix considering the frequency index.
virtual void mnaCompApplyRightSideVectorStamp(Matrix &rightVector)
void mnaApplyRightSideVectorStamp(Matrix &rightVector) final
Stamps right side (source) vector.
virtual void mnaCompPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector)
void mnaPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) final
virtual void mnaCompApplySystemMatrixStampHarm(SparseMatrixRow &systemMatrix, Int freqIdx)
SimPowerComp(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Basic constructor that takes UID, name and log level.
Tasks to be defined by every component.
std::vector< AttributeBase::Ptr > mModifiedAttributes
std::vector< AttributeBase::Ptr > mPrevStepDependencies
std::vector< AttributeBase::Ptr > mAttributeDependencies
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
Eigen::SparseMatrix< Real, Eigen::RowMajor > SparseMatrixRow
Sparse matrix for real numbers (row major).