-
Notifications
You must be signed in to change notification settings - Fork 0
Rmanno/refactor with visitor #420
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
base: rmanno/trial_protocol_write
Are you sure you want to change the base?
Rmanno/refactor with visitor #420
Conversation
|
@koubaa What do you think? I have found that some material models have some patterns for being written in similar ways so I have impemented the visit_material_model directly within the specific class. This works only for density and isotropic elasticity as it is just a prototype. |
| def __init__(self, materials: list[Material]): | ||
| """Initialize the base visitor.""" | ||
| self._materials = materials | ||
| self._material_repr: dict = {material.name: [] for material in materials} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what _material_repr is meant to represent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not repr. Just an intermediate solver representation of the material obtained from the visit. That is then handled by the write method to complete the representation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could imagine a visitor that doesn't produce any representation, for instance a validation visitor
|
I left a few comments - but I agree with the overall direction |
No description provided.