adtzlr / matadi

Material Definition with Automatic Differentiation
GNU General Public License v3.0
21 stars 2 forks source link

Add isotropic linear-elastic function for `MaterialHyperelastic` #58

Closed adtzlr closed 2 years ago

adtzlr commented 2 years ago

Although a bit of an overkill; implement a linear-elastic strain energy function which can be used in MaterialHyperelastic. It takes the symmetric part of the displacement gradient as strain variable, on which a quadratic potential is described.

Code:

from matadi import MaterialHyperelastic
from matadi.math import eye, sym, trace

def linear_elastic(F, mu, lmbda):
    strain = sym(F - eye(3))
    return mu * trace(strain @ strain) + lmbda / 2 * trace(strain) ** 2

mat = MaterialHyperelastic(fun=linear_elastic, mu=1.0, lmbda=2.0)

TODO: