JUK1
CircuitElements< T > Struct Template Reference

a glorified container for the different types of components. More...

#include <CircuitElements.hpp>

Inheritance diagram for CircuitElements< T >:

Public Member Functions

 CircuitElements (size_t numNodes=0, size_t numCurrents=0, size_t numDCCurrents=0)
 Initialisation. More...
 
void setNewStampSize (size_t numNodes, size_t numCurrents, size_t numDCCurrents=0)
 Updates the size of all stamps. More...
 
Stamp< T > & generateStaticStamp ()
 Forces a clear of the static stamp, and generates a new one. More...
 
Stamp< T > & generateDynamicStamp (const Matrix< T > &solutionMatrix, const size_t currentSolutionIndex, T timestep)
 Obtains the static stamp, then adds dynamic components to it. More...
 
Stamp< T > & generateNonLinearStamp (const Matrix< T > &solutionMatrix, const size_t currentSolutionIndex, T timestep)
 Obtains the dynamic stamp, then adds dynamic components to it. More...
 
Stamp< T > & generateCompleteStamp (SolutionStage stage, const Matrix< T > &solutionMatrix, const size_t currentSolutionIndex, T timestep)
 Generates the complete stamp up to a certain point. More...
 
Stamp< T > & generateDCStamp (const Matrix< T > &solutionVector, size_t numCurrents)
 Generates the complete DC stamp. More...
 
void updateTimeStep (const Matrix< T > &solutionMatrix, const size_t currentSolutionIndex, T timestep)
 Updates the components at the end of each time step. Applies to dynamic and non-linear components. More...
 
void updateDCStoredState (const Matrix< T > &solutionVector, size_t numCurrents)
 Updates the components based on their DC value. Applies to dynamic and non-linear components. More...
 

Public Attributes

Stamp< T > staticStamp
 Preallocated stamp. Used for caching between loop iterations. Static stamps will only be generated once as a result. More...
 
Stamp< T > dynamicStamp
 Preallocated stamp. Used for caching between loop iterations. Dynamic stamps need to be updated on every timestep. More...
 
Stamp< T > nonLinearStamp
 Preallocated stamp. Used for caching between loop iterations. Non-Linear stamps must be updated on every newton-raphson iteration. More...
 
Stamp< T > dcStamp
 Preallocated stamp. Used for caching between loop iterations. DC stamps must be updated on every newton-raphson iteration. More...
 
std::vector< std::shared_ptr< Component< T > > > staticElements
 A container to store the static components. More...
 
std::vector< std::shared_ptr< Component< T > > > dynamicElements
 A container to store the dynamic components. More...
 
std::vector< std::shared_ptr< Component< T > > > nonLinearElements
 A container to store the Non-Linear components. More...
 
bool staticStampIsFresh = false
 A variable used to track if the cached stamp is current. More...
 
bool dynamicStampIsFresh = false
 A variable used to track if the cached stamp is current. More...
 
bool nonLinearStampIsFresh = false
 A variable used to track if the cached stamp is current. More...
 
std::multimap< size_t, std::shared_ptr< Component< T > > > nodeComponentMap
 A map to pair nodes with the components connected to them. More...
 

Detailed Description

template<typename T>
struct CircuitElements< T >

a glorified container for the different types of components.

Template Parameters
T

Definition at line 46 of file CircuitElements.hpp.

Constructor & Destructor Documentation

◆ CircuitElements()

template<typename T >
CircuitElements< T >::CircuitElements ( size_t  numNodes = 0,
size_t  numCurrents = 0,
size_t  numDCCurrents = 0 
)
inline

Initialisation.

Parameters
numNodesThe size of the stamps voltage dependants
numCurrentsThe size of the stamps voltage dependants
numDCCurrentsThe size of the stamps voltage dependants

Definition at line 88 of file CircuitElements.hpp.

Member Function Documentation

◆ generateCompleteStamp()

template<typename T >
Stamp<T>& CircuitElements< T >::generateCompleteStamp ( SolutionStage  stage,
const Matrix< T > &  solutionMatrix,
const size_t  currentSolutionIndex,
timestep 
)
inline

Generates the complete stamp up to a certain point.

Parameters
solutionMatrixThe solution matrix to use for the dynamic and non-linear stamp.
currentSolutionIndexThe current index we are at.
timestepThe time step being used.
Returns
The complete stamp.

Definition at line 196 of file CircuitElements.hpp.

Here is the call graph for this function:

◆ generateDCStamp()

template<typename T >
Stamp<T>& CircuitElements< T >::generateDCStamp ( const Matrix< T > &  solutionVector,
size_t  numCurrents 
)
inline

Generates the complete DC stamp.

Parameters
solutionVectorThe solution vector to use for the dynamic and non-linear stamp.
currentSolutionIndexThe current index we are at.
timestepThe time step being used.
Returns
The complete stamp.

Definition at line 234 of file CircuitElements.hpp.

Here is the caller graph for this function:

◆ generateDynamicStamp()

template<typename T >
Stamp<T>& CircuitElements< T >::generateDynamicStamp ( const Matrix< T > &  solutionMatrix,
const size_t  currentSolutionIndex,
timestep 
)
inline

Obtains the static stamp, then adds dynamic components to it.

Parameters
solutionMatrixThe solution matrix to use for the dynamic and non-linear stamp.
currentSolutionIndexThe current index we are at.
timestepThe time step being used.
Returns
A reference to the cached stamp.

Definition at line 141 of file CircuitElements.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateNonLinearStamp()

template<typename T >
Stamp<T>& CircuitElements< T >::generateNonLinearStamp ( const Matrix< T > &  solutionMatrix,
const size_t  currentSolutionIndex,
timestep 
)
inline

Obtains the dynamic stamp, then adds dynamic components to it.

Parameters
solutionMatrixThe solution matrix to use for the dynamic and non-linear stamp.
currentSolutionIndexThe current index we are at.
timestepThe time step being used.
Returns
A reference to the cached stamp.

Definition at line 171 of file CircuitElements.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateStaticStamp()

template<typename T >
Stamp<T>& CircuitElements< T >::generateStaticStamp ( )
inline

Forces a clear of the static stamp, and generates a new one.

Returns
A reference to the cached stamp.

Definition at line 114 of file CircuitElements.hpp.

Here is the caller graph for this function:

◆ setNewStampSize()

template<typename T >
void CircuitElements< T >::setNewStampSize ( size_t  numNodes,
size_t  numCurrents,
size_t  numDCCurrents = 0 
)
inline

Updates the size of all stamps.

Parameters
numNodesThe size of the stamps voltage dependants
numCurrentsThe size of the stamps voltage dependants
numDCCurrentsThe size of the stamps voltage dependants

Definition at line 101 of file CircuitElements.hpp.

Here is the caller graph for this function:

◆ updateDCStoredState()

template<typename T >
void CircuitElements< T >::updateDCStoredState ( const Matrix< T > &  solutionVector,
size_t  numCurrents 
)
inline

Updates the components based on their DC value. Applies to dynamic and non-linear components.

Parameters
solutionVectorThe solution vector to use for DC value
numCurrentsThe number of currents used by the transient simulation.

Definition at line 278 of file CircuitElements.hpp.

Here is the caller graph for this function:

◆ updateTimeStep()

template<typename T >
void CircuitElements< T >::updateTimeStep ( const Matrix< T > &  solutionMatrix,
const size_t  currentSolutionIndex,
timestep 
)
inline

Updates the components at the end of each time step. Applies to dynamic and non-linear components.

Parameters
solutionMatrixThe solution matrix to use for the dynamic and non-linear stamp.
currentSolutionIndexThe current index we are at.
timestepThe time step being used.

Definition at line 259 of file CircuitElements.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ dcStamp

template<typename T >
Stamp<T> CircuitElements< T >::dcStamp

Preallocated stamp. Used for caching between loop iterations. DC stamps must be updated on every newton-raphson iteration.

Definition at line 60 of file CircuitElements.hpp.

◆ dynamicElements

template<typename T >
std::vector<std::shared_ptr<Component<T> > > CircuitElements< T >::dynamicElements

A container to store the dynamic components.

Definition at line 69 of file CircuitElements.hpp.

◆ dynamicStamp

template<typename T >
Stamp<T> CircuitElements< T >::dynamicStamp

Preallocated stamp. Used for caching between loop iterations. Dynamic stamps need to be updated on every timestep.

Definition at line 52 of file CircuitElements.hpp.

◆ dynamicStampIsFresh

template<typename T >
bool CircuitElements< T >::dynamicStampIsFresh = false

A variable used to track if the cached stamp is current.

Definition at line 76 of file CircuitElements.hpp.

◆ nodeComponentMap

template<typename T >
std::multimap<size_t, std::shared_ptr<Component<T> > > CircuitElements< T >::nodeComponentMap

A map to pair nodes with the components connected to them.

Definition at line 81 of file CircuitElements.hpp.

◆ nonLinearElements

template<typename T >
std::vector<std::shared_ptr<Component<T> > > CircuitElements< T >::nonLinearElements

A container to store the Non-Linear components.

Definition at line 71 of file CircuitElements.hpp.

◆ nonLinearStamp

template<typename T >
Stamp<T> CircuitElements< T >::nonLinearStamp

Preallocated stamp. Used for caching between loop iterations. Non-Linear stamps must be updated on every newton-raphson iteration.

Definition at line 56 of file CircuitElements.hpp.

◆ nonLinearStampIsFresh

template<typename T >
bool CircuitElements< T >::nonLinearStampIsFresh = false

A variable used to track if the cached stamp is current.

Definition at line 78 of file CircuitElements.hpp.

◆ staticElements

template<typename T >
std::vector<std::shared_ptr<Component<T> > > CircuitElements< T >::staticElements

A container to store the static components.

Definition at line 67 of file CircuitElements.hpp.

◆ staticStamp

template<typename T >
Stamp<T> CircuitElements< T >::staticStamp

Preallocated stamp. Used for caching between loop iterations. Static stamps will only be generated once as a result.

Definition at line 49 of file CircuitElements.hpp.

◆ staticStampIsFresh

template<typename T >
bool CircuitElements< T >::staticStampIsFresh = false

A variable used to track if the cached stamp is current.

Definition at line 74 of file CircuitElements.hpp.


The documentation for this struct was generated from the following file: