Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that virtual nodes of subcomponents are created before function collectVirtualNodes #270

Open
martinmoraga opened this issue Dec 22, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@martinmoraga
Copy link
Contributor

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:

  1. Simulator class calls MNASolver->initialize
  2. MNASolver->initialize calls MNASolver->collectVirtualNodes
  3. MNASolver->initialize calls MNASolver->initializeComponents
  4. MNASolver->initializeComponents calls MNAComp->initializeFromNodesAndTerminals
  5. 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 of MNASolver->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 before MNASolver->collectVirtualNodes to ensure that virtualNodes are created before the function MNASolver->collectVirtualNodes is called

@martinmoraga martinmoraga added the bug Something isn't working label Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants