Ensure that virtual nodes of subcomponents are created before function collectVirtualNodes
#270
Labels
bug
Something isn't working
collectVirtualNodes
#270
When a component has subcompoenents with virtual nodes, the constructor of the subcomponents has to be called before the function
initializeFromNodesAndTerminals
(for example in the constructor) of the parent component, otherwise the subcomponent will not be correctly stamped in the system matrix. That is because the simulation structure looks like the following:MNASolver->initialize
MNASolver->initialize
callsMNASolver->collectVirtualNodes
MNASolver->initialize
callsMNASolver->initializeComponents
MNASolver->initializeComponents
callsMNAComp->initializeFromNodesAndTerminals
initializeFromNodesAndTerminals
of the parent component is called, which sometimes calls the constructor of the subComponents (e.g. PiLine). However, if the subComponent adds virtual nodes (e.g. a VoltageSource), the previous call ofMNASolver->collectVirtualNodes
is not going to consider the virtual nodes of the new subcomponent which leads to a wrong stamp of the system matrix.We should add a function (e.g.
createSubComponents
) which is called beforeMNASolver->collectVirtualNodes
to ensure that virtualNodes are created before the functionMNASolver->collectVirtualNodes
is calledThe text was updated successfully, but these errors were encountered: