5 #include <dpsim-models/MNASimPowerComp.h>
8 enum class MNA_SUBCOMP_TASK_ORDER {
15 template <
typename VarType>
19 MNAInterface::List mSubcomponentsMNA;
20 MNAInterface::List mSubcomponentsBeforePreStep;
21 MNAInterface::List mSubcomponentsAfterPreStep;
22 MNAInterface::List mSubcomponentsBeforePostStep;
23 MNAInterface::List mSubcomponentsAfterPostStep;
25 std::vector<CPS::Attribute<Matrix>::Ptr> mRightVectorStamps;
29 using Ptr = std::shared_ptr<CompositePowerComp<VarType>>;
30 using List = std::vector<Ptr>;
34 Logger::Level logLevel)
40 Bool hasPostStep =
true,
41 Logger::Level logLevel = Logger::Level::off)
53 MNA_SUBCOMP_TASK_ORDER preStepOrder,
54 MNA_SUBCOMP_TASK_ORDER postStepOrder,
55 Bool contributeToRightVector);
72 AttributeBase::List &prevStepDependencies,
73 AttributeBase::List &attributeDependencies,
74 AttributeBase::List &modifiedAttributes)
override;
78 AttributeBase::List &attributeDependencies,
79 AttributeBase::List &modifiedAttributes,
83 virtual void mnaParentInitialize(Real omega, Real timeStep,
87 virtual void mnaParentApplySystemMatrixStamp(SparseMatrixRow &systemMatrix){
90 virtual void mnaParentApplyRightSideVectorStamp(Matrix &rightVector){
93 virtual void mnaParentPreStep(Real time, Int timeStepCount){
96 virtual void mnaParentPostStep(Real time, Int timeStepCount,
97 Attribute<Matrix>::Ptr &leftVector){
101 mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies,
102 AttributeBase::List &attributeDependencies,
103 AttributeBase::List &modifiedAttributes){
107 mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
108 AttributeBase::List &attributeDependencies,
109 AttributeBase::List &modifiedAttributes,
110 Attribute<Matrix>::Ptr &leftVector){
Base class for composite power components.
void mnaCompInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
Initializes variables of components.
void addMNASubComponent(typename SimPowerComp< VarType >::Ptr subc, MNA_SUBCOMP_TASK_ORDER preStepOrder, MNA_SUBCOMP_TASK_ORDER postStepOrder, Bool contributeToRightVector)
Add a new subcomponent implementing MNA methods.
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
CompositePowerComp(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 mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
Stamps system matrix.
void mnaCompPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override
Stamps right side (source) vector.
virtual ~CompositePowerComp()=default
Destructor - does not do anything.
void mnaCompAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
void mnaCompPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
Basic constructor that takes UID, name and log level.
String uid()
Returns unique id.
Base class for all MNA components that are transmitting power.