BAMresearch / fenics-constitutive

Complex constitutive models beyond the FEniCS UFL.
https://bamresearch.github.io/fenics-constitutive
MIT License
12 stars 2 forks source link

Simplify the return type of `IncrSmallStrainModel.history_dim()` #48

Closed srosenbu closed 6 months ago

srosenbu commented 6 months ago

My thought process behind the return type

def history_dim(self) -> int | dict[str, int | tuple[int, int]] | None:
        ...

was that

Now, I noticed that handling 3 cases each time something is done to the history, produces a lot of ugly boilerplate code, so I would propose

def history_dim(self) -> dict[str, int | tuple[int, int]] | None:
        ...

and case 1. can be handled by sth. like {"umat_history": n_hist}.

@pdiercks , @aradermacher , @saifr68 , what do you think?

pdiercks commented 6 months ago

Sounds reasonable. I do not see a problem with that.