-
Notifications
You must be signed in to change notification settings - Fork 51
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
Check, improve and document subcomponent handling #131
Comments
Classes which include subcomponents (changes in #141):
|
In addition to the changes made in #141, I propose another way to further unify the behavior of components with subcomponents: By creating a shared superclass MNASimPowerComp that is derived from both SimPowerComp and MNAInterface, it becomes possible to extract the various MNA method calls on the subcomponents into this common superclass. This means that the parent components only register their subcomponents once (e. g. through |
I would suggest that the new superclass is used only for components that are composed of subcomponents, e.g. |
@m-mirz We are thinking of inserting a new class |
…141) For all components that declare some kind of subcomponents, this PR unifies the handling of these subcomponents such that: - Subcomponents are always added to `mSubComponents` - Subcomponent MNA methods (`mnaPreStep`, `mnaPostStep`...) are called directly in the same-named parent method and not through custom tasks - The parent calls the subcomponent's methods by iterating through `mSubComponents` Based on #140 Related to #131
Introduces two new base classes, MNASimPowerComp<T> and CompositePowerComp<T>. For all composite components (as defined in #131), MNASimPowerComp provides default implementations for all methods in MNAInterface, as well as default MnaPreStep and MnaPostStep tasks, such that MNAInterface is only inherited once in the parent class and not in each component individually. Additionally, CompositePowerComp provides mnaParent... methods for most of the MNA methods in MNAInterface. Via the addMNASubComponent method, a component can register subcomponents for which the relevant MNA methods are called automatically by the CompositePowerComp parent class. For each MNA method, the child component class can decide to either override the normal mna... method and provide subcomponent handling themselves, or override just the mnaParent... method and let the subcomponents (and some other common operations) get handled by the parent class methods. While the MNASimPowerComp class is not used for any non-composite components in this PR, the unification of MNA methods for these components is covered in #150 . Based on #142 Related to #131 Rebase of #144
SimPowerComp
has a vectormSubComponents
of subcomponents but most classes derived fromSimPowerComp
have their subcomponents as separate member variables, not utilizing this list.mSubComponents
to harmonize calling pre- and poststep routines, as for example shown hereThe text was updated successfully, but these errors were encountered: