KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.02k stars 245 forks source link

[GeoMechanicsApplication] Extract list for constitutive matrices and stress vectors #12380

Closed rfaasse closed 4 months ago

rfaasse commented 4 months ago

📝 Description This PR extracts lists for constitutive matrices and stress vectors. In doing so we add two identical functions to diff order and to the non-diff order element, but we reduce a lot of other duplicated code. If anyone has ideas how to extract something generic here, please let me know. I think it would mean we need to pass on the constitutive laws and maybe make a vector of constitutive parameters and pass that on to make a separate utility function, but that's open for discussion.

rfaasse commented 4 months ago

Richard, a very useful step to improve the structure and to make functions more uniform. However, for my understand of the code it will be useful to split CalculateAnyOfMaterialResponse into three functions. What is your opinion? It can be next PR.

@markelov208 I fully agree with this observation and would have preferred 3 functions as well (I would really like to decouple this). However, we are bound by the Constitutive Law interface which does all three at the same time in the CalculateMaterialResponseCauchy via the ConstitutiveLaw::Parameters&, so at this moment, I don't see a way to achieve this without doing the same calculation multiple times.