DPsim
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
CPS::SimPowerComp< VarType > Class Template Reference

Base class for all components that are transmitting power. More...

#include <SimPowerComp.h>

Inheritance diagram for CPS::SimPowerComp< VarType >:
[legend]
Collaboration diagram for CPS::SimPowerComp< VarType >:
[legend]

Public Types

typedef VarType Type
 
typedef std::shared_ptr< SimPowerComp< VarType > > Ptr
 
typedef std::vector< Ptr > List
 
- Public Types inherited from CPS::TopologicalPowerComp
enum  Behaviour { Initialization , MNASimulation , PFSimulation }
 
typedef std::shared_ptr< TopologicalPowerCompPtr
 
typedef std::vector< Ptr > List
 
- Public Types inherited from CPS::IdentifiedObject
typedef std::shared_ptr< IdentifiedObjectPtr
 
typedef std::vector< Ptr > List
 

Public Member Functions

 SimPowerComp (String uid, String name, Logger::Level logLevel=Logger::Level::off)
 Basic constructor that takes UID, name and log level.
 
 SimPowerComp (String name, Logger::Level logLevel=Logger::Level::off)
 Basic constructor that takes name and log level and sets the UID to name as well.
 
virtual ~SimPowerComp ()
 Destructor - does not do anything.
 
virtual SimPowerComp< VarType >::Ptr clone (String name)
 Returns a modified copy of the component with the given suffix added to the name and without.
 
UInt terminalNumber ()
 Returns nominal number of Terminals for this component type.
 
UInt terminalNumberConnected ()
 Returns the number of connected Terminals.
 
Bool hasUnconnectedTerminals ()
 
void checkForUnconnectedTerminals ()
 
SimTerminal< VarType >::List terminals ()
 Return list of Terminal pointers.
 
SimTerminal< VarType >::Ptr terminal (UInt index)
 Get pointer to Terminal.
 
TopologicalTerminal::List topologicalTerminals ()
 Returns the list of terminals as TopologicalTerminal pointers.
 
void setTerminalNumber (UInt num)
 
void setTerminals (typename SimTerminal< VarType >::List terminals)
 
void setTerminalAt (typename SimTerminal< VarType >::Ptr terminal, UInt terminalPosition)
 Sets Terminal at index terminalPosition.
 
void updateMatrixNodeIndices ()
 Update the "cached" mMatrixNodeIndices and mMatrixNodeIndexIsGround members.
 
UInt nodeNumber ()
 Returns the actual number of Nodes / Terminals that are already set to valid Nodes.
 
SimNode< VarType >::Ptr node (UInt index)
 Get pointer to node.
 
UInt matrixNodeIndex (UInt nodeIndex)
 
UInt matrixNodeIndex (UInt nodeIndex, UInt phaseIndex)
 
std::vector< UInt > matrixNodeIndices (UInt index)
 TODO replace with access to mMatrixNodeIndices.
 
TopologicalNode::List topologicalNodes ()
 Get nodes as base type TopologicalNode.
 
UInt virtualNodesNumber ()
 Returns nominal number of virtual nodes for this component type.
 
Bool hasVirtualNodes ()
 Returns true if virtual node number is greater than zero.
 
Bool hasSubComponents ()
 Returns true if subcomponents included in this component.
 
SimPowerComp< VarType >::List subComponents ()
 Get list of subcomponents.
 
SimNode< VarType >::List & virtualNodes ()
 
SimNode< VarType >::Ptr virtualNode (UInt index)
 Get pointer to virtual node.
 
std::vector< UInt > virtualMatrixNodeIndices (UInt index)
 Get vector of simulation node numbers from virtual Node.
 
UInt virtualSimNode (UInt nodeIndex, UInt phaseIndex=0)
 Get simulation node number from virtual node.
 
const MatrixVar< VarType > & intfCurrent ()
 
const MatrixVar< VarType > & intfVoltage ()
 
MatrixComp initialVoltage (UInt index)
 
Complex initialSingleVoltage (UInt index)
 
Bool terminalNotGrounded (UInt index)
 
void setIntfCurrent (MatrixVar< VarType > current)
 
void setIntfVoltage (MatrixVar< VarType > voltage)
 
void setVirtualNodeNumber (UInt num)
 
void setVirtualNodeAt (typename SimNode< VarType >::Ptr virtualNode, UInt nodeNum)
 Sets the virtual node at index nodeNum.
 
void connect (typename SimNode< VarType >::List nodes)
 Sets all nodes and checks for nominal number of Nodes for this Component.
 
virtual void initialize (Matrix frequencies)
 Initialize components with correct network frequencies.
 
virtual void initializeFromNodesAndTerminals (Real frequency)
 Initializes Component variables according to power flow data stored in Nodes.
 
- Public Member Functions inherited from CPS::TopologicalPowerComp
 TopologicalPowerComp (String uid, String name, Logger::Level logLevel=Logger::Level::off)
 Basic constructor that takes UID, name and log level.
 
 TopologicalPowerComp (String name, Logger::Level logLevel=Logger::Level::off)
 Basic constructor that takes name and log level and sets the UID to name as well.
 
virtual ~TopologicalPowerComp ()
 Destructor - does not do anything.
 
void setBehaviour (Behaviour behaviour)
 Set behavior of component, e.g. initialization.
 
- Public Member Functions inherited from CPS::IdentifiedObject
 IdentifiedObject (const String &uid, const String &name)
 
 IdentifiedObject (const String &name)
 
AttributeBase::Ptr attribute (const String &name) const
 Return pointer to an attribute.
 
template<typename T >
Attribute< T >::Ptr attributeTyped (const String &name) const
 Return pointer to an attribute.
 
const AttributeBase::Map & attributes () const
 
String name ()
 
String uid ()
 Returns unique id.
 
String type ()
 Get component type (cross-platform)
 

Public Attributes

const Attribute< MatrixVar< VarType > >::Ptr mIntfVoltage
 Voltage between terminals.
 
const Attribute< MatrixVar< VarType > >::Ptr mIntfCurrent
 Current through component.
 
- Public Attributes inherited from CPS::IdentifiedObject
const Attribute< String >::Ptr mName
 Human readable name.
 
const Attribute< String >::Ptr mUID
 Unique identifier.
 

Protected Attributes

SimTerminal< VarType >::List mTerminals
 List of Terminals.
 
SimNode< VarType >::List mVirtualNodes
 List of virtual nodes.
 
Matrix mFrequencies
 List of considered network frequencies.
 
UInt mNumFreqs = 0
 Number of network frequencies.
 
PhaseType mPhaseType = PhaseType::Single
 
std::vector< std::shared_ptr< SimPowerComp< VarType > > > mSubComponents
 
std::vector< UInt > mMatrixNodeIndices
 "Cached" list of simulation nodes (to avoid shared_ptr accesses during simulation)
 
std::vector< bool > mMatrixNodeIndexIsGround
 "Cached" flags for whether the connected nodes are grounded
 
- Protected Attributes inherited from CPS::TopologicalPowerComp
UInt mNumTerminals = 0
 Determines the number of Terminals which can be connected to network Nodes.
 
UInt mNumVirtualNodes = 0
 Determines the number of virtual or internal Nodes.
 
Logger::Log mSLog
 Component logger.
 
Logger::Level mLogLevel
 Component logger control for internal variables.
 
Behaviour mBehaviour = Behaviour::MNASimulation
 
bool mParametersSet = false
 Flag indicating that parameters are set via setParameters() function.
 
- Protected Attributes inherited from CPS::IdentifiedObject
AttributeList::Ptr mAttributes = AttributeList::make()
 Attribute List.
 

Detailed Description

template<typename VarType>
class CPS::SimPowerComp< VarType >

Base class for all components that are transmitting power.

Definition at line 17 of file SimPowerComp.h.

Member Function Documentation

◆ setTerminals()

template<typename VarType >
void SimPowerComp::setTerminals ( typename SimTerminal< VarType >::List  terminals)

Sets all Terminals of the component and checks if the number of Terminals is too large fir this component type.

Definition at line 171 of file SimPowerComp.cpp.

Member Data Documentation

◆ mSubComponents

template<typename VarType >
std::vector<std::shared_ptr<SimPowerComp<VarType> > > CPS::SimPowerComp< VarType >::mSubComponents
protected

List of subcomponents DEPRECATED: Delete or move into CompositePowerComp

Definition at line 33 of file SimPowerComp.h.


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