diff --git a/.github/workflows/build_test_linux_rocky.yaml b/.github/workflows/build_test_linux_rocky.yaml index 57992b9ec8..3e6f6fa0d1 100644 --- a/.github/workflows/build_test_linux_rocky.yaml +++ b/.github/workflows/build_test_linux_rocky.yaml @@ -37,6 +37,37 @@ jobs: path: ${{ github.workspace }}/build key: build-cache-rocky-${{ github.sha }} + linux-rocky-clang: + name: Build on Rocky Linux using Clang + runs-on: ubuntu-latest + container: sogno/dpsim:dev-rocky + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Create Build Environment + run: mkdir build + + - name: Configure CMake + shell: bash + working-directory: ${{ github.workspace }}/build + run: cmake $GITHUB_WORKSPACE -DFETCH_SPDLOG=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DWITH_PYBIND=OFF + + - name: Build every target + shell: bash + working-directory: ${{ github.workspace }}/build + run: cmake --build . + env: + MAKEFLAGS: "-j2" + + - name: Cache build directory + uses: actions/cache@v3 + with: + path: ${{ github.workspace }}/build + key: build-cache-rocky-${{ github.sha }} + profiling: name: Build with Profiling options runs-on: ubuntu-latest diff --git a/dpsim-models/include/dpsim-models/Attribute.h b/dpsim-models/include/dpsim-models/Attribute.h index 1f9c143f68..59dc91f478 100644 --- a/dpsim-models/include/dpsim-models/Attribute.h +++ b/dpsim-models/include/dpsim-models/Attribute.h @@ -555,7 +555,7 @@ class AttributeStatic : public Attribute, throw TypeException(); } - virtual std::shared_ptr asRawPointer() { return this->mData; } + virtual std::shared_ptr asRawPointer() override { return this->mData; } virtual void appendDependencies(AttributeBase::Set *deps) override { deps->insert(this->shared_from_this()); @@ -649,7 +649,7 @@ class AttributeDynamic : public Attribute, } } - virtual std::shared_ptr asRawPointer() { + virtual std::shared_ptr asRawPointer() override { for (typename AttributeUpdateTaskBase::Ptr task : updateTasksOnGet) { task->executeUpdate(this->mData); } diff --git a/dpsim-models/include/dpsim-models/Base/Base_ReducedOrderSynchronGenerator.h b/dpsim-models/include/dpsim-models/Base/Base_ReducedOrderSynchronGenerator.h index ae74eae362..87d63bb908 100644 --- a/dpsim-models/include/dpsim-models/Base/Base_ReducedOrderSynchronGenerator.h +++ b/dpsim-models/include/dpsim-models/Base/Base_ReducedOrderSynchronGenerator.h @@ -99,8 +99,6 @@ class ReducedOrderSynchronGenerator : public MNASimPowerComp { protected: using MNASimPowerComp::mRightVector; using MNASimPowerComp::mIntfVoltage; - using MNASimPowerComp::MnaPreStep; - using MNASimPowerComp::MnaPostStep; /// ReducedOrderSynchronGenerator(String uid, String name, @@ -112,7 +110,7 @@ class ReducedOrderSynchronGenerator : public MNASimPowerComp { /// virtual void initializeResistanceMatrix() = 0; /// - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Function to initialize the specific variables of each SG model virtual void specificInitialization() = 0; /// Model specific step @@ -138,7 +136,8 @@ class ReducedOrderSynchronGenerator : public MNASimPowerComp { Attribute::Ptr &leftVector) final; virtual void mnaCompPostStep(const Matrix &leftVector) = 0; /// Stamps system matrix - virtual void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) = 0; + virtual void + mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override = 0; /// Model flag indicating whether the machine is modelled as Norton or Thevenin equivalent Bool mModelAsNortonSource; // Model flag indicating the SG order to be used diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_AvVoltageSourceInverterDQ.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_AvVoltageSourceInverterDQ.h index 6d57643f63..035d630faa 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_AvVoltageSourceInverterDQ.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_AvVoltageSourceInverterDQ.h @@ -108,7 +108,7 @@ class AvVoltageSourceInverterDQ // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Setter for general parameters of inverter void setParameters(Real sysOmega, Real sysVoltNom, Real Pref, Real Qref); /// Setter for parameters of control loops diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_Capacitor.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_Capacitor.h index 4ccd8d6d90..d98fff531d 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_Capacitor.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_Capacitor.h @@ -40,13 +40,13 @@ class Capacitor : public MNASimPowerComp, Capacitor(String name, Logger::Level logLevel = Logger::Level::off) : Capacitor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// - void initialize(Matrix frequencies); + void initialize(Matrix frequencies) override; // #### MNA section #### /// Initializes internal variables of the component @@ -56,9 +56,9 @@ class Capacitor : public MNASimPowerComp, Real omega, Real timeStep, std::vector::Ptr> leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; void mnaCompApplySystemMatrixStampHarm(SparseMatrixRow &systemMatrix, - Int freqIdx); + Int freqIdx) override; /// Stamps right side (source) vector void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; void mnaCompApplyRightSideVectorStampHarm(Matrix &rightVector) override; diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_CurrentSource.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_CurrentSource.h index a6d1bf11d5..97110c6e72 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_CurrentSource.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_CurrentSource.h @@ -37,22 +37,22 @@ class CurrentSource : public MNASimPowerComp, void setParameters(Complex current); - SimPowerComp::Ptr clone(String copySuffix); + SimPowerComp::Ptr clone(String copySuffix) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) {} + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override {} /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Add MNA pre step dependencies void mnaCompAddPreStepDependencies( diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_Inductor.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_Inductor.h index 9b21c3f52b..131a56b1b7 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_Inductor.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_Inductor.h @@ -46,11 +46,11 @@ class Inductor : public MNASimPowerComp, // #### General #### /// Return new instance with the same parameters - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; /// Initializes state variables considering the number of frequencies - void initialize(Matrix frequencies); + void initialize(Matrix frequencies) override; /// Initializes states from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes MNA specific variables @@ -60,9 +60,9 @@ class Inductor : public MNASimPowerComp, Real omega, Real timeStep, std::vector::Ptr> leftVectors) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; void mnaCompApplySystemMatrixStampHarm(SparseMatrixRow &systemMatrix, - Int freqIdx); + Int freqIdx) override; /// Stamps right side (source) vector void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; void mnaCompApplyRightSideVectorStampHarm(Matrix &rightVector) override; @@ -90,10 +90,10 @@ class Inductor : public MNASimPowerComp, Attribute::Ptr &leftVector) override; // #### Tearing methods #### - void mnaTearInitialize(Real omega, Real timestep); - void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix); - void mnaTearApplyVoltageStamp(Matrix &voltageVector); - void mnaTearPostStep(Complex voltage, Complex current); + void mnaTearInitialize(Real omega, Real timestep) override; + void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix) override; + void mnaTearApplyVoltageStamp(Matrix &voltageVector) override; + void mnaTearPostStep(Complex voltage, Complex current) override; class MnaPreStepHarm : public Task { public: diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_Inverter.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_Inverter.h index 3865238480..60bebf6e3e 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_Inverter.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_Inverter.h @@ -95,9 +95,9 @@ class Inverter : public MNASimPowerComp, // #### General #### /// - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// - void initialize(Matrix frequencies); + void initialize(Matrix frequencies) override; /// void setParameters(const std::vector &carrierHarms, const std::vector &modulHarms, Real inputVoltage, @@ -108,17 +108,19 @@ class Inverter : public MNASimPowerComp, // #### MNA Functions #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); - void mnaCompInitializeHarm(Real omega, Real timeStep, - std::vector::Ptr> leftVectors); + Attribute::Ptr leftVector) override; + void mnaCompInitializeHarm( + Real omega, Real timeStep, + std::vector::Ptr> leftVectors) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; void mnaCompApplySystemMatrixStampHarm(SparseMatrixRow &systemMatrix, - Int freqIdx); + Int freqIdx) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); - void mnaCompApplyRightSideVectorStampHarm(Matrix &rightVector); - void mnaCompApplyRightSideVectorStampHarm(Matrix &sourceVector, Int freqIdx); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; + void mnaCompApplyRightSideVectorStampHarm(Matrix &rightVector) override; + void mnaCompApplyRightSideVectorStampHarm(Matrix &sourceVector, + Int freqIdx) override; /// Add MNA pre step dependencies void mnaCompAddPreStepDependencies( AttributeBase::List &prevStepDependencies, diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_NetworkInjection.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_NetworkInjection.h index 5cb28fd059..93062ebfa5 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_NetworkInjection.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_NetworkInjection.h @@ -49,11 +49,11 @@ class NetworkInjection : public CompositePowerComp, NetworkInjection(String name, Complex voltage, Logger::Level logLevel = Logger::Level::off); /// - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Setter for reference voltage and frequency with a sine wave generator /// This will initialize the values of mVoltageRef and mSrcFreq to match the given parameters /// However, the attributes can be modified during the simulation to dynamically change the magnitude, frequency, and phase of the sine wave. @@ -97,9 +97,9 @@ class NetworkInjection : public CompositePowerComp, // #### DAE Section #### /// Residual function for DAE Solver void daeResidual(double ttime, const double state[], const double dstate_dt[], - double resid[], std::vector &off); + double resid[], std::vector &off) override; ///Voltage Getter - Complex daeInitialize(); + Complex daeInitialize() override; }; } // namespace Ph1 } // namespace DP diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_PQLoadCS.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_PQLoadCS.h index 313d81c89f..9590edf438 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_PQLoadCS.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_PQLoadCS.h @@ -44,11 +44,11 @@ class PQLoadCS : public CompositePowerComp, Real nomVolt, Logger::Level logLevel = Logger::Level::off); void setParameters(Real activePower, Real reactivePower, Real nomVolt); - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// MNA pre and post step operations diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_PiLine.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_PiLine.h index fdc8b4ba23..ab6e0cbb57 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_PiLine.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_PiLine.h @@ -49,17 +49,17 @@ class PiLine : public CompositePowerComp, PiLine(String name, Logger::Level logLevel = Logger::Level::off) : PiLine(name, name, logLevel) {} - SimPowerComp::Ptr clone(String copySuffix); + SimPowerComp::Ptr clone(String copySuffix) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Updates internal current variable of the component - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; /// Updates internal voltage variable of the component - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// MNA pre and post step operations void mnaParentPreStep(Real time, Int timeStepCount) override; void mnaParentPostStep(Real time, Int timeStepCount, @@ -75,11 +75,11 @@ class PiLine : public CompositePowerComp, AttributeBase::List &modifiedAttributes, Attribute::Ptr &leftVector) override; - MNAInterface::List mnaTearGroundComponents(); - void mnaTearInitialize(Real omega, Real timeStep); - void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix); - void mnaTearApplyVoltageStamp(Matrix &voltageVector); - void mnaTearPostStep(Complex voltage, Complex current); + MNAInterface::List mnaTearGroundComponents() override; + void mnaTearInitialize(Real omega, Real timeStep) override; + void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix) override; + void mnaTearApplyVoltageStamp(Matrix &voltageVector) override; + void mnaTearPostStep(Complex voltage, Complex current) override; }; } // namespace Ph1 } // namespace DP diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_RXLoad.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_RXLoad.h index c4c59e864e..b9b86f553a 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_RXLoad.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_RXLoad.h @@ -53,7 +53,7 @@ class RXLoad : public CompositePowerComp, // #### General #### /// Initialize component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Set model specific parameters void setParameters(Real activePower, Real ReactivePower, Real volt); diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_RXLoadSwitch.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_RXLoadSwitch.h index 9424df77e8..4663d01e21 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_RXLoadSwitch.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_RXLoadSwitch.h @@ -37,7 +37,7 @@ class RXLoadSwitch : public CompositePowerComp, // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Sets model specific parameters void setParameters(Real activePower, Real reactivePower, Real nomVolt, Real openResistance, Real closedResistance, diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_RxLine.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_RxLine.h index c948952043..44c0e9aedb 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_RxLine.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_RxLine.h @@ -36,11 +36,11 @@ class RxLine : public CompositePowerComp, RxLine(String name, Logger::Level logLevel = Logger::Level::off) : RxLine(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### void mnaCompUpdateVoltage(const Matrix &leftVector) override; diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator4OrderPCM.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator4OrderPCM.h index fbfba1dd6d..c2b55449bc 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator4OrderPCM.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator4OrderPCM.h @@ -31,7 +31,7 @@ class SynchronGenerator4OrderPCM SynchronGenerator4OrderPCM(const String &name, Logger::Level logLevel = Logger::Level::off); /// - SimPowerComp::Ptr clone(const String &name); + SimPowerComp::Ptr clone(String name) override; // #### General Functions #### /// diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator4OrderTPM.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator4OrderTPM.h index 46ec595afd..9c2ae159ba 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator4OrderTPM.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator4OrderTPM.h @@ -73,7 +73,7 @@ class SynchronGenerator4OrderTPM SynchronGenerator4OrderTPM(String name, Logger::Level logLevel = Logger::Level::off); /// - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General Functions #### /// Initializes component from power flow data diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator6OrderPCM.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator6OrderPCM.h index cb2a55d1ed..83c7c2ea52 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator6OrderPCM.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGenerator6OrderPCM.h @@ -29,7 +29,7 @@ class SynchronGenerator6OrderPCM SynchronGenerator6OrderPCM(const String &name, Logger::Level logLevel = Logger::Level::off); /// - SimPowerComp::Ptr clone(const String &name); + SimPowerComp::Ptr clone(String name) override; // #### General Functions #### /// diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGeneratorIdeal.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGeneratorIdeal.h index 588c03606a..743f770de8 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGeneratorIdeal.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGeneratorIdeal.h @@ -33,11 +33,11 @@ class SynchronGeneratorIdeal : public CompositePowerComp, SynchronGeneratorIdeal(String name, Logger::Level logLevel = Logger::Level::off); - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// MNA pre step operations diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGeneratorTrStab.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGeneratorTrStab.h index a9545e29e2..5df5cd1ebf 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGeneratorTrStab.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_SynchronGeneratorTrStab.h @@ -68,7 +68,7 @@ class SynchronGeneratorTrStab : public CompositePowerComp, Logger::Level logLevel = Logger::Level::off) : SynchronGeneratorTrStab(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General Functions #### /// Flags to modify model behavior @@ -89,7 +89,7 @@ class SynchronGeneratorTrStab : public CompositePowerComp, /// void step(Real time); /// - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA Functions #### /// Initializes variables of component diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_Transformer.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_Transformer.h index 425054e8ef..a9d40555c9 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_Transformer.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_Transformer.h @@ -58,7 +58,7 @@ class Transformer : public CompositePowerComp, Transformer(String name, Logger::Level logLevel = Logger::Level::off) : Transformer(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Defines component parameters @@ -69,7 +69,7 @@ class Transformer : public CompositePowerComp, Real ratioAbs, Real ratioPhase, Real resistance, Real inductance); /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSource.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSource.h index 95fafc5cb5..84f3dc204e 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSource.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSource.h @@ -59,11 +59,11 @@ class VoltageSource : public MNASimPowerComp, VoltageSource(String name, Complex voltage, Logger::Level logLevel = Logger::Level::off); /// - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// void setSourceValue(Complex voltage); /// Setter for reference voltage and frequency with a sine wave generator @@ -148,9 +148,9 @@ class VoltageSource : public MNASimPowerComp, // #### DAE Section #### /// Residual function for DAE Solver void daeResidual(double ttime, const double state[], const double dstate_dt[], - double resid[], std::vector &off); + double resid[], std::vector &off) override; ///Voltage Getter - Complex daeInitialize(); + Complex daeInitialize() override; }; } // namespace Ph1 } // namespace DP diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSourceNorton.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSourceNorton.h index 7260e0f0bb..edff3d9358 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSourceNorton.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSourceNorton.h @@ -45,11 +45,11 @@ class VoltageSourceNorton : public MNASimPowerComp, VoltageSourceNorton(String name, Logger::Level logLevel = Logger::Level::off) : VoltageSourceNorton(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// void setVoltageRef(Complex voltage) const; /// @@ -61,15 +61,15 @@ class VoltageSourceNorton : public MNASimPowerComp, // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompAddPreStepDependencies( AttributeBase::List &prevStepDependencies, diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSourceRamp.h b/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSourceRamp.h index 3c4f290ae4..3977bec150 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSourceRamp.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph1_VoltageSourceRamp.h @@ -43,16 +43,16 @@ class VoltageSourceRamp : public CompositePowerComp, VoltageSourceRamp(String name, Logger::Level logLevel = Logger::Level::off) : VoltageSourceRamp(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// void setParameters(Complex voltage, Complex addVoltage, Real srcFreq, Real addSrcFreq, Real switchTime, Real rampTime); /// - void initialize(Matrix frequencies); + void initialize(Matrix frequencies) override; // #### MNA section #### void mnaParentPreStep(Real time, Int timeStepCount) override; diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph3_Capacitor.h b/dpsim-models/include/dpsim-models/DP/DP_Ph3_Capacitor.h index 503e5c4453..b447d70477 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph3_Capacitor.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph3_Capacitor.h @@ -43,23 +43,23 @@ class Capacitor : public MNASimPowerComp, Capacitor(String name, Logger::Level logLevel = Logger::Level::off) : Capacitor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPreStep(Real time, Int timeStepCount) override; void mnaCompPostStep(Real time, Int timeStepCount, diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph3_Inductor.h b/dpsim-models/include/dpsim-models/DP/DP_Ph3_Inductor.h index f3586d2fe9..3634e722df 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph3_Inductor.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph3_Inductor.h @@ -47,23 +47,23 @@ class Inductor : public MNASimPowerComp, Inductor(String name, Real inductance, Logger::Level logLevel = Logger::Level::off); - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPreStep(Real time, Int timeStepCount) override; void mnaCompPostStep(Real time, Int timeStepCount, Attribute::Ptr &leftVector) override; @@ -80,10 +80,10 @@ class Inductor : public MNASimPowerComp, AttributeBase::List &modifiedAttributes, Attribute::Ptr &leftVector) override; - void mnaTearInitialize(Real omega, Real timestep); - void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix); - void mnaTearApplyVoltageStamp(Matrix &voltageVector); - void mnaTearPostStep(Complex voltage, Complex current); + void mnaTearInitialize(Real omega, Real timestep) override; + void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix) override; + void mnaTearApplyVoltageStamp(Matrix &voltageVector) override; + void mnaTearPostStep(Complex voltage, Complex current) override; }; } // namespace Ph3 } // namespace DP diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph3_Resistor.h b/dpsim-models/include/dpsim-models/DP/DP_Ph3_Resistor.h index 1d7420810e..bd7479e75b 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph3_Resistor.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph3_Resistor.h @@ -30,21 +30,21 @@ class Resistor : public MNASimPowerComp, Resistor(String name, Logger::Level logLevel = Logger::Level::off) : Resistor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; /// Add MNA post step dependencies void diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph3_SeriesResistor.h b/dpsim-models/include/dpsim-models/DP/DP_Ph3_SeriesResistor.h index 4c784d118a..80bef9578b 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph3_SeriesResistor.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph3_SeriesResistor.h @@ -30,21 +30,21 @@ class SeriesResistor : public MNASimPowerComp, SeriesResistor(String name, Logger::Level logLevel = Logger::Level::off) : SeriesResistor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; /// Add MNA post step dependencies void diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph3_SeriesSwitch.h b/dpsim-models/include/dpsim-models/DP/DP_Ph3_SeriesSwitch.h index a1a35d361c..7bdbe2b30b 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph3_SeriesSwitch.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph3_SeriesSwitch.h @@ -39,26 +39,26 @@ class SeriesSwitch : public MNASimPowerComp, // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### General MNA section #### /// void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; // #### MNA section for switches #### /// Check if switch is closed - Bool mnaIsClosed(); + Bool mnaIsClosed() override; /// Stamps system matrix considering the defined switch position void mnaCompApplySwitchSystemMatrixStamp(Bool closed, SparseMatrixRow &systemMatrix, - Int freqIdx); + Int freqIdx) override; /// Add MNA post step dependencies void diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph3_SynchronGeneratorDQ.h b/dpsim-models/include/dpsim-models/DP/DP_Ph3_SynchronGeneratorDQ.h index b3f12707ed..5c58b087fd 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph3_SynchronGeneratorDQ.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph3_SynchronGeneratorDQ.h @@ -61,7 +61,7 @@ class SynchronGeneratorDQ : public MNASimPowerComp, /// Function parameters have to be given in Real units. void initialize(Real omega, Real timeStep); /// - void initialize(Matrix frequencies); + void initialize(Matrix frequencies) override; /// Real electricalTorque() const; /// @@ -74,18 +74,18 @@ class SynchronGeneratorDQ : public MNASimPowerComp, // #### MNA Functions #### /// Initializes variables of component virtual void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr) = 0; + Attribute::Ptr) override = 0; /// Performs with the model of a synchronous generator /// to calculate the flux and current from the voltage vector. void mnaStep(Matrix &systemMatrix, Matrix &rightVector, Matrix &leftVector, Real time); /// - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Retrieves calculated voltage from simulation for next step - virtual void mnaCompUpdateVoltage(const Matrix &leftVector); + virtual void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Add MNA post step dependencies void diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph3_SynchronGeneratorDQTrapez.h b/dpsim-models/include/dpsim-models/DP/DP_Ph3_SynchronGeneratorDQTrapez.h index 8a180e3ceb..ffdfcb563b 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph3_SynchronGeneratorDQTrapez.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph3_SynchronGeneratorDQTrapez.h @@ -26,7 +26,7 @@ class SynchronGeneratorDQTrapez // #### MNA Section #### void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Add MNA pre step dependencies void mnaCompAddPreStepDependencies( diff --git a/dpsim-models/include/dpsim-models/DP/DP_Ph3_VoltageSource.h b/dpsim-models/include/dpsim-models/DP/DP_Ph3_VoltageSource.h index 6d8581af36..bbed617a2b 100644 --- a/dpsim-models/include/dpsim-models/DP/DP_Ph3_VoltageSource.h +++ b/dpsim-models/include/dpsim-models/DP/DP_Ph3_VoltageSource.h @@ -41,25 +41,25 @@ class VoltageSource : public MNASimPowerComp, VoltageSource(String name, Complex voltage, Logger::Level logLevel = Logger::Level::off); - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; void setParameters(Complex voltageRef); // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// void setSourceValue(Complex voltage); // #### MNA Section #### /// void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Returns current through the component - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPreStep(Real time, Int timeStepCount) override; void mnaCompPostStep(Real time, Int timeStepCount, @@ -81,9 +81,9 @@ class VoltageSource : public MNASimPowerComp, // #### DAE Section #### /// Residual function for DAE Solver void daeResidual(double ttime, const double state[], const double dstate_dt[], - double resid[], std::vector &off); + double resid[], std::vector &off) override; ///Voltage Getter - Complex daeInitialize(); + Complex daeInitialize() override; }; } // namespace Ph3 } // namespace DP diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Capacitor.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Capacitor.h index 8327ae58b1..51bb01bf5c 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Capacitor.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Capacitor.h @@ -39,24 +39,24 @@ class Capacitor : public MNASimPowerComp, Capacitor(String name, Logger::Level logLevel = Logger::Level::off) : Capacitor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPreStep(Real time, Int timeStepCount) override; void mnaCompPostStep(Real time, Int timeStepCount, diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_CurrentSource.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_CurrentSource.h index 52c4dce109..705a582296 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_CurrentSource.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_CurrentSource.h @@ -32,23 +32,23 @@ class CurrentSource : public MNASimPowerComp, CurrentSource(String name, Logger::Level logLevel = Logger::Level::off) : CurrentSource(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; void setParameters(Complex currentRef, Real srcFreq = -1); // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency) {} + void initializeFromNodesAndTerminals(Real frequency) override {} // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) {} + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override {} /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; void updateState(Real time); diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Inductor.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Inductor.h index d2e75de62a..d87769454c 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Inductor.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Inductor.h @@ -39,24 +39,24 @@ class Inductor : public MNASimPowerComp, Inductor(String name, Logger::Level logLevel = Logger::Level::off) : Inductor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPreStep(Real time, Int timeStepCount) override; void mnaCompPostStep(Real time, Int timeStepCount, diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Resistor.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Resistor.h index d71802ebff..bb7f2947ab 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Resistor.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_Resistor.h @@ -30,24 +30,24 @@ class Resistor : public MNASimPowerComp, Resistor(String name, Logger::Level logLevel = Logger::Level::off) : Resistor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftSideVector); + Attribute::Ptr leftSideVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) {} + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override {} /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPostStep(Real time, Int timeStepCount, Attribute::Ptr &leftVector) override; /// Add MNA post step dependencies diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSource.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSource.h index 009a3d7ed7..c687af334d 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSource.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSource.h @@ -42,21 +42,21 @@ class VoltageSource : public MNASimPowerComp, void setParameters(Complex voltageRef, Real srcFreq = -1); - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency) {} + void initializeFromNodesAndTerminals(Real frequency) override {} // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Returns current through the component - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPreStep(Real time, Int timeStepCount) override; void mnaCompPostStep(Real time, Int timeStepCount, diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSourceNorton.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSourceNorton.h index 9be3647574..d24ecc1ad6 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSourceNorton.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSourceNorton.h @@ -39,11 +39,11 @@ class VoltageSourceNorton : public MNASimPowerComp, VoltageSourceNorton(String name, Logger::Level logLevel = Logger::Level::off) : VoltageSourceNorton(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency) {} + void initializeFromNodesAndTerminals(Real frequency) override {} /// void setParameters(Complex voltage, Real srcFreq, Real resistance); /// @@ -52,15 +52,15 @@ class VoltageSourceNorton : public MNASimPowerComp, // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPreStep(Real time, Int timeStepCount) override; void mnaCompPostStep(Real time, Int timeStepCount, diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSourceRamp.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSourceRamp.h index a7ac809e55..51f6b55367 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSourceRamp.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph1_VoltageSourceRamp.h @@ -41,16 +41,16 @@ class VoltageSourceRamp : public CompositePowerComp, VoltageSourceRamp(String name, Logger::Level logLevel = Logger::Level::off) : VoltageSourceRamp(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency) {} + void initializeFromNodesAndTerminals(Real frequency) override {} /// void setParameters(Complex voltage, Complex addVoltage, Real srcFreq, Real addSrcFreq, Real switchTime, Real rampTime); /// - void initialize(Matrix frequencies); + void initialize(Matrix frequencies) override; // #### MNA section #### void mnaParentPreStep(Real time, Int timeStepCount) override; diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_AvVoltSourceInverterStateSpace.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_AvVoltSourceInverterStateSpace.h index bb609ecfd9..5fd7dd2572 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_AvVoltSourceInverterStateSpace.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_AvVoltSourceInverterStateSpace.h @@ -143,15 +143,15 @@ class AvVoltSourceInverterStateSpace // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Returns current through the component - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; /// update equivalent current of the equivalent source void updateEquivCurrent(Real time); diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_AvVoltageSourceInverterDQ.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_AvVoltageSourceInverterDQ.h index 6c9072289a..e4cd48d3ba 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_AvVoltageSourceInverterDQ.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_AvVoltageSourceInverterDQ.h @@ -111,7 +111,7 @@ class AvVoltageSourceInverterDQ // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Setter for gengit eral parameters of inverter void setParameters(Real sysOmega, Real sysVoltNom, Real Pref, Real Qref); /// Setter for parameters of control loops diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Capacitor.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Capacitor.h index 687d8678f5..895ec9c6d4 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Capacitor.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Capacitor.h @@ -39,11 +39,11 @@ class Capacitor : public MNASimPowerComp, Capacitor(String name, Logger::Level logLevel = Logger::Level::off) : Capacitor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_CurrentSource.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_CurrentSource.h index 100ffb0f1d..58a439c987 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_CurrentSource.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_CurrentSource.h @@ -43,10 +43,10 @@ class CurrentSource : public MNASimPowerComp, CurrentSource(String name, Logger::Level logLevel = Logger::Level::off) : CurrentSource(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Setter for reference voltage void setParameters(MatrixComp voltageRef, Real srcFreq = 50.0); /// Setter for reference signal of type frequency ramp diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Inductor.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Inductor.h index f5ed4e83cc..04f50a0214 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Inductor.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Inductor.h @@ -39,11 +39,11 @@ class Inductor : public MNASimPowerComp, Inductor(String name, Logger::Level logLevel = Logger::Level::off) : Inductor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_NetworkInjection.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_NetworkInjection.h index a4f2f796d7..bf31bb9398 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_NetworkInjection.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_NetworkInjection.h @@ -43,11 +43,11 @@ class NetworkInjection : public CompositePowerComp, NetworkInjection(String name, Complex voltage, Logger::Level logLevel = Logger::Level::off); /// - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Setter for reference voltage parameters void setParameters(MatrixComp voltageRef, Real srcFreq = 50.0); /// Setter for reference signal of type frequency ramp diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_PiLine.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_PiLine.h index 3a21d4588b..588c3a91c2 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_PiLine.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_PiLine.h @@ -48,11 +48,11 @@ class PiLine : public CompositePowerComp, PiLine(String name, Logger::Level logLevel = Logger::Level::off) : PiLine(name, name, logLevel) {} - SimPowerComp::Ptr clone(String copySuffix); + SimPowerComp::Ptr clone(String copySuffix) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Updates internal current variable of the component diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_RXLoad.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_RXLoad.h index 8ca4c3d492..e128c9d794 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_RXLoad.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_RXLoad.h @@ -60,7 +60,7 @@ class RXLoad : public CompositePowerComp, public SharedFactory { /// void setParameters(Matrix activePower, Matrix reactivePower, Real volt); /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### void mnaCompUpdateCurrent(const Matrix &leftVector) override; diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_ReducedOrderSynchronGeneratorVBR.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_ReducedOrderSynchronGeneratorVBR.h index 01c9fb01e3..d1d4d4b849 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_ReducedOrderSynchronGeneratorVBR.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_ReducedOrderSynchronGeneratorVBR.h @@ -44,7 +44,7 @@ class ReducedOrderSynchronGeneratorVBR // #### General Functions #### /// Specific component initialization - virtual void specificInitialization() = 0; + virtual void specificInitialization() override = 0; /// void initializeResistanceMatrix() override; /// diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_RxLine.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_RxLine.h index 9254a822e9..e717fba65a 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_RxLine.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_RxLine.h @@ -36,11 +36,11 @@ class RxLine : public CompositePowerComp, RxLine(String name, Logger::Level logLevel = Logger::Level::off) : RxLine(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### void mnaCompUpdateVoltage(const Matrix &leftVector) override; diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SeriesResistor.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SeriesResistor.h index 1981c71c35..62de9c8e7b 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SeriesResistor.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SeriesResistor.h @@ -33,20 +33,20 @@ class SeriesResistor : public MNASimPowerComp, // #### General #### /// Return new instance with the same parameters - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; /// Initializes states from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes MNA specific variables void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Update interface voltage from MNA system results - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface voltage from MNA system results - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPostStep(Real time, Int timeStepCount, Attribute::Ptr &leftVector) override; diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SeriesSwitch.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SeriesSwitch.h index ca6faed898..8111aea776 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SeriesSwitch.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SeriesSwitch.h @@ -37,28 +37,28 @@ class SeriesSwitch : public MNASimPowerComp, // #### General #### /// Return new instance with the same parameters - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; /// Initializes states from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### General MNA section #### /// Initializes MNA specific variables void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Update interface voltage from MNA system results - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface voltage from MNA system results - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; // #### Switch specific MNA section #### /// Check if switch is closed - Bool mnaIsClosed(); + Bool mnaIsClosed() override; /// Stamps system matrix considering the defined switch position void mnaCompApplySwitchSystemMatrixStamp(Bool closed, SparseMatrixRow &systemMatrix, - Int freqIdx); + Int freqIdx) override; void mnaCompPostStep(Real time, Int timeStepCount, Attribute::Ptr &leftVector) override; diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Switch.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Switch.h index 2122ed766b..9dc44c0d08 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Switch.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Switch.h @@ -34,23 +34,23 @@ class Switch : public MNASimPowerComp, Switch(String name, Logger::Level logLevel = Logger::Level::off) : Switch(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### General MNA section #### void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; // #### MNA section for switches #### /// Check if switch is closed @@ -58,7 +58,7 @@ class Switch : public MNASimPowerComp, /// Stamps system matrix considering the defined switch position void mnaCompApplySwitchSystemMatrixStamp(Bool closed, SparseMatrixRow &systemMatrix, - Int freqIdx); + Int freqIdx) override; void mnaCompPostStep(Real time, Int timeStepCount, Attribute::Ptr &leftVector) override; diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorDQ.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorDQ.h index 870ca2d598..3b58467e84 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorDQ.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorDQ.h @@ -74,12 +74,12 @@ class SynchronGeneratorDQ : public MNASimPowerComp, void applyParametersOperationalPerUnit(); /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Initializes internal states and matrix void initializeMatrixAndStates(); /// - void initialize(Matrix frequencies); + void initialize(Matrix frequencies) override; /// Real electricalTorque() const; /// @@ -93,14 +93,14 @@ class SynchronGeneratorDQ : public MNASimPowerComp, // #### MNA Functions #### /// Initializes variables of component virtual void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr) = 0; + Attribute::Ptr) override = 0; /// - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Retrieves calculated voltage from simulation for next step - virtual void mnaCompUpdateVoltage(const Matrix &leftVector); + virtual void mnaCompUpdateVoltage(const Matrix &leftVector) override; void mnaCompPostStep(Real time, Int timeStepCount, Attribute::Ptr &leftVector) override; diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorDQTrapez.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorDQTrapez.h index 590ebfb2ee..e2e2f580c3 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorDQTrapez.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorDQTrapez.h @@ -24,7 +24,7 @@ class SynchronGeneratorDQTrapez // #### MNA Section #### void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; void mnaCompPreStep(Real time, Int timeStepCount) override; /// Add MNA pre step dependencies diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorIdeal.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorIdeal.h index a4e5715ead..009c59a0bd 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorIdeal.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorIdeal.h @@ -39,11 +39,11 @@ class SynchronGeneratorIdeal : public CompositePowerComp, SynchronGeneratorIdeal(String name, Logger::Level logLevel = Logger::Level::off); - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// MNA pre step operations diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorTrStab.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorTrStab.h index be8380a784..0c31fbe198 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorTrStab.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorTrStab.h @@ -66,7 +66,7 @@ class SynchronGeneratorTrStab : public CompositePowerComp, Logger::Level logLevel = Logger::Level::off) : SynchronGeneratorTrStab(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; /// Matrix parkTransformPowerInvariant(Real theta, const Matrix &fabc); @@ -90,7 +90,7 @@ class SynchronGeneratorTrStab : public CompositePowerComp, /// void step(Real time); /// - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA Functions #### /// Initializes variables of component diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorVBR.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorVBR.h index a0738fa2bd..230f30d358 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorVBR.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_SynchronGeneratorVBR.h @@ -223,7 +223,7 @@ class SynchronGeneratorVBR : public MNASimPowerComp, void initialize(Matrix frequencies) override; /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Initializes states in per unit or stator referred variables depending on the setting of the state type. /// Function parameters have to be given in real units. @@ -231,7 +231,7 @@ class SynchronGeneratorVBR : public MNASimPowerComp, /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Performs an Euler forward step with the state space model of a synchronous generator /// to calculate the flux and current from the voltage vector in per unit. @@ -258,24 +258,25 @@ class SynchronGeneratorVBR : public MNASimPowerComp, // #### MNA section #### /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// MNA pre step operations - void mnaCompPreStep(Real time, Int timeStepCount); + void mnaCompPreStep(Real time, Int timeStepCount) override; /// MNA post step operations void mnaCompPostStep(Real time, Int timeStepCount, - Attribute::Ptr &leftVector); + Attribute::Ptr &leftVector) override; /// Add MNA pre step dependencies - void mnaCompAddPreStepDependencies(AttributeBase::List &prevStepDependencies, - AttributeBase::List &attributeDependencies, - AttributeBase::List &modifiedAttributes); + void mnaCompAddPreStepDependencies( + AttributeBase::List &prevStepDependencies, + AttributeBase::List &attributeDependencies, + AttributeBase::List &modifiedAttributes) override; /// Add MNA post step dependencies void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, - Attribute::Ptr &leftVector); + Attribute::Ptr &leftVector) override; /// Mark that parameter changes so that system matrix is updated Bool hasParameterChanged() override { return true; } }; diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Transformer.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Transformer.h index 43ab7bc286..7a8c317706 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Transformer.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_Transformer.h @@ -58,7 +58,7 @@ class Transformer : public CompositePowerComp, Transformer(String name, Logger::Level logLevel = Logger::Level::off) : Transformer(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Defines component parameters @@ -66,7 +66,7 @@ class Transformer : public CompositePowerComp, Real ratioAbs, Real ratioPhase, Matrix resistance, Matrix inductance); /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_VoltageSource.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_VoltageSource.h index 91a385adc2..16b31aa853 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_VoltageSource.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_VoltageSource.h @@ -48,10 +48,10 @@ class VoltageSource : public MNASimPowerComp, VoltageSource(String name, Logger::Level logLevel = Logger::Level::off) : VoltageSource(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Setter for reference voltage and frequency with a sine wave generator void setParameters(MatrixComp voltageRef, Real srcFreq = 50.0); /// Setter for reference signal of type frequency ramp diff --git a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_VoltageSourceNorton.h b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_VoltageSourceNorton.h index 39753d4729..8420d2e381 100644 --- a/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_VoltageSourceNorton.h +++ b/dpsim-models/include/dpsim-models/EMT/EMT_Ph3_VoltageSourceNorton.h @@ -43,22 +43,22 @@ class VoltageSourceNorton : public MNASimPowerComp, /// void setVoltageRef(Complex voltage) const; - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency) {} + void initializeFromNodesAndTerminals(Real frequency) override {} // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Returns current through the component - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPreStep(Real time, Int timeStepCount) override; void mnaCompPostStep(Real time, Int timeStepCount, diff --git a/dpsim-models/include/dpsim-models/SP/SP_Ph1_AvVoltageSourceInverterDQ.h b/dpsim-models/include/dpsim-models/SP/SP_Ph1_AvVoltageSourceInverterDQ.h index cd8c7a50b0..481a915bc3 100644 --- a/dpsim-models/include/dpsim-models/SP/SP_Ph1_AvVoltageSourceInverterDQ.h +++ b/dpsim-models/include/dpsim-models/SP/SP_Ph1_AvVoltageSourceInverterDQ.h @@ -108,7 +108,7 @@ class AvVoltageSourceInverterDQ // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// Setter for general parameters of inverter void setParameters(Real sysOmega, Real sysVoltNom, Real Pref, Real Qref); /// Setter for parameters of control loops diff --git a/dpsim-models/include/dpsim-models/SP/SP_Ph1_Capacitor.h b/dpsim-models/include/dpsim-models/SP/SP_Ph1_Capacitor.h index a10e40e26b..e919dd6c2d 100644 --- a/dpsim-models/include/dpsim-models/SP/SP_Ph1_Capacitor.h +++ b/dpsim-models/include/dpsim-models/SP/SP_Ph1_Capacitor.h @@ -53,11 +53,11 @@ class Capacitor : public MNASimPowerComp, Capacitor(String name, Logger::Level logLevel = Logger::Level::off) : Capacitor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### Powerflow section #### /// Set base voltage @@ -70,22 +70,22 @@ class Capacitor : public MNASimPowerComp, // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; /// MNA post step operations void mnaCompPostStep(Real time, Int timeStepCount, - Attribute::Ptr &leftVector); + Attribute::Ptr &leftVector) override; /// Add MNA post step dependencies void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, - Attribute::Ptr &leftVector); + Attribute::Ptr &leftVector) override; }; } // namespace Ph1 } // namespace SP diff --git a/dpsim-models/include/dpsim-models/SP/SP_Ph1_Switch.h b/dpsim-models/include/dpsim-models/SP/SP_Ph1_Switch.h index ceed1cf1d4..a709663225 100644 --- a/dpsim-models/include/dpsim-models/SP/SP_Ph1_Switch.h +++ b/dpsim-models/include/dpsim-models/SP/SP_Ph1_Switch.h @@ -34,32 +34,32 @@ class Switch : public MNASimPowerComp, Switch(String name, Logger::Level logLevel = Logger::Level::off) : Switch(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### General MNA section #### void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; /// MNA post step operations void mnaCompPostStep(Real time, Int timeStepCount, - Attribute::Ptr &leftVector); + Attribute::Ptr &leftVector) override; /// Add MNA post step dependencies void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, - Attribute::Ptr &leftVector); + Attribute::Ptr &leftVector) override; // #### MNA section for switch #### /// Check if switch is closed @@ -67,7 +67,7 @@ class Switch : public MNASimPowerComp, /// Stamps system matrix considering the defined switch position void mnaCompApplySwitchSystemMatrixStamp(Bool closed, SparseMatrixRow &systemMatrix, - Int freqIdx); + Int freqIdx) override; }; } // namespace Ph1 } // namespace SP diff --git a/dpsim-models/include/dpsim-models/SP/SP_Ph1_SynchronGeneratorTrStab.h b/dpsim-models/include/dpsim-models/SP/SP_Ph1_SynchronGeneratorTrStab.h index 404e947497..93cc476bdb 100644 --- a/dpsim-models/include/dpsim-models/SP/SP_Ph1_SynchronGeneratorTrStab.h +++ b/dpsim-models/include/dpsim-models/SP/SP_Ph1_SynchronGeneratorTrStab.h @@ -68,7 +68,7 @@ class SynchronGeneratorTrStab : public CompositePowerComp, Logger::Level logLevel = Logger::Level::off) : SynchronGeneratorTrStab(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General Functions #### /// Flags to modify model behavior @@ -89,7 +89,7 @@ class SynchronGeneratorTrStab : public CompositePowerComp, /// void step(Real time); /// - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA Functions #### /// Initializes variables of component diff --git a/dpsim-models/include/dpsim-models/SP/SP_Ph1_VoltageSource.h b/dpsim-models/include/dpsim-models/SP/SP_Ph1_VoltageSource.h index 225a2b5b9f..8047e3edce 100644 --- a/dpsim-models/include/dpsim-models/SP/SP_Ph1_VoltageSource.h +++ b/dpsim-models/include/dpsim-models/SP/SP_Ph1_VoltageSource.h @@ -59,11 +59,11 @@ class VoltageSource : public MNASimPowerComp, VoltageSource(String name, Complex voltage, Logger::Level logLevel = Logger::Level::off); /// - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// void setSourceValue(Complex voltage); /// Setter for reference voltage and frequency with a sine wave generator @@ -110,9 +110,9 @@ class VoltageSource : public MNASimPowerComp, // #### DAE Section #### /// Residual function for DAE Solver void daeResidual(double ttime, const double state[], const double dstate_dt[], - double resid[], std::vector &off); + double resid[], std::vector &off) override; ///Voltage Getter - Complex daeInitialize(); + Complex daeInitialize() override; }; } // namespace Ph1 } // namespace SP diff --git a/dpsim-models/include/dpsim-models/SP/SP_Ph3_Capacitor.h b/dpsim-models/include/dpsim-models/SP/SP_Ph3_Capacitor.h index 2a74cfbdcb..a57a0efa16 100644 --- a/dpsim-models/include/dpsim-models/SP/SP_Ph3_Capacitor.h +++ b/dpsim-models/include/dpsim-models/SP/SP_Ph3_Capacitor.h @@ -37,21 +37,21 @@ class Capacitor : public MNASimPowerComp, Capacitor(String name, Logger::Level logLevel = Logger::Level::off) : Capacitor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPostStep(Real time, Int timeStepCount, Attribute::Ptr &leftVector) override; diff --git a/dpsim-models/include/dpsim-models/SP/SP_Ph3_Inductor.h b/dpsim-models/include/dpsim-models/SP/SP_Ph3_Inductor.h index 8ce055a258..0e97975e6b 100644 --- a/dpsim-models/include/dpsim-models/SP/SP_Ph3_Inductor.h +++ b/dpsim-models/include/dpsim-models/SP/SP_Ph3_Inductor.h @@ -42,26 +42,26 @@ class Inductor : public MNASimPowerComp, Inductor(String name, Real inductance, Logger::Level logLevel = Logger::Level::off); - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// Initializes internal variables of the component void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Upgrade values in the source vector and maybe system matrix before MNA solution void mnaStep(Matrix &systemMatrix, Matrix &rightVector, Matrix &leftVector, Real time); /// Upgrade internal variables after MNA solution void mnaMnaPostStep(Matrix &rightVector, Matrix &leftVector, Real time); /// Update interface voltage from MNA system result - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// Update interface current from MNA system result - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPostStep(Real time, Int timeStepCount, Attribute::Ptr &leftVector) override; @@ -73,7 +73,7 @@ class Inductor : public MNASimPowerComp, AttributeBase::List &modifiedAttributes, Attribute::Ptr &leftVector) override; - void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix); + void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix) override; }; } // namespace Ph3 } // namespace SP diff --git a/dpsim-models/include/dpsim-models/SP/SP_Ph3_Resistor.h b/dpsim-models/include/dpsim-models/SP/SP_Ph3_Resistor.h index f306bb6305..c19b958740 100644 --- a/dpsim-models/include/dpsim-models/SP/SP_Ph3_Resistor.h +++ b/dpsim-models/include/dpsim-models/SP/SP_Ph3_Resistor.h @@ -31,22 +31,22 @@ class Resistor : public MNASimPowerComp, Resistor(String name, Logger::Level logLevel = Logger::Level::off) : Resistor(name, name, logLevel) {} - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; // #### MNA section #### /// void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// - void mnaCompUpdateVoltage(const Matrix &leftVector); + void mnaCompUpdateVoltage(const Matrix &leftVector) override; /// - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; void mnaCompPostStep(Real time, Int timeStepCount, Attribute::Ptr &leftVector) override; @@ -57,7 +57,7 @@ class Resistor : public MNASimPowerComp, AttributeBase::List &modifiedAttributes, Attribute::Ptr &leftVector) override; // #### MNA Tear Section #### - void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix); + void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix) override; }; } // namespace Ph3 } // namespace SP diff --git a/dpsim-models/include/dpsim-models/SP/SP_Ph3_VoltageSource.h b/dpsim-models/include/dpsim-models/SP/SP_Ph3_VoltageSource.h index 6e57dd2c7f..4e7b221b57 100644 --- a/dpsim-models/include/dpsim-models/SP/SP_Ph3_VoltageSource.h +++ b/dpsim-models/include/dpsim-models/SP/SP_Ph3_VoltageSource.h @@ -41,32 +41,32 @@ class VoltageSource : public MNASimPowerComp, VoltageSource(String name, Complex voltage, Logger::Level logLevel = Logger::Level::off); - SimPowerComp::Ptr clone(String name); + SimPowerComp::Ptr clone(String name) override; void setParameters(Complex voltageRef); // #### General #### /// Initializes component from power flow data - void initializeFromNodesAndTerminals(Real frequency); + void initializeFromNodesAndTerminals(Real frequency) override; /// void setSourceValue(Complex voltage); // #### MNA Section #### /// void mnaCompInitialize(Real omega, Real timeStep, - Attribute::Ptr leftVector); + Attribute::Ptr leftVector) override; /// Stamps system matrix - void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix); + void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override; /// Stamps right side (source) vector - void mnaCompApplyRightSideVectorStamp(Matrix &rightVector); + void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override; /// Returns current through the component - void mnaCompUpdateCurrent(const Matrix &leftVector); + void mnaCompUpdateCurrent(const Matrix &leftVector) override; // #### DAE Section #### /// Residual function for DAE Solver void daeResidual(double ttime, const double state[], const double dstate_dt[], - double resid[], std::vector &off); + double resid[], std::vector &off) override; ///Voltage Getter - Complex daeInitialize(); + Complex daeInitialize() override; void mnaCompPreStep(Real time, Int timeStepCount) override; void mnaCompPostStep(Real time, Int timeStepCount, diff --git a/dpsim-models/include/dpsim-models/SimNode.h b/dpsim-models/include/dpsim-models/SimNode.h index 88588eb1ec..377ec8fc0f 100644 --- a/dpsim-models/include/dpsim-models/SimNode.h +++ b/dpsim-models/include/dpsim-models/SimNode.h @@ -69,7 +69,7 @@ class SimNode : public TopologicalNode, /// Initialize state matrices with size according to phase type and frequency number void initialize(Matrix frequencies); /// Returns matrix index for specified phase - UInt matrixNodeIndex(PhaseType phaseType = PhaseType::Single); + UInt matrixNodeIndex(PhaseType phaseType = PhaseType::Single) override; /// Returns all matrix indices std::vector matrixNodeIndices() override; /// diff --git a/dpsim-models/include/dpsim-models/SimPowerComp.h b/dpsim-models/include/dpsim-models/SimPowerComp.h index 19efdbd028..1834e0ab02 100644 --- a/dpsim-models/include/dpsim-models/SimPowerComp.h +++ b/dpsim-models/include/dpsim-models/SimPowerComp.h @@ -56,9 +56,7 @@ template class SimPowerComp : public TopologicalPowerComp { virtual ~SimPowerComp() {} /// Returns a modified copy of the component with the given suffix added to the name and without - /// connected nodes / terminals - /// DEPRECATED: This method should be removed - virtual Ptr clone(String name); + virtual typename SimPowerComp::Ptr clone(String name); // #### Terminals #### /// Returns nominal number of Terminals for this component type. diff --git a/dpsim-models/include/dpsim-models/Solver/MNASyncGenInterface.h b/dpsim-models/include/dpsim-models/Solver/MNASyncGenInterface.h index 3db22b004d..7e5663ca32 100644 --- a/dpsim-models/include/dpsim-models/Solver/MNASyncGenInterface.h +++ b/dpsim-models/include/dpsim-models/Solver/MNASyncGenInterface.h @@ -27,6 +27,8 @@ class MNASyncGenInterface { typedef std::shared_ptr Ptr; typedef std::vector List; + virtual ~MNASyncGenInterface(){}; + // Solver functions /// virtual void correctorStep() = 0; diff --git a/dpsim-models/src/DP/DP_Ph1_SynchronGenerator4OrderPCM.cpp b/dpsim-models/src/DP/DP_Ph1_SynchronGenerator4OrderPCM.cpp index 164426bbae..d3777f56d6 100644 --- a/dpsim-models/src/DP/DP_Ph1_SynchronGenerator4OrderPCM.cpp +++ b/dpsim-models/src/DP/DP_Ph1_SynchronGenerator4OrderPCM.cpp @@ -31,7 +31,7 @@ DP::Ph1::SynchronGenerator4OrderPCM::SynchronGenerator4OrderPCM( : SynchronGenerator4OrderPCM(name, name, logLevel) {} SimPowerComp::Ptr -DP::Ph1::SynchronGenerator4OrderPCM::clone(const String &name) { +DP::Ph1::SynchronGenerator4OrderPCM::clone(String name) { auto copy = SynchronGenerator4OrderPCM::make(name, mLogLevel); return copy; diff --git a/dpsim-models/src/DP/DP_Ph1_SynchronGenerator6OrderPCM.cpp b/dpsim-models/src/DP/DP_Ph1_SynchronGenerator6OrderPCM.cpp index c91055121b..a50b6838a3 100644 --- a/dpsim-models/src/DP/DP_Ph1_SynchronGenerator6OrderPCM.cpp +++ b/dpsim-models/src/DP/DP_Ph1_SynchronGenerator6OrderPCM.cpp @@ -33,7 +33,7 @@ DP::Ph1::SynchronGenerator6OrderPCM::SynchronGenerator6OrderPCM( : SynchronGenerator6OrderPCM(name, name, logLevel) {} SimPowerComp::Ptr -DP::Ph1::SynchronGenerator6OrderPCM::clone(const String &name) { +DP::Ph1::SynchronGenerator6OrderPCM::clone(String name) { auto copy = SynchronGenerator6OrderPCM::make(name, mLogLevel); return copy; diff --git a/dpsim-villas/examples/cxx/FpgaExample.cpp b/dpsim-villas/examples/cxx/FpgaExample.cpp new file mode 100644 index 0000000000..08cb887e39 --- /dev/null +++ b/dpsim-villas/examples/cxx/FpgaExample.cpp @@ -0,0 +1,92 @@ +// SPDX-License-Identifier: Apache-2.0 + +#include + +#include +#include + +using namespace DPsim; +using namespace CPS::DP; +using namespace CPS::DP::Ph1; + +int main(int argc, char *argv[]) { + // Very simple test circuit. Just a few resistors and an inductance. + // Voltage is read from VILLASnode and current through everything is written back. + String simName = "Fpga_example"; + CPS::Logger::setLogDir("logs/" + simName); + Real timeStep = 0.01; + + // Nodes + auto n1 = SimNode::make("n1"); + auto n2 = SimNode::make("n2"); + auto n3 = SimNode::make("n3"); + auto n4 = SimNode::make("n4"); + + // Components + auto evs = VoltageSource::make("v_s"); + evs->setParameters(Complex(5, 0)); + auto rs = Resistor::make("r_s"); + rs->setParameters(1); + auto rl = Resistor::make("r_line"); + rl->setParameters(1); + auto ll = Inductor::make("l_line"); + ll->setParameters(1); + auto rL = Resistor::make("r_load"); + rL->setParameters(1000); + + // Topology + evs->connect({SimNode::GND, n1}); + rs->connect({n1, n2}); + rl->connect({n2, n3}); + ll->connect({n3, n4}); + rL->connect({n4, SimNode::GND}); + + auto sys = SystemTopology(50, SystemNodeList{SimNode::GND, n1, n2, n3, n4}, + SystemComponentList{evs, rs, rl, ll, rL}); + + RealTimeSimulation sim(simName); + sim.setSystem(sys); + sim.setTimeStep(timeStep); + sim.setFinalTime(10.0); + + std::string fpgaConfig = R"STRING({ + type = "fpga", + card = { + interface = "pcie", + id = "10ee:7021", + slot = "0000:88:00.0", + do_reset = true, + ips = "../../fpga/vc707-xbar-pcie-dino/vc707-xbar-pcie-dino-v2.json", + polling = true, + }, + connect = ["0->3", "dino<-dma", "dino->dma"], + signals = ({ name = "dino", unit = "Volts", type = "float"}), + builtin = false, + lowLatencyMode = true, + })STRING"; + + auto intf = std::make_shared(fpgaConfig); + + // Interface + sim.addInterface(intf); + intf->importAttribute(evs->mVoltageRef, 0, true, true); + intf->exportAttribute(evs->mIntfVoltage->deriveCoeff(0, 0), 0, true, + "v_src"); + + // Logger + auto logger = DataLogger::make(simName); + logger->logAttribute("v1", n1->mVoltage); + logger->logAttribute("v2", n2->mVoltage); + logger->logAttribute("v3", n3->mVoltage); + logger->logAttribute("v4", n4->mVoltage); + logger->logAttribute("v_src", evs->mVoltageRef); + logger->logAttribute("i_r", rl->mIntfCurrent, 1, 1); + logger->logAttribute("i_evs", evs->mIntfCurrent, 1, 1); + logger->logAttribute("v_evs", evs->mIntfVoltage, 1, 1); + sim.addLogger(logger); + + sim.run(1); + + //std::ofstream of("task_dependencies.svg"); + //sim.dependencyGraph().render(of); +} diff --git a/dpsim-villas/src/InterfaceWorkerVillas.cpp b/dpsim-villas/src/InterfaceWorkerVillas.cpp index 9c7a6c15a4..7326e76331 100644 --- a/dpsim-villas/src/InterfaceWorkerVillas.cpp +++ b/dpsim-villas/src/InterfaceWorkerVillas.cpp @@ -42,6 +42,8 @@ void InterfaceWorkerVillas::open() { json_error_t error; json_t *config = json_loads(mNodeConfig.c_str(), 0, &error); if (config == nullptr) { + SPDLOG_LOGGER_ERROR(mLog, "Error: Failed to parse node config! Error: {}", + error.text); throw JsonError(config, error); } @@ -321,7 +323,7 @@ void InterfaceWorkerVillas::writeValuesToEnv( //Check if the remaining packets form a complete set if (((long)updatedAttrs.size()) == std::count_if(mExports.cbegin(), mExports.cend(), - [this](auto x) { return std::get<2>(x); })) { + [](auto x) { return std::get<2>(x); })) { for (const auto &packet : updatedAttrs) { std::get<0>(mExports[packet.attributeId])(packet.value, sample); } diff --git a/dpsim/examples/cxx/CIM/WSCC_9bus_mult_decoupled.cpp b/dpsim/examples/cxx/CIM/WSCC_9bus_mult_decoupled.cpp index 928c5c989b..acd4fe3d91 100644 --- a/dpsim/examples/cxx/CIM/WSCC_9bus_mult_decoupled.cpp +++ b/dpsim/examples/cxx/CIM/WSCC_9bus_mult_decoupled.cpp @@ -20,7 +20,6 @@ void multiply_decoupled(SystemTopology &sys, int copies, Real resistance, Real inductance, Real capacitance) { sys.multiply(copies); - int counter = 0; std::vector nodes = {"BUS5", "BUS8", "BUS6"}; for (auto orig_node : nodes) { @@ -41,7 +40,6 @@ void multiply_decoupled(SystemTopology &sys, int copies, Real resistance, capacitance, Logger::Level::info); sys.addComponent(line); sys.addComponents(line->getLineComponents()); - counter++; } } } diff --git a/dpsim/include/dpsim/DiakopticsSolver.h b/dpsim/include/dpsim/DiakopticsSolver.h index f895b5eb38..97292b4c2a 100644 --- a/dpsim/include/dpsim/DiakopticsSolver.h +++ b/dpsim/include/dpsim/DiakopticsSolver.h @@ -94,7 +94,7 @@ class DiakopticsSolver : public Solver, public CPS::AttributeList { void initMatrices(); void applyTearComponentStamp(UInt compIdx); - void log(Real time); + void log(Real time, Int timeStepCount); public: /// Currents through the removed network (as "seen" from the other subnets) diff --git a/dpsim/include/dpsim/Interface.h b/dpsim/include/dpsim/Interface.h index 29bd0a544c..63366beabb 100644 --- a/dpsim/include/dpsim/Interface.h +++ b/dpsim/include/dpsim/Interface.h @@ -39,7 +39,8 @@ class Interface : public SharedFactory { Interface(std::shared_ptr intf, const String &name = "", UInt downsampling = 1) - : mInterfaceWorker(intf), mName(name), mDownsampling(downsampling) { + : mInterfaceWorker(intf), mName(name), mDownsampling(downsampling), + mOpened(false) { mQueueDpsimToInterface = std::make_shared< moodycamel::BlockingReaderWriterQueue>(); mQueueInterfaceToDpsim = std::make_shared< diff --git a/dpsim/include/dpsim/MNASolverDirect.h b/dpsim/include/dpsim/MNASolverDirect.h index 456a05f9ae..cc1be7b62c 100644 --- a/dpsim/include/dpsim/MNASolverDirect.h +++ b/dpsim/include/dpsim/MNASolverDirect.h @@ -169,7 +169,7 @@ template class MnaSolverDirect : public MnaSolver { /// Sets the linear solver configuration void setDirectLinearSolverConfiguration( - DirectLinearSolverConfiguration &configuration); + DirectLinearSolverConfiguration &configuration) override; /// log LU decomposition times void logLUTimes() override; diff --git a/dpsim/include/dpsim/MNASolverFactory.h b/dpsim/include/dpsim/MNASolverFactory.h index e832186dfc..a349cffd0c 100644 --- a/dpsim/include/dpsim/MNASolverFactory.h +++ b/dpsim/include/dpsim/MNASolverFactory.h @@ -59,14 +59,18 @@ class MnaSolverFactory { /// sovlerImpl: choose the most advanced solver implementation available by default template - static std::shared_ptr> - factory(String name, CPS::Domain domain = CPS::Domain::DP, - CPS::Logger::Level logLevel = CPS::Logger::Level::info, - DirectLinearSolverImpl implementation = DirectLinearSolverImpl::KLU, - String pluginName = "plugin.so") { + static std::shared_ptr> factory( + String name, CPS::Domain domain = CPS::Domain::DP, + CPS::Logger::Level logLevel = CPS::Logger::Level::info, + DirectLinearSolverImpl implementation = mSupportedSolverImpls().back(), + String pluginName = "plugin.so") { //To avoid regression we use KLU in case of undefined implementation if (implementation == DirectLinearSolverImpl::Undef) { +#ifdef WITH_KLU implementation = DirectLinearSolverImpl::KLU; +#else + implementation = mSupportedSolverImpls().back(); +#endif } CPS::Logger::Log log = CPS::Logger::get( "MnaSolverFactory", CPS::Logger::Level::info, CPS::Logger::Level::info); diff --git a/dpsim/include/dpsim/PFSolver.h b/dpsim/include/dpsim/PFSolver.h index b23527466e..1b4ca5ddcc 100644 --- a/dpsim/include/dpsim/PFSolver.h +++ b/dpsim/include/dpsim/PFSolver.h @@ -105,7 +105,7 @@ class PFSolver : public Solver { virtual void setSolution() = 0; /// Initialization of the solver - void initialize(); + void initialize() override; /// Initialization of individual components void initializeComponents(); /// Assignment of matrix indices for nodes @@ -135,7 +135,7 @@ class PFSolver : public Solver { return result.str(); }; /// - CPS::Task::List getTasks(); + CPS::Task::List getTasks() override; // determines power flow bus type for each node according to the components attached to it. public: /// Constructor to be used in simulation examples. diff --git a/dpsim/include/dpsim/Utils.h b/dpsim/include/dpsim/Utils.h index 0b7a0f0fb9..4388422582 100644 --- a/dpsim/include/dpsim/Utils.h +++ b/dpsim/include/dpsim/Utils.h @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include using json = nlohmann::json; diff --git a/dpsim/src/DiakopticsSolver.cpp b/dpsim/src/DiakopticsSolver.cpp index b334b8cb70..5491f9cb55 100644 --- a/dpsim/src/DiakopticsSolver.cpp +++ b/dpsim/src/DiakopticsSolver.cpp @@ -459,19 +459,19 @@ void DiakopticsSolver::PostSolveTask::execute(Real time, } } -template <> void DiakopticsSolver::log(Real time) { +template <> void DiakopticsSolver::log(Real time, Int timeStepCount) { mLeftVectorLog->logEMTNodeValues(time, mLeftSideVector); mRightVectorLog->logEMTNodeValues(time, mRightSideVector); } -template <> void DiakopticsSolver::log(Real time) { +template <> void DiakopticsSolver::log(Real time, Int timeStepCount) { mLeftVectorLog->logPhasorNodeValues(time, mLeftSideVector); mRightVectorLog->logPhasorNodeValues(time, mRightSideVector); } template void DiakopticsSolver::LogTask::execute(Real time, Int timeStepCount) { - mSolver.log(time); + mSolver.log(time, timeStepCount); } template class DiakopticsSolver; diff --git a/dpsim/src/Simulation.cpp b/dpsim/src/Simulation.cpp index ca2e555b06..1d79b4f8f4 100644 --- a/dpsim/src/Simulation.cpp +++ b/dpsim/src/Simulation.cpp @@ -258,7 +258,7 @@ Graph::Graph Simulation::dependencyGraph() { auto getColor = [](Task::Ptr task) -> String { static std::map colorMap; - auto tid = std::type_index(typeid(*task.get())); + auto tid = std::type_index(typeid(task.get())); if (colorMap.find(tid) != colorMap.end()) { colorMap[tid] =