Skip to content

Conversation

@rmanno91
Copy link
Collaborator

No description provided.

@github-actions github-actions bot added the enhancement New features or code improvements label Oct 29, 2025
@rmanno91
Copy link
Collaborator Author

@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.
The maml_name and mapdl_name and so on will disappear from the pydantic field definition and will be contained in the MATERIAL_MODEL_MAP within the specific visitor.
As some model are a bit more complicated to define in each solver I have added in the ModelInfo a method attribute. This could contain the name of a method to call to fit the labels and attributes for the specific solver.

def __init__(self, materials: list[Material]):
"""Initialize the base visitor."""
self._materials = materials
self._material_repr: dict = {material.name: [] for material in materials}
Copy link
Contributor

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

Copy link
Collaborator Author

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.

Copy link
Contributor

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

@koubaa
Copy link
Contributor

koubaa commented Oct 29, 2025

I left a few comments - but I agree with the overall direction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New features or code improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants