Materials with Automatic Differentiation (JAX)#

This page contains material model formulations with automatic differentiation using jax.

注釈

The number of local XLA devices available must be greater or equal the number of the parallel-mapped axis, i.e. the number of quadrature points per cell when used in Material and Hyperelastic along with parallel=True. To use the multiple cores of a CPU device as multiple local XLA devices, the XLA device count must be defined at startup.

import os

os.environ["XLA_FLAGS"] = "--xla_force_host_platform_device_count=4"

警告

JAX uses single-precision (32bit) data types by default. This requires to relax the tolerance of newtonraphson() to tol=1e-4. If required, JAX may be enforced to use double-precision at startup,

import jax

jax.config.update("jax_enable_x64", True)

Frameworks

Hyperelastic(fun[, nstatevars, jit, parallel])

A hyperelastic material definition with a given function for the strain energy density function per unit undeformed volume with Automatic Differentiation provided by jax.

Material(fun[, nstatevars, jit, parallel, ...])

A material definition with a given function for the partial derivative of the strain energy function w.r.t.

total_lagrange(material)

Decorate a second Piola-Kirchhoff stress Total-Lagrange material formulation as a first Piola-Kirchoff stress function.

updated_lagrange(material)

Decorate a Cauchy-stress Updated-Lagrange material formulation as a first Piola- Kirchoff stress function.

Material Models for felupe.constitution.jax.Hyperelastic

These material model formulations are defined by a strain energy density function.

blatz_ko(C, mu)

Strain energy function of the Blatz-Ko isotropic hyperelastic foam material formulation [1]_.

extended_tube(C, Gc, delta, Ge, beta)

Strain energy function of the isotropic hyperelastic Extended Tube [1]_ material formulation.

miehe_goektepe_lulei(C, mu, N, U, p, q)

Strain energy function of the isotropic hyperelastic micro-sphere model formulation [1]_.

mooney_rivlin(C, C10, C01)

Strain energy function of the isotropic hyperelastic Mooney-Rivlin material formulation.

neo_hooke(C, mu)

Strain energy function of the isotropic hyperelastic Neo-Hookean material formulation.

ogden(C, mu, alpha)

Strain energy function of the isotropic hyperelastic Ogden material formulation.

storakers(C, mu, alpha, beta)

Strain energy function of the Storåkers isotropic hyperelastic foam material formulation [1]_.

third_order_deformation(C, C10, C01, C11, ...)

Strain energy function of the isotropic hyperelastic Third-Order-Deformation material formulation.

van_der_waals(C, mu, limit, a, beta)

Strain energy function of the Van der Waals [1]_ material formulation.

yeoh(C, C10, C20, C30)

Strain energy function of the isotropic hyperelastic Yeoh material formulation.

Material Models for felupe.constitution.jax.Material

The material model formulations are defined by the first Piola-Kirchhoff stress tensor. Function-decorators are available to use Total-Lagrange and Updated-Lagrange material formulations in Material.

becker(F, mu, lmbda)

Second Piola-Kirchhoff stress tensor of Becker's logarithmic material model formulation [1]_ [2]_.

morph(F, statevars, p)

Second Piola-Kirchhoff stress tensor of the MORPH model formulation [1]_.

morph_representative_directions(F, ...)

First Piola-Kirchhoff stress tensor of the MORPH model formulation [1]_, implemented by the concept of representative directions [2]_, [3].

Tools

vmap(fun[, in_axes, out_axes, method])

Vectorizing map.

Detailed API Reference

class felupe.constitution.jax.Hyperelastic(fun, nstatevars=0, jit=True, parallel=False, **kwargs)[ソース]#

A hyperelastic material definition with a given function for the strain energy density function per unit undeformed volume with Automatic Differentiation provided by jax.

パラメータ:
  • fun (callable) -- A strain energy density function in terms of the right Cauchy-Green deformation tensor \(\boldsymbol{C}\). Function signature must be fun = lambda C, **kwargs: psi for functions without state variables and fun = lambda C, statevars, **kwargs: [psi, statevars_new] for functions with state variables. It is important to use only differentiable math-functions from jax.

  • nstatevars (int, optional) -- Number of state variables (default is 0).

  • jit (bool, optional) -- A flag to invoke just-in-time compilation (default is True).

  • parallel (bool, optional) -- A flag to invoke parallel strain energy density function evaluations (default is False). If True, the quadrature points are executed in parallel. The number of devices must be greater or equal the number of quadrature points per cell.

  • **kwargs (dict, optional) -- Optional keyword-arguments for the strain energy density function.

メモ

The strain energy density function \(\psi\) must be given in terms of the right Cauchy-Green deformation tensor \(\boldsymbol{C} = \boldsymbol{F}^T \boldsymbol{F}\).

警告

It is important to use only differentiable math-functions from jax!

Take this minimal code-block as template

\[\psi = \psi(\boldsymbol{C})\]
import felupe as fem
import felupe.constitution.jax as mat
import jax.numpy as jnp

def neo_hooke(C, mu):
    "Strain energy function of the Neo-Hookean material formulation."
    return mu / 2 * (jnp.linalg.det(C) ** (-1/3) * jnp.trace(C) - 3)

umat = mat.Hyperelastic(neo_hooke, mu=1)

and this code-block for material formulations with state variables.

\[\psi = \psi(\boldsymbol{C}, \boldsymbol{\zeta})\]
import felupe as fem
import felupe.constitution.jax as mat
import jax.numpy as jnp

def viscoelastic(C, Cin, mu, eta, dtime):
    "Finite strain viscoelastic material formulation."

    # unimodular part of the right Cauchy-Green deformation tensor
    Cu = jnp.linalg.det(C) ** (-1 / 3) * C

    # update of state variables by evolution equation
    Ci = Cin.reshape(3, 3) + mu / eta * dtime * Cu
    Ci = jnp.linalg.det(Ci) ** (-1 / 3) * Ci

    # first invariant of elastic part of right Cauchy-Green deformation tensor
    I1 = jnp.trace(Cu @ jnp.linalg.inv(Ci))

    # strain energy function and state variable
    return mu / 2 * (I1 - 3), Ci.ravel()

umat = mat.Hyperelastic(viscoelastic, mu=1, eta=1, dtime=1, nstatevars=9)

注釈

See the documentation of JAX for further details. JAX uses single-precision (32bit) data types by default. This requires to relax the tolerance of newtonraphson() to tol=1e-4. If required, JAX may be enforced to use double-precision at startup with jax.config.update("jax_enable_x64", True).

サンプル

View force-stretch curves on elementary incompressible deformations.

>>> import felupe as fem
>>> import felupe.constitution.jax as mat
>>> import jax.numpy as jnp
>>>
>>> def neo_hooke(C, mu):
...     "Strain energy function of the Neo-Hookean material formulation."
...     return mu / 2 * (jnp.linalg.det(C) ** (-1/3) * jnp.trace(C) - 3)
>>>
>>> umat = mat.Hyperelastic(neo_hooke, mu=1)
>>> ax = umat.plot(incompressible=True)
../../../_images/jax-1.png
copy()#

Return a deep-copy of the constitutive material.

gradient(x)#

Return the evaluated gradient of the strain energy density function.

パラメータ:

x (list of ndarray) -- The list with input arguments. These contain the extracted fields of a FieldContainer along with the old vector of state variables, [*field.extract(), statevars_old].

戻り値:

A list with the evaluated gradient(s) of the strain energy density function and the updated vector of state variables.

戻り値の型:

list of ndarray

hessian(x)#

Return the evaluated upper-triangle components of the hessian(s) of the strain energy density function.

パラメータ:

x (list of ndarray) -- The list with input arguments. These contain the extracted fields of a FieldContainer along with the old vector of state variables, [*field.extract(), statevars_old].

戻り値:

A list with the evaluated upper-triangle components of the hessian(s) of the strain energy density function.

戻り値の型:

list of ndarray

is_stable(x, hessian=None)#

Return a boolean mask for stability of isotropic material model formulations.

At a given deformation gradient, a normal force is applied on each principal stretch direction. If the resulting incremental stretches are positive, the material model formulation is considered to be stable at the given deformation gradient.

パラメータ:
  • x (list of ndarray) -- The list with input arguments. These contain the extracted fields of a FieldContainer.

  • hessian (ndarray or None, optional) -- Second partial derivative of the strain energy density function w.r.t. the deformation gradient. Default is None.

戻り値:

Boolean mask of stability.

戻り値の型:

ndarray

メモ

警告

This stability check will lead to a singular matrix for isotropic (hyperelastic) material model formulations without a volumetric part.

サンプル

First, let's check the stability of the Neo-Hookean material model formulation. The stability is evaluated on (valid) principal stretches of a biaxial deformation. All deformations are stable.

>>> import numpy as np
>>> import felupe as fem
>>>
>>> umat = fem.NeoHooke(mu=1.0, bulk=2.0)
>>> view = umat.view()
>>> λ = view.biaxial()[0]
>>>
>>> F = np.zeros((3, 3, 1, λ[0].size))
>>> for a in range(3):
...     F[a, a] = λ[a]
>>>
>>> umat.is_stable([F])
array([[ True,  True,  True,  True,  True,  True,  True,  True,  True,
         True,  True,  True,  True,  True,  True,  True]])

Now, let's check the stability of the Mooney-Rivlin material model formulation. The stability is evaluated on (valid) principal stretches of a biaxial deformation. Biaxial deformations are only stable up to a longitudinal stretch of 1.35.

>>> import numpy as np
>>> import felupe as fem
>>> import felupe.constitution.tensortrax as mat
>>>
>>> umat = fem.Hyperelastic(
...     mat.models.hyperelastic.mooney_rivlin,
...     C10=0.25,
...     C01=0.25,
... ) & fem.Volumetric(bulk=5000)
>>> view = umat.view()
>>> λ = view.biaxial()[0]
>>>
>>> F = np.zeros((3, 3, 1, λ[0].size))
>>> for a in range(3):
...     F[a, a] = λ[a]
>>>
>>> umat.is_stable([F])
array([[ True,  True,  True,  True,  True,  True,  True,  True, False,
        False, False, False, False, False, False, False]])
optimize(ux=None, ps=None, bx=None, incompressible=False, relative=False, **kwargs)#

Optimize the material parameters by a least-squares fit on experimental stretch-stress data.

パラメータ:
  • ux (array of shape (2, ...) or None, optional) -- Experimental uniaxial stretch and force-per-undeformed-area data (default is None).

  • ps (array of shape (2, ...) or None, optional) -- Experimental planar-shear stretch and force-per-undeformed-area data (default is None).

  • bx (array of shape (2, ...) or None, optional) -- Experimental biaxial stretch and force-per-undeformed-area data (default is None).

  • incompressible (bool, optional) -- A flag to enforce incompressible deformations (default is False).

  • relative (bool, optional) -- A flag to optimize relative instead of absolute residuals, i.e. (predicted - observed) / observed instead of predicted - observed (default is False).

  • **kwargs (dict, optional) -- Optional keyword arguments are passed to scipy.optimize.least_squares().

戻り値:

  • ConstitutiveMaterial -- A copy of the constitutive material with the optimized material parameters.

  • scipy.optimize.OptimizeResult -- Represents the optimization result.

メモ

警告

At least one load case, i.e. one of the arguments ux, ps or bx must not be None.

注釈

For JAX-based materials, double-precision is required to optimize material parameters.

import jax

jax.config.update("jax_enable_x64", True)

The vector of residuals is given in Eq. (3) in case of absolute residuals

(1)#\[ \begin{align}\begin{aligned}\begin{split}\boldsymbol{r} &= \begin{bmatrix} \boldsymbol{r}_\text{ux} \\ \boldsymbol{r}_\text{ps} \\ \boldsymbol{r}_\text{bx} \end{bmatrix}\end{split}\\r_\text{ux}(\lambda_i) &= P_\text{ux}(\lambda_i) - P_\text{ux, observed}(\lambda_i)\\r_\text{ps}(\lambda_i) &= P_\text{ps}(\lambda_i) - P_\text{ps, observed}(\lambda_i)\\r_\text{bx}(\lambda_i) &= P_\text{bx}(\lambda_i) - P_\text{bx, observed}(\lambda_i)\end{aligned}\end{align} \]

and in Eq. (4) in case of relative residuals.

(2)#\[ \begin{align}\begin{aligned}\begin{split}\boldsymbol{r} &= \begin{bmatrix} \boldsymbol{r}_\text{ux} \\ \boldsymbol{r}_\text{ps} \\ \boldsymbol{r}_\text{bx} \end{bmatrix}\end{split}\\r_\text{ux}(\lambda_i) &= \frac{ P_\text{ux}(\lambda_i) - P_\text{ux, observed}(\lambda_i)}{ P_\text{ux, observed}(\lambda_i) }\\r_\text{ps}(\lambda_i) &= \frac{ P_\text{ps}(\lambda_i) - P_\text{ps, observed}(\lambda_i)}{ P_\text{ps, observed}(\lambda_i) }\\r_\text{bx}(\lambda_i) &= \frac{ P_\text{bx}(\lambda_i) - P_\text{bx, observed}(\lambda_i)}{ P_\text{bx, observed}(\lambda_i) }\end{aligned}\end{align} \]

サンプル

The Anssari-Benam Bucchi material model formulation is best-fitted on Treloar's uniaxial and biaxial tension data [1]_.

>>> import numpy as np
>>> import felupe as fem
>>>
>>> λ, P = np.array(
...     [
...         [1.000, 0.00],
...         [1.240, 2.30],
...         [1.585, 4.16],
...         [2.180, 6.00],
...         [3.020, 8.80],
...         [4.030, 12.5],
...         [4.760, 16.2],
...         [5.750, 23.6],
...         [6.850, 38.5],
...         [7.250, 49.6],
...         [7.600, 64.4],
...     ]
... ).T * np.array([[1.0], [0.0980665]])
>>>
>>> umat = fem.Hyperelastic(fem.anssari_benam_bucchi)
>>> umat_new, res = umat.optimize(
...     ux=[λ, P], incompressible=True, relative=True
... )
>>>
>>> ux = np.linspace(λ.min(), λ.max(), num=50)
>>> ax = umat_new.plot(incompressible=True, ux=ux, bx=None, ps=None)
>>> ax.plot(λ, P, "C0x")
../../../_images/jax-4.png

参考

scipy.optimize.least_squares

Solve a nonlinear least-squares problem with bounds on the variables.

参照

plot(incompressible=False, **kwargs)#

Return a plot with normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

パラメータ:
戻り値の型:

matplotlib.axes.Axes

参考

felupe.ViewMaterial

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

felupe.ViewMaterialIncompressible

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

screenshot(filename='umat.png', incompressible=False, **kwargs)#

Save a screenshot with normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

パラメータ:
  • filename (str, optional) -- The filename of the screenshot (default is "umat.png").

  • incompressible (bool, optional) -- A flag to enforce views on incompressible deformations (default is False).

  • **kwargs (dict, optional) -- Optional keyword-arguments for ViewMaterial or ViewMaterialIncompressible.

戻り値の型:

matplotlib.axes.Axes

参考

felupe.ViewMaterial

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

felupe.ViewMaterialIncompressible

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

view(incompressible=False, **kwargs)#

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

パラメータ:
戻り値の型:

felupe.ViewMaterial or felupe.ViewMaterialIncompressible

参考

felupe.ViewMaterial

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

felupe.ViewMaterialIncompressible

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

class felupe.constitution.jax.Material(fun, nstatevars=0, jit=True, parallel=False, jacobian=None, **kwargs)[ソース]#

A material definition with a given function for the partial derivative of the strain energy function w.r.t. the deformation gradient tensor with Automatic Differentiation provided by jax.

パラメータ:
  • fun (callable) -- A gradient of the strain energy density function w.r.t. the deformation gradient tensor \(\boldsymbol{F}\). Function signature must be fun = lambda F, **kwargs: P for functions without state variables and fun = lambda F, statevars, **kwargs: [P, statevars_new] for functions with state variables. It is important to use only differentiable math-functions from jax.

  • nstatevars (int, optional) -- Number of state variables (default is 0).

  • jit (bool, optional) -- A flag to invoke just-in-time compilation (default is True).

  • parallel (bool, optional) -- A flag to invoke parallel function evaluations (default is False). If True, the quadrature points are executed in parallel. The number of devices must be greater or equal the number of quadrature points per cell.

  • jacobian (callable or None, optional) -- A callable for the Jacobian. Default is None, where jax.jacobian() is used. This may be used to switch to forward-mode differentian jax.jacfwd().

  • **kwargs (dict, optional) -- Optional keyword-arguments for the gradient of the strain energy density function.

メモ

The gradient of the strain energy density function \(\frac{\partial \psi}{\partial \boldsymbol{F}}\) must be given in terms of the deformation gradient tensor \(\boldsymbol{F}\).

警告

It is important to use only differentiable math-functions from jax!

Take this code-block as template

import felupe as fem
import felupe.constitution.jax as mat
import jax.numpy as jnp

def neo_hooke(F, mu):
    "First Piola-Kirchhoff stress of the Neo-Hookean material formulation."

    C = F.T @ F
    Cu = jnp.linalg.det(C) ** (-1/3) * C
    dev = lambda C: C - jnp.trace(C) / 3 * jnp.eye(3)

    return mu * F @ dev(Cu) @ jnp.linalg.inv(C)

umat = mat.Material(neo_hooke, mu=1)

and this code-block for material formulations with state variables:

import felupe as fem
import felupe.constitution.jax as mat
import jax.numpy as jnp

def viscoelastic(F, Cin, mu, eta, dtime):
    "Finite strain viscoelastic material formulation."

    # unimodular part of the right Cauchy-Green deformation tensor
    C = F.T @ F
    Cu = jnp.linalg.det(C) ** (-1 / 3) * C

    # update of state variables by evolution equation
    from_triu = lambda C: C[jnp.array([[0, 1, 2], [1, 3, 4], [2, 4, 5]])]
    Ci = from_triu(Cin) + mu / eta * dtime * Cu
    Ci = jnp.linalg.det(Ci) ** (-1 / 3) * Ci

    # second Piola-Kirchhoff stress tensor
    dev = lambda C: C - jnp.trace(C) / 3 * jnp.eye(3)
    S = mu * dev(Cu @ jnp.linalg.inv(Ci)) @ jnp.linalg.inv(C)

    # first Piola-Kirchhoff stress tensor and state variable
    i, j = jnp.triu_indices(3)
    to_triu = lambda C: C[i, j]
    return F @ S, to_triu(Ci)

umat = mat.Material(viscoelastic, mu=1, eta=1, dtime=1, nstatevars=6)

注釈

See the documentation of JAX for further details. JAX uses single-precision (32bit) data types by default. This requires to relax the tolerance of newtonraphson() to tol=1e-4. If required, JAX may be enforced to use double-precision at startup with jax.config.update("jax_enable_x64", True).

サンプル

View force-stretch curves on elementary incompressible deformations.

>>> import felupe as fem
>>> import felupe.constitution.jax as mat
>>> import jax.numpy as jnp
>>>
>>> def neo_hooke(F, mu):
...     "First Piola-Kirchhoff stress of the Neo-Hookean material formulation."
...
...     C = F.T @ F
...     Cu = jnp.linalg.det(C) ** (-1/3) * C
...     dev = lambda C: C - jnp.trace(C) / 3 * jnp.eye(3)
...
...     return mu * F @ dev(Cu) @ jnp.linalg.inv(C)
>>>
>>> umat = mat.Material(neo_hooke, mu=1)
>>> ax = umat.plot(incompressible=True)
../../../_images/jax-5.png
copy()#

Return a deep-copy of the constitutive material.

gradient(x)[ソース]#

Return the evaluated gradient of the strain energy density function.

パラメータ:

x (list of ndarray) -- The list with input arguments. These contain the extracted fields of a FieldContainer along with the old vector of state variables, [*field.extract(), statevars_old].

戻り値:

A list with the evaluated gradient(s) of the strain energy density function and the updated vector of state variables.

戻り値の型:

list of ndarray

hessian(x)[ソース]#

Return the evaluated upper-triangle components of the hessian(s) of the strain energy density function.

パラメータ:

x (list of ndarray) -- The list with input arguments. These contain the extracted fields of a FieldContainer along with the old vector of state variables, [*field.extract(), statevars_old].

戻り値:

A list with the evaluated upper-triangle components of the hessian(s) of the strain energy density function.

戻り値の型:

list of ndarray

is_stable(x, hessian=None)#

Return a boolean mask for stability of isotropic material model formulations.

At a given deformation gradient, a normal force is applied on each principal stretch direction. If the resulting incremental stretches are positive, the material model formulation is considered to be stable at the given deformation gradient.

パラメータ:
  • x (list of ndarray) -- The list with input arguments. These contain the extracted fields of a FieldContainer.

  • hessian (ndarray or None, optional) -- Second partial derivative of the strain energy density function w.r.t. the deformation gradient. Default is None.

戻り値:

Boolean mask of stability.

戻り値の型:

ndarray

メモ

警告

This stability check will lead to a singular matrix for isotropic (hyperelastic) material model formulations without a volumetric part.

サンプル

First, let's check the stability of the Neo-Hookean material model formulation. The stability is evaluated on (valid) principal stretches of a biaxial deformation. All deformations are stable.

>>> import numpy as np
>>> import felupe as fem
>>>
>>> umat = fem.NeoHooke(mu=1.0, bulk=2.0)
>>> view = umat.view()
>>> λ = view.biaxial()[0]
>>>
>>> F = np.zeros((3, 3, 1, λ[0].size))
>>> for a in range(3):
...     F[a, a] = λ[a]
>>>
>>> umat.is_stable([F])
array([[ True,  True,  True,  True,  True,  True,  True,  True,  True,
         True,  True,  True,  True,  True,  True,  True]])

Now, let's check the stability of the Mooney-Rivlin material model formulation. The stability is evaluated on (valid) principal stretches of a biaxial deformation. Biaxial deformations are only stable up to a longitudinal stretch of 1.35.

>>> import numpy as np
>>> import felupe as fem
>>> import felupe.constitution.tensortrax as mat
>>>
>>> umat = fem.Hyperelastic(
...     mat.models.hyperelastic.mooney_rivlin,
...     C10=0.25,
...     C01=0.25,
... ) & fem.Volumetric(bulk=5000)
>>> view = umat.view()
>>> λ = view.biaxial()[0]
>>>
>>> F = np.zeros((3, 3, 1, λ[0].size))
>>> for a in range(3):
...     F[a, a] = λ[a]
>>>
>>> umat.is_stable([F])
array([[ True,  True,  True,  True,  True,  True,  True,  True, False,
        False, False, False, False, False, False, False]])
optimize(ux=None, ps=None, bx=None, incompressible=False, relative=False, **kwargs)#

Optimize the material parameters by a least-squares fit on experimental stretch-stress data.

パラメータ:
  • ux (array of shape (2, ...) or None, optional) -- Experimental uniaxial stretch and force-per-undeformed-area data (default is None).

  • ps (array of shape (2, ...) or None, optional) -- Experimental planar-shear stretch and force-per-undeformed-area data (default is None).

  • bx (array of shape (2, ...) or None, optional) -- Experimental biaxial stretch and force-per-undeformed-area data (default is None).

  • incompressible (bool, optional) -- A flag to enforce incompressible deformations (default is False).

  • relative (bool, optional) -- A flag to optimize relative instead of absolute residuals, i.e. (predicted - observed) / observed instead of predicted - observed (default is False).

  • **kwargs (dict, optional) -- Optional keyword arguments are passed to scipy.optimize.least_squares().

戻り値:

  • ConstitutiveMaterial -- A copy of the constitutive material with the optimized material parameters.

  • scipy.optimize.OptimizeResult -- Represents the optimization result.

メモ

警告

At least one load case, i.e. one of the arguments ux, ps or bx must not be None.

注釈

For JAX-based materials, double-precision is required to optimize material parameters.

import jax

jax.config.update("jax_enable_x64", True)

The vector of residuals is given in Eq. (3) in case of absolute residuals

(3)#\[ \begin{align}\begin{aligned}\begin{split}\boldsymbol{r} &= \begin{bmatrix} \boldsymbol{r}_\text{ux} \\ \boldsymbol{r}_\text{ps} \\ \boldsymbol{r}_\text{bx} \end{bmatrix}\end{split}\\r_\text{ux}(\lambda_i) &= P_\text{ux}(\lambda_i) - P_\text{ux, observed}(\lambda_i)\\r_\text{ps}(\lambda_i) &= P_\text{ps}(\lambda_i) - P_\text{ps, observed}(\lambda_i)\\r_\text{bx}(\lambda_i) &= P_\text{bx}(\lambda_i) - P_\text{bx, observed}(\lambda_i)\end{aligned}\end{align} \]

and in Eq. (4) in case of relative residuals.

(4)#\[ \begin{align}\begin{aligned}\begin{split}\boldsymbol{r} &= \begin{bmatrix} \boldsymbol{r}_\text{ux} \\ \boldsymbol{r}_\text{ps} \\ \boldsymbol{r}_\text{bx} \end{bmatrix}\end{split}\\r_\text{ux}(\lambda_i) &= \frac{ P_\text{ux}(\lambda_i) - P_\text{ux, observed}(\lambda_i)}{ P_\text{ux, observed}(\lambda_i) }\\r_\text{ps}(\lambda_i) &= \frac{ P_\text{ps}(\lambda_i) - P_\text{ps, observed}(\lambda_i)}{ P_\text{ps, observed}(\lambda_i) }\\r_\text{bx}(\lambda_i) &= \frac{ P_\text{bx}(\lambda_i) - P_\text{bx, observed}(\lambda_i)}{ P_\text{bx, observed}(\lambda_i) }\end{aligned}\end{align} \]

サンプル

The Anssari-Benam Bucchi material model formulation is best-fitted on Treloar's uniaxial and biaxial tension data [1]_.

>>> import numpy as np
>>> import felupe as fem
>>>
>>> λ, P = np.array(
...     [
...         [1.000, 0.00],
...         [1.240, 2.30],
...         [1.585, 4.16],
...         [2.180, 6.00],
...         [3.020, 8.80],
...         [4.030, 12.5],
...         [4.760, 16.2],
...         [5.750, 23.6],
...         [6.850, 38.5],
...         [7.250, 49.6],
...         [7.600, 64.4],
...     ]
... ).T * np.array([[1.0], [0.0980665]])
>>>
>>> umat = fem.Hyperelastic(fem.anssari_benam_bucchi)
>>> umat_new, res = umat.optimize(
...     ux=[λ, P], incompressible=True, relative=True
... )
>>>
>>> ux = np.linspace(λ.min(), λ.max(), num=50)
>>> ax = umat_new.plot(incompressible=True, ux=ux, bx=None, ps=None)
>>> ax.plot(λ, P, "C0x")
../../../_images/jax-8.png

参考

scipy.optimize.least_squares

Solve a nonlinear least-squares problem with bounds on the variables.

参照

plot(incompressible=False, **kwargs)#

Return a plot with normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

パラメータ:
戻り値の型:

matplotlib.axes.Axes

参考

felupe.ViewMaterial

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

felupe.ViewMaterialIncompressible

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

screenshot(filename='umat.png', incompressible=False, **kwargs)#

Save a screenshot with normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

パラメータ:
  • filename (str, optional) -- The filename of the screenshot (default is "umat.png").

  • incompressible (bool, optional) -- A flag to enforce views on incompressible deformations (default is False).

  • **kwargs (dict, optional) -- Optional keyword-arguments for ViewMaterial or ViewMaterialIncompressible.

戻り値の型:

matplotlib.axes.Axes

参考

felupe.ViewMaterial

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

felupe.ViewMaterialIncompressible

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

view(incompressible=False, **kwargs)#

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

パラメータ:
戻り値の型:

felupe.ViewMaterial or felupe.ViewMaterialIncompressible

参考

felupe.ViewMaterial

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

felupe.ViewMaterialIncompressible

Create views on normal force per undeformed area vs. stretch curves for the elementary homogeneous incompressible deformations uniaxial tension/compression, planar shear and biaxial tension of a given isotropic material formulation.

felupe.constitution.jax.total_lagrange(material)[ソース]#

Decorate a second Piola-Kirchhoff stress Total-Lagrange material formulation as a first Piola-Kirchoff stress function.

メモ

The Green-Lagrange strain tensor and its first variation are given in Eq. (7).

(5)#\[ \begin{align}\begin{aligned}\boldsymbol{E} &= \frac{1}{2} \left( \boldsymbol{F}^T \boldsymbol{F} - \boldsymbol{1} \right)\\\delta \boldsymbol{E} &= \frac{1}{2} \left( \delta \boldsymbol{F}^T \boldsymbol{F} + \boldsymbol{F}^T \delta \boldsymbol{F} \right)\end{aligned}\end{align} \]

This will lead to the variations of the strain energy density function per unit undeformed volume, see Eq. (8).

(6)#\[ \begin{align}\begin{aligned}\delta \psi &= \boldsymbol{S} : \delta \boldsymbol{E}\\\delta \psi &= \boldsymbol{F} \boldsymbol{S} : \delta \boldsymbol{F}\end{aligned}\end{align} \]

Finally, the first Piola-Kirchhoff stress tensor is given by Eq. (14).

(7)#\[\boldsymbol{P} = \boldsymbol{F} \boldsymbol{S}\]

サンプル

>>> import felupe as fem
>>> import felupe.constitution.jax as mat
>>> import jax.numpy as jnp
>>>
>>> @mat.total_lagrange
>>> def neo_hooke_total_lagrange(F, mu=1):
>>>     C = F.T @ F
>>>     dev = lambda C: C - jnp.trace(C) / 3 * jnp.eye(3)
>>>     S = mu * dev(jnp.linalg.det(C)**(-1/3) * C) @ jnp.linalg.inv(C)
>>>     return S
>>>
>>> umat = mat.Material(neo_hooke_total_lagrange, mu=1)

参考

felupe.constitution.jax.Hyperelastic

A hyperelastic material definition with a given function for the strain energy density function per unit undeformed volume with Automatic Differentiation provided by jax.

felupe.constitution.jax.Material

A material definition with a given function for the partial derivative of the strain energy function w.r.t. the deformation gradient tensor with Automatic Differentiation provided by jax.

felupe.constitution.jax.updated_lagrange(material)[ソース]#

Decorate a Cauchy-stress Updated-Lagrange material formulation as a first Piola- Kirchoff stress function.

メモ

The equilibrium equations for statics are given in Eq. (10).

(8)#\[\operatorname{div} \boldsymbol{\sigma} + \boldsymbol{b} = \boldsymbol{0}\]

The weak form of the equilibrium equations for statics is given in Eq. (11).

(9)#\[ \begin{align}\begin{aligned}\int_v \operatorname{div} \boldsymbol{\sigma} \cdot \delta \boldsymbol{u} \ \mathrm{d}v + \int_v \boldsymbol{b} \cdot \delta \boldsymbol{u} \ \mathrm{d}v &= 0\\- \int_v \boldsymbol{\sigma} : \frac{\partial \delta \boldsymbol{u}}{\partial \boldsymbol{x}} \ \mathrm{d}v + \int_{\partial v} \left( \boldsymbol{\sigma} \cdot \boldsymbol{n} \right ) \cdot \delta \boldsymbol{u} \ \mathrm{d}a + \int_v \boldsymbol{b} \cdot \delta \boldsymbol{u} \ \mathrm{d}v &= 0\end{aligned}\end{align} \]

This leads to the virtual work of internal forces, see Eq. (12).

(10)#\[\delta W_{\text{int}} = -\int_v \boldsymbol{\sigma} : \frac{\partial \delta \boldsymbol{u}}{\partial \boldsymbol{x}} \ \mathrm{d}v\]

The variation of the total potential energy of internal forces is given in Eq. (13).

(11)#\[ \begin{align}\begin{aligned}\delta \Pi &= \int_v \boldsymbol{\sigma} : \frac{\partial \delta \boldsymbol{u}}{\partial \boldsymbol{x}} \ \mathrm{d}v\\\delta \Pi &= \int_V \boldsymbol{\sigma} : \delta \boldsymbol{F} \boldsymbol{F}^{-1} \ J \mathrm{d}V\\\delta \Pi &= \int_V \boldsymbol{P} : \delta \boldsymbol{F} \ \mathrm{d}V\end{aligned}\end{align} \]

Finally, the first Piola-Kirchhoff stress tensor is given by Eq. (14).

(12)#\[\boldsymbol{P} = J \boldsymbol{\sigma} \boldsymbol{F}^{-T}\]

サンプル

>>> import felupe as fem
>>> import felupe.constitution.jax as mat
>>> import jax.numpy as jnp
>>>
>>> @fem.updated_lagrange
>>> def neo_hooke_updated_lagrange(F, mu=1):
>>>     J = jnp.linalg.det(F)
>>>     b = F @ F.T
>>>     dev = lambda b: b - jnp.trace(b) / 3 * jnp.eye(3)
>>>     τ = mu * dev(J**(-2/3) * b)
>>>     return τ / J
>>>
>>> umat = mat.Material(neo_hooke_updated_lagrange, mu=1)

参考

felupe.constitution.jax.Hyperelastic

A hyperelastic material definition with a given function for the strain energy density function per unit undeformed volume with Automatic Differentiation provided by jax.

felupe.constitution.jax.Material

A material definition with a given function for the partial derivative of the strain energy function w.r.t. the deformation gradient tensor with Automatic Differentiation provided by jax.

felupe.constitution.jax.models.hyperelastic.blatz_ko(C, mu)[ソース]#

Strain energy function of the Blatz-Ko isotropic hyperelastic foam material formulation [1]_.

パラメータ:

メモ

The Poisson ratio of the Blatz-Ko model formulation is \(\nu = 0.25\). The strain energy function is given in Eq. (25)

(13)#\[\psi = \frac{\mu}{2} \left(\frac{I_2}{I_3} + 2 \sqrt{I_3} - 5 \right)\]

The shear modulus \(\mu\) is related to young's modulus as denoted in Eq. (26).

(14)#\[\mu = \frac{2 E}{5}\]

サンプル

First, choose the desired automatic differentiation backend

>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the hyperelastic material.

>>> umat = mat.Hyperelastic(mat.models.hyperelastic.blatz_ko, mu=1.0)
>>> ax = umat.plot()
../../../_images/jax-10.png

参照

felupe.constitution.jax.models.hyperelastic.extended_tube(C, Gc, delta, Ge, beta)[ソース]#

Strain energy function of the isotropic hyperelastic Extended Tube [1]_ material formulation.

パラメータ:
  • C (tensortrax.Tensor or jax.Array) -- Right Cauchy-Green deformation tensor.

  • Gc (float) -- Cross-link contribution to the initial shear modulus.

  • delta (float) -- Finite extension parameter of the polymer strands.

  • Ge (float) -- Constraint contribution to the initial shear modulus.

  • beta (float) -- Global rearrangements of cross-links upon deformation (release of topological constraints).

メモ

The strain energy function is given in Eq. (27)

(15)#\[\psi = \frac{G_c}{2} \left[ \frac{\left( 1 - \delta^2 \right) \left( \hat{I}_1 - 3 \right)}{1 - \delta^2 \left( \hat{I}_1 - 3 \right)} + \ln \left( 1 - \delta^2 \left( \hat{I}_1 - 3 \right) \right) \right] + \frac{2 G_e}{\beta^2} \left( \hat{\lambda}_1^{-\beta} + \hat{\lambda}_2^{-\beta} + \hat{\lambda}_3^{-\beta} - 3 \right)\]

with the first main invariant of the distortional part of the right Cauchy-Green deformation tensor as given in Eq. (28)

(16)#\[\hat{I}_1 = J^{-2/3} \text{tr}\left( \boldsymbol{C} \right)\]

and the principal stretches, obtained from the distortional part of the right Cauchy-Green deformation tensor, see Eq. (29).

(17)#\[ \begin{align}\begin{aligned}\lambda^2_\alpha &= \text{eigvals}\left( \boldsymbol{C} \right)\\\hat{\lambda}_\alpha &= J^{-1/3} \lambda_\alpha\end{aligned}\end{align} \]

The initial shear modulus results from the sum of the cross-link and the constraint contributions to the total initial shear modulus as denoted in Eq. (30).

(18)#\[\mu = G_e + G_c\]

サンプル

First, choose the desired automatic differentiation backend

>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the hyperelastic material.

>>> umat = mat.Hyperelastic(
...     mat.models.hyperelastic.extended_tube,
...     Gc=0.1867,
...     Ge=0.2169,
...     beta=0.2,
...     delta=0.09693,
... )
>>> ax = umat.plot(incompressible=True)
../../../_images/jax-12.png

参照

felupe.constitution.jax.models.hyperelastic.miehe_goektepe_lulei(C, mu, N, U, p, q)[ソース]#

Strain energy function of the isotropic hyperelastic micro-sphere model formulation [1]_.

パラメータ:
  • C (tensortrax.Tensor or jax.Array) -- Right Cauchy-Green deformation tensor.

  • mu (float) -- Shear modulus (ground state stiffness).

  • N (float) -- Number of chain segments (chain locking response).

  • U (float) -- Tube geometry parameter (3D locking characteristics).

  • p (float) -- Non-affine stretch parameter (additional constraint stiffness).

  • q (float) -- Non-affine tube parameter (shape of constraint stress).

サンプル

First, choose the desired automatic differentiation backend

>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the hyperelastic material.

>>> import felupe as fem
>>>
>>> umat = mat.Hyperelastic(
...     mat.models.hyperelastic.miehe_goektepe_lulei,
...     mu=0.1475,
...     N=3.273,
...     p=9.31,
...     U=9.94,
...     q=0.567,
... )
>>> ux = ps = fem.math.linsteps([1, 2], num=50)
>>> bx = fem.math.linsteps([1, 1.5], num=50)
>>> ax = umat.plot(ux=ux, ps=ps, bx=bx, incompressible=True)
../../../_images/jax-14.png

参照

felupe.constitution.jax.models.hyperelastic.mooney_rivlin(C, C10, C01)[ソース]#

Strain energy function of the isotropic hyperelastic Mooney-Rivlin material formulation.

パラメータ:
  • C (tensortrax.Tensor or jax.Array) -- Right Cauchy-Green deformation tensor.

  • C10 (float) -- First material parameter associated to the first invariant.

  • C01 (float) -- Second material parameter associated to the second invariant.

メモ

The strain energy function is given in Eq. (37)

(19)#\[\psi = C_{10} \left(\hat{I}_1 - 3 \right) + C_{01} \left(\hat{I}_2 - 3 \right)\]

with the first and second main invariant of the distortional part of the right Cauchy-Green deformation tensor, see Eq. (38).

(20)#\[ \begin{align}\begin{aligned}\hat{I}_1 &= J^{-2/3} \text{tr}\left( \boldsymbol{C} \right)\\\hat{I}_2 &= J^{-4/3} \frac{1}{2} \left( \text{tr}\left(\boldsymbol{C}\right)^2 - \text{tr}\left(\boldsymbol{C}^2\right) \right)\end{aligned}\end{align} \]

The doubled sum of both material parameters is equal to the shear modulus \(\mu\) as denoted in Eq. (39).

(21)#\[\mu = 2 \left( C_{10} + C_{01} \right)\]

サンプル

First, choose the desired automatic differentiation backend

>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the hyperelastic material.

>>> umat = mat.Hyperelastic(
...     mat.models.hyperelastic.mooney_rivlin, C10=0.3, C01=0.8
... )
>>> ax = umat.plot(incompressible=True)
../../../_images/jax-16.png
felupe.constitution.jax.models.hyperelastic.neo_hooke(C, mu)[ソース]#

Strain energy function of the isotropic hyperelastic Neo-Hookean material formulation.

パラメータ:

メモ

The strain energy function is given in Eq. (40).

(22)#\[\psi = \frac{\mu}{2} \left(\text{tr}\left(\hat{\boldsymbol{C}}\right) - 3\right)\]

サンプル

First, choose the desired automatic differentiation backend

>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the hyperelastic material.

>>> umat = mat.Hyperelastic(mat.models.hyperelastic.neo_hooke, mu=1.0)
>>> ax = umat.plot(incompressible=True)
../../../_images/jax-18.png
felupe.constitution.jax.models.hyperelastic.ogden(C, mu, alpha)[ソース]#

Strain energy function of the isotropic hyperelastic Ogden material formulation.

パラメータ:

メモ

The strain energy function is given in Eq. (41)

(23)#\[\psi = \sum_i \frac{2 \mu_i}{\alpha^2_i} \left( \lambda_1^{\alpha_i} + \lambda_2^{\alpha_i} + \lambda_3^{\alpha_i} - 3 \right)\]

The sum of the moduli \(\mu_i\) is equal to the initial shear modulus \(\mu\), see Eq. (42).

(24)#\[\mu = \sum_i \mu_i\]

サンプル

>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat
>>> umat = mat.Hyperelastic(
...     mat.models.hyperelastic.ogden, mu=[1, 0.2], alpha=[1.7, -1.5]
... )
>>> ax = umat.plot(incompressible=True)
felupe.constitution.jax.models.hyperelastic.storakers(C, mu, alpha, beta)[ソース]#

Strain energy function of the Storåkers isotropic hyperelastic foam material formulation [1]_.

パラメータ:

メモ

The strain energy function is given in Eq. (47)

(25)#\[\psi = \sum_i \frac{2 \mu_i}{\alpha^2_i} \left[ \lambda_1^{\alpha_i} + \lambda_2^{\alpha_i} + \lambda_3^{\alpha_i} - 3 + \frac{1}{\beta_i} \left( J^{-\alpha_i \beta_i} - 1 \right) \right]\]

The sum of the moduli \(\mu_i\) is equal to the initial shear modulus \(\mu\), see Eq. (48),

(26)#\[\mu = \sum_i \mu_i\]

and the initial bulk modulus is given in Eq. (49).

(27)#\[K = \sum_i 2 \mu_i \left( \frac{1}{3} + \beta_i \right)\]

サンプル

First, choose the desired automatic differentiation backend

>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the hyperelastic material.

>>> import felupe as fem
>>>
>>> umat = mat.Hyperelastic(
...     mat.models.hyperelastic.storakers,
...     mu=[4.5 * (1.85 / 2), -4.5 * (-9.2 / 2)],
...     alpha=[1.85, -9.2],
...     beta=[0.92, 0.92],
... )
>>> ax = umat.plot(
...     ux=fem.math.linsteps([1, 2], 15),
...     ps=fem.math.linsteps([1, 1], 15),
...     bx=fem.math.linsteps([1, 1], 9),
... )
../../../_images/jax-22.png

参照

felupe.constitution.jax.models.hyperelastic.third_order_deformation(C, C10, C01, C11, C20, C30)[ソース]#

Strain energy function of the isotropic hyperelastic Third-Order-Deformation material formulation.

パラメータ:
  • C (tensortrax.Tensor or jax.Array) -- Right Cauchy-Green deformation tensor.

  • C10 (float) -- Material parameter associated to the linear term of the first invariant.

  • C01 (float) -- Material parameter associated to the linear term of the second invariant.

  • C11 (float) -- Material parameter associated to the mixed term of the first and second invariant.

  • C20 (float) -- Material parameter associated to the quadratic term of the first invariant.

  • C30 (float) -- Material parameter associated to the cubic term of the first invariant.

メモ

The strain energy function is given in Eq. (50)

(28)#\[ \begin{align}\begin{aligned}\psi &= C_{10} \left(\hat{I}_1 - 3 \right) + C_{01} \left(\hat{I}_2 - 3 \right) + C_{11} \left(\hat{I}_1 - 3 \right) \left(\hat{I}_2 - 3 \right)\\ &+ C_{20} \left(\hat{I}_1 - 3 \right)^2 + C_{30} \left(\hat{I}_1 - 3 \right)^3\end{aligned}\end{align} \]

with the first and second main invariant of the distortional part of the right Cauchy-Green deformation tensor, see Eq. (51).

(29)#\[ \begin{align}\begin{aligned}\hat{I}_1 &= J^{-2/3} \text{tr}\left( \boldsymbol{C} \right)\\\hat{I}_2 &= J^{-4/3} \frac{1}{2} \left( \text{tr}\left(\boldsymbol{C}\right)^2 - \text{tr}\left(\boldsymbol{C}^2\right) \right)\end{aligned}\end{align} \]

The doubled sum of the material parameters \(C_{10}\) and \(C_{01}\) is equal to the initial shear modulus \(\mu\) as denoted in Eq. (52).

(30)#\[\mu = 2 \left( C_{10} + C_{01} \right)\]

サンプル

First, choose the desired automatic differentiation backend

>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the hyperelastic material.

>>> umat = mat.Hyperelastic(
...     mat.models.hyperelastic.third_order_deformation,
...     C10=0.5,
...     C01=0.1,
...     C11=0.01,
...     C20=-0.1,
...     C30=0.02,
... )
>>> ax = umat.plot(incompressible=True)
../../../_images/jax-24.png
felupe.constitution.jax.models.hyperelastic.van_der_waals(C, mu, limit, a, beta)[ソース]#

Strain energy function of the Van der Waals [1]_ material formulation.

パラメータ:
  • C (tensortrax.Tensor or jax.Array) -- Right Cauchy-Green deformation tensor.

  • mu (float) -- Initial shear modulus.

  • limit (float) -- Limiting stretch \(\lambda_m\) at which the polymer chain network becomes locked.

  • a (float) -- Attractive interactions between the quasi-particles.

  • beta (float) -- Mixed-Invariant factor: 0 for pure I1- and 1 for pure I2-contribution.

サンプル

First, choose the desired automatic differentiation backend

>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the hyperelastic material.

>>> umat = mat.Hyperelastic(
...     mat.models.hyperelastic.van_der_waals,
...     mu=1.0,
...     beta=0.1,
...     a=0.5,
...     limit=5.0
... )
>>> ax = umat.plot(incompressible=True)
../../../_images/jax-26.png

参照

felupe.constitution.jax.models.hyperelastic.yeoh(C, C10, C20, C30)[ソース]#

Strain energy function of the isotropic hyperelastic Yeoh material formulation.

パラメータ:
  • C (tensortrax.Tensor or jax.Array) -- Right Cauchy-Green deformation tensor.

  • C10 (float) -- Material parameter associated to the linear term of the first invariant.

  • C20 (float) -- Material parameter associated to the quadratic term of the first invariant.

  • C30 (float) -- Material parameter associated to the cubic term of the first invariant.

メモ

The strain energy function is given in Eq. (53)

(31)#\[\psi = C_{10} \left(\hat{I}_1 - 3 \right) + C_{20} \left(\hat{I}_1 - 3 \right)^2 + C_{30} \left(\hat{I}_1 - 3 \right)^3\]

with the first main invariant of the distortional part of the right Cauchy-Green deformation tensor, see Eq. (54).

(32)#\[\hat{I}_1 = J^{-2/3} \text{tr}\left( \boldsymbol{C} \right)\]

The \(C_{10}\) material parameter is equal to half the initial shear modulus \(\mu\) as denoted in Eq. (55).

(33)#\[\mu = 2 C_{10}\]

サンプル

First, choose the desired automatic differentiation backend

>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the hyperelastic material.

>>> umat = mat.Hyperelastic(
...     mat.models.hyperelastic.yeoh, C10=0.5, C20=-0.1, C30=0.02
... )
>>> ax = umat.plot(incompressible=True)
../../../_images/jax-28.png
felupe.constitution.jax.models.lagrange.becker(F, mu, lmbda)[ソース]#

Second Piola-Kirchhoff stress tensor of Becker's logarithmic material model formulation [1]_ [2]_.

パラメータ:
戻り値:

S -- Second Piola-Kirchhoff stress tensor.

戻り値の型:

tensortrax.Tensor or jax.Array

メモ

This logarithmic material model formulation utilizes a linear-elastic stress-strain formulation for the Biot stress tensor, based on the Lagrangian logarithmic strain tensor, see Eq. (56).

(34)#\[\boldsymbol{T} = 2 \mu \ \ln \boldsymbol{U} + \lambda \ \operatorname{tr}(\ln \boldsymbol{U}) \boldsymbol{1}\]

The second Piola-Kirchhoff stress tensor is then obtained from the Biot stress tensor, see Eq. (57).

(35)#\[\boldsymbol{S} = \boldsymbol{U}^{-1} \boldsymbol{T}\]

サンプル

First, choose the desired automatic differentiation backend

>>> import felupe as fem
>>>
>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the material.

>>> umat = mat.Material(mat.models.lagrange.becker, mu=1.0, lmbda=2.0)
>>> ax = umat.plot()
../../../_images/jax-30.png

参照

felupe.constitution.jax.models.lagrange.morph(F, statevars, p)[ソース]#

Second Piola-Kirchhoff stress tensor of the MORPH model formulation [1]_.

パラメータ:
  • F (tensortrax.Tensor or jax.Array) -- Deformation gradient tensor.

  • statevars (array) -- Vector of stacked state variables (CTS, C, SA).

  • p (list of float) -- A list which contains the 8 material parameters.

メモ

The MORPH material model is implemented as a second Piola-Kirchhoff stress-based formulation with automatic differentiation. The Tresca invariant of the distortional part of the right Cauchy-Green deformation tensor is used as internal state variable, see Eq. (58).

警告

While the MORPH-material formulation captures the Mullins effect and quasi-static hysteresis effects of rubber mixtures very nicely, it has been observed to be unstable for medium- to highly-distorted states of deformation.

(36)#\[ \begin{align}\begin{aligned}\boldsymbol{C} &= \boldsymbol{F}^T \boldsymbol{F}\\I_3 &= \det (\boldsymbol{C})\\\hat{\boldsymbol{C}} &= I_3^{-1/3} \boldsymbol{C}\\\hat{\lambda}^2_\alpha &= \text{eigvals}(\hat{\boldsymbol{C}})\\\hat{C}_T &= \max \left( \hat{\lambda}^2_\alpha - \hat{\lambda}^2_\beta \right)\\\hat{C}_T^S &= \max \left( \hat{C}_T, \hat{C}_{T,n}^S \right)\end{aligned}\end{align} \]

A sigmoid-function is used inside the deformation-dependent variables \(\alpha\), \(\beta\) and \(\gamma\), see Eq. (59).

(37)#\[ \begin{align}\begin{aligned}f(x) &= \frac{1}{\sqrt{1 + x^2}}\\\alpha &= p_1 + p_2 \ f(p_3\ C_T^S)\\\beta &= p_4\ f(p_3\ C_T^S)\\\gamma &= p_5\ C_T^S\ \left( 1 - f\left(\frac{C_T^S}{p_6}\right) \right)\end{aligned}\end{align} \]

The rate of deformation is described by the Lagrangian tensor and its Tresca- invariant, see Eq. (60).

注釈

It is important to evaluate the incremental right Cauchy-Green tensor by the difference of the final and the previous state of deformation, not by its variation with respect to the deformation gradient tensor.

(38)#\[ \begin{align}\begin{aligned}\hat{\boldsymbol{L}} &= \text{sym}\left( \text{dev}(\boldsymbol{C}^{-1} \Delta\boldsymbol{C}) \right) \hat{\boldsymbol{C}}\\\lambda_{\hat{\boldsymbol{L}}, \alpha} &= \text{eigvals}(\hat{\boldsymbol{L}})\\\hat{L}_T &= \max \left( \lambda_{\hat{\boldsymbol{L}}, \alpha}-\lambda_{\hat{\boldsymbol{L}}, \beta} \right)\\\Delta\boldsymbol{C} &= \boldsymbol{C} - \boldsymbol{C}_n\end{aligned}\end{align} \]

The additional stresses evolve between the limiting stresses, see Eq. (61). The additional deviatoric-enforcement terms [1]_ are neglected in this implementation.

(39)#\[ \begin{align}\begin{aligned}\boldsymbol{S}_L &= \left( \gamma \exp \left(p_7 \frac{\hat{\boldsymbol{L}}}{\hat{L}_T} \frac{\hat{C}_T}{\hat{C}_T^S} \right) + p8 \frac{\hat{\boldsymbol{L}}}{\hat{L}_T} \right) \boldsymbol{C}^{-1}\\\boldsymbol{S}_A &= \frac{ \boldsymbol{S}_{A,n} + \beta\ \hat{L}_T\ \boldsymbol{S}_L }{1 + \beta\ \hat{L}_T}\\\boldsymbol{S} &= 2 \alpha\ \text{dev}( \hat{\boldsymbol{C}} ) \boldsymbol{C}^{-1}+\text{dev}\left(\boldsymbol{S}_A\ \boldsymbol{C}\right) \boldsymbol{C}^{-1}\end{aligned}\end{align} \]

注釈

Only the upper-triangle entries of the symmetric stress-tensor state variables are stored in the solid body. Hence, it is necessary to extract such variables with tm.special.from_triu_1d() and export them as tm.special.triu_1d().

サンプル

First, choose the desired automatic differentiation backend

>>> import felupe as fem
>>>
>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the material.

>>> umat = mat.Material(
...     mat.models.lagrange.morph,
...     p=[0.039, 0.371, 0.174, 2.41, 0.0094, 6.84, 5.65, 0.244],
...     nstatevars=13,
... )
>>> ax = umat.plot(
...    incompressible=True,
...    ux=fem.math.linsteps(
...        # [1, 2, 1, 2.75, 1, 3.5, 1, 4.2, 1, 4.8, 1, 4.8, 1],
...        [1, 2.75, 1, 2.75],
...        num=20,
...    ),
...    ps=None,
...    bx=None,
... )
../../../_images/jax-32.png

参照

参考

felupe.constitution.tensortrax.models.lagrange.morph_representative_directions

Strain energy function of the MORPH model formulation, implemented by the concept of representative directions.

felupe.constitution.jax.models.lagrange.morph_representative_directions

Strain energy function of the MORPH model formulation, implemented by the concept of representative directions.

felupe.constitution.jax.models.lagrange.morph_representative_directions(F, statevars, p, ε=1e-06)[ソース]#

First Piola-Kirchhoff stress tensor of the MORPH model formulation [1]_, implemented by the concept of representative directions [2]_, [3].

パラメータ:
  • F (tensortrax.Tensor or jax.Array) -- Deformation gradient tensor.

  • statevars (array) -- Vector of stacked state variables (CTS, λ - 1, SA1, SA2).

  • p (list of float) -- A list which contains the 8 material parameters.

  • ε (float, optional) -- A small stabilization parameter (default is 1e-6).

サンプル

First, choose the desired automatic differentiation backend

>>> import felupe as fem
>>>
>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat

and create the material.

>>> umat = mat.Material(
...     mat.models.lagrange.morph_representative_directions,
...     p=[0.011, 0.408, 0.421, 6.85, 0.0056, 5.54, 5.84, 0.117],
...     nstatevars=84,
... )
>>> ax = umat.plot(
...    incompressible=True,
...    ux=fem.math.linsteps(
...        # [1, 2, 1, 2.75, 1, 3.5, 1, 4.2, 1, 4.8, 1, 4.8, 1],
...        [1, 2.75, 1, 2.75],
...        num=20,
...    ),
...    ps=None,
...    bx=None,
... )
../../../_images/jax-34.png

参照

参考

felupe.constitution.tensortrax.models.lagrange.morph

Strain energy function of the MORPH model formulation.

felupe.constitution.jax.models.lagrange.morph

Strain energy function of the MORPH model formulation.

felupe.constitution.jax.vmap(fun, in_axes=0, out_axes=0, method=<function vmap>, **kwargs)[ソース]#

Vectorizing map. Creates a function which maps fun over argument axes. This decorator treats all non-specified arguments and keyword-arguments as static.

参考

jax.vmap

Vectorizing map. Creates a function which maps fun over argument axes.