Refactoring the input classes#385
Merged
R0drigoSchwartz merged 160 commits intodata_managerfrom Apr 14, 2026
Merged
Conversation
…e acoustic element type UI
vitorslongo
reviewed
Apr 13, 2026
Collaborator
vitorslongo
left a comment
There was a problem hiding this comment.
The previous issues were not completely related to the specific work you've made here Rodrigo, but they were corrected by Jacson in his last commits, so you can ignore my previous comments. Keep up the good work!
vitorslongo
approved these changes
Apr 13, 2026
Collaborator
vitorslongo
left a comment
There was a problem hiding this comment.
Good Job, everything seems to be working nicely.
…er when an importation is in progress
… into input_classes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request contains the refactoring of the input classes.
Since I started to navegate into these classes I noticed that they had a lot of common methods, because when I need to modify something, I had to apply the modification in a lot of different files, that is a little painful. To minimize this replication, I developed hierarchical classes that can be inherited by the input classes.
The hierarchical structure is organized as follows:
This is the top-level class, from which all other lower classes in the hierarchical structure inherit. It's has some basic methods, like configure the window, paint icons and load tables.
To the other classes, I tried to separate them by their input type (nodes, lines and elements).
To the nodal inputs, I created the
NodesInputclass:This class contains the common methods for inputs that interact with nodes. It also contains some property assignments and methods for removing nodal properties, for example.
Since that we have a lof of inputs that works with nodes, I identified two types of classes that can specialize the
NodesInputclass:These classes have some particularities, according to their physical domain (structural or acoustic).
To the lines input, I created the
LinesInputand theStructuralLinesInputclasses:I didn't create an
AcousticLinesInputclass, since that the classes that works with lines from this physical domain don't have common methods.To finish, I created the
ElementInputclass:This class has just some basic property assignments, because the element classes aren't very common.
Below is a list of which classes inherit from which classes:
UserInput: NodesInput, LinesInput, ElementsInput, AddAcousticTransferElementInput, SetInertialLoadInput and StressStiffeningInput.
NodesInput: AcousticNodesInput, StructuralNodesInput.
AcousticNodesInput: AcousticPressureInput, RadiationImpedanceInput, ReciprocatingCompressorInputs, ReciprocatingPumpInputs, SpecificImpedanceInput and VolumeVelocityInput.
StructuralNodesInput: ElasticNodalLinksInput, MassSpringDamperInput, NodalLoadsInput and PrescribedDofInput.
LinesInput: AcousticElementTypeInput and StructuralLinesInput.
StructuralLinesInput: BeamXaxisRotationInput, ExpansionJointInput and ValvesInput.
ElementsInput: PerforatedPlateInput, TurnOffAcousticElementsInput and DecouplingRotationDofsInput.
This approach can be useful for reducing code duplication and centralizing certain methods. Now, if we have to fix something in these classes, maybe we don't need to apply the fix in a lot of different places.
This is not the final version. I believe that, over time, we can improve this approach by implementing more methods in these classes and refactoring the old methods to reuse them.
Note: This branch was created from the data_manager branch. This week I will create the PR of this branch, that will be merged first into dev branch. So disregard the modifications that that are not specifically related to user input classes. I know it's not a good practice, but I wanted to create this pull request early to discuss with you.