You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment the Networkproblem holds two vectors of pointers to Equationcomponents (and Statecomponents respectively), which are traversed all the time.
But in large parts the actual type of the Equationcomponents are the same.
E.g. usually there are a lot of pipes in a problem and so during traversal of the Statecomponent vector, the dynamic type doesn't change.
Up to now this is maybe a bit inelegant but not much of a problem.
Now that I'm starting on controllable elements the current way of doing things will imply that every Equationcomponent will have a virtual function get_control_derivative() which will most of the time do nothing just to fulfill the interface.
This could be better, if each actual type (like Pipe) holds an array of pipe data instead, so that
Networkproblem would just iterate over the types and each type would iterate over the concrete components.
Then we only would have one function (of the type holding the pipe array) that does nothing instead of such a function for every component.
For now I will go with the old design. Hopefully someone eventually finds time for this rather big refactoring.
The text was updated successfully, but these errors were encountered:
The issue still stands but at least now not every Equationcomponent has this empty function.
Rather, now Networkproblem also holds pointers to Controlcomponent, which has the control derivative functions.
At the moment the Networkproblem holds two vectors of pointers to Equationcomponents (and Statecomponents respectively), which are traversed all the time.
But in large parts the actual type of the Equationcomponents are the same.
E.g. usually there are a lot of pipes in a problem and so during traversal of the Statecomponent vector, the dynamic type doesn't change.
Up to now this is maybe a bit inelegant but not much of a problem.
Now that I'm starting on controllable elements the current way of doing things will imply that every Equationcomponent will have a virtual function
get_control_derivative()
which will most of the time do nothing just to fulfill the interface.This could be better, if each actual type (like Pipe) holds an array of pipe data instead, so that
Networkproblem would just iterate over the types and each type would iterate over the concrete components.
Then we only would have one function (of the type holding the pipe array) that does nothing instead of such a function for every component.
For now I will go with the old design. Hopefully someone eventually finds time for this rather big refactoring.
The text was updated successfully, but these errors were encountered: