Skip to content
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

Removing Constraint from the interface #44

Open
srosenbu opened this issue Jan 30, 2024 · 0 comments
Open

Removing Constraint from the interface #44

srosenbu opened this issue Jan 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@srosenbu
Copy link
Member

Maybe it would be a good idea to remove the Constraint enum from the interface to make it easier to write constitutive models in other languages. If I wanted to write a model in Rust, I would probably implement the methods evaluate and history_dim and then write a wrapper

class ModelWrapper:
    def __init__(self, rust_model):
        self.rust_model = rust_model
    def constraint():
        return Constraint.PLANE_STRAIN
    def evaluate(...):
        self.rust_model.evaluate(...)
    def history_dim(...):
        self.rust_model.history_dim()
    ...

We should still keep the stress_strain_dim geometric_dim and history_dim methods, but constraint could just return a string.

Example:

class SomeModel:
    ...
    def constraint(self) -> str:
        return "PLANE_STRAIN"

The advantage would be that with this change any constitutive model would only need to handle np.ndarray and str and maybe dict as complex data types.

@srosenbu srosenbu added the enhancement New feature or request label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant