From aadb239c0b727a5ba3a4ec61284fb4e4eebf378c Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Thu, 29 Aug 2024 22:51:49 +0200 Subject: [PATCH 1/7] Add `LinearElasticOrthotropic` --- src/felupe/__init__.py | 2 + src/felupe/constitution/__init__.py | 2 + .../linear_elasticity/__init__.py | 2 + .../_linear_elastic_orthotropic.py | 365 ++++++++++++++++++ 4 files changed, 371 insertions(+) create mode 100644 src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py diff --git a/src/felupe/__init__.py b/src/felupe/__init__.py index 3a0edec9..82629352 100644 --- a/src/felupe/__init__.py +++ b/src/felupe/__init__.py @@ -23,6 +23,7 @@ Laplace, LinearElastic, LinearElasticLargeStrain, + LinearElasticOrthotropic, LinearElasticPlaneStrain, LinearElasticPlaneStress, LinearElasticPlasticIsotropicHardening, @@ -171,6 +172,7 @@ "Laplace", "LinearElastic", "LinearElasticLargeStrain", + "LinearElasticOrthotropic", "LinearElasticPlaneStrain", "LinearElasticPlaneStress", "LinearElasticPlasticIsotropicHardening", diff --git a/src/felupe/constitution/__init__.py b/src/felupe/constitution/__init__.py index 673b0981..1fa185f3 100644 --- a/src/felupe/constitution/__init__.py +++ b/src/felupe/constitution/__init__.py @@ -33,6 +33,7 @@ from .linear_elasticity import ( LinearElastic, LinearElasticLargeStrain, + LinearElasticOrthotropic, LinearElasticPlaneStrain, LinearElasticPlaneStress, LinearElasticTensorNotation, @@ -70,6 +71,7 @@ "Laplace", "LinearElastic", "LinearElasticLargeStrain", + "LinearElasticOrthotropic", "LinearElasticPlaneStrain", "LinearElasticPlaneStress", "LinearElasticTensorNotation", diff --git a/src/felupe/constitution/linear_elasticity/__init__.py b/src/felupe/constitution/linear_elasticity/__init__.py index e7777677..ca1ce89f 100644 --- a/src/felupe/constitution/linear_elasticity/__init__.py +++ b/src/felupe/constitution/linear_elasticity/__init__.py @@ -6,11 +6,13 @@ LinearElasticTensorNotation, ) from ._linear_elastic_large_strain import LinearElasticLargeStrain +from ._linear_elastic_orthotropic import LinearElasticOrthotropic __all__ = [ "lame_converter", "LinearElastic", "LinearElasticLargeStrain", + "LinearElasticOrthotropic", "LinearElasticPlaneStrain", "LinearElasticPlaneStress", "LinearElasticTensorNotation", diff --git a/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py b/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py new file mode 100644 index 00000000..506247a9 --- /dev/null +++ b/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py @@ -0,0 +1,365 @@ +# -*- coding: utf-8 -*- +""" +This file is part of FElupe. + +FElupe is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +FElupe is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with FElupe. If not, see . +""" + +import numpy as np + +from ...math import ddot, identity, transpose +from .._base import ConstitutiveMaterial + + +class LinearElasticOrthotropic(ConstitutiveMaterial): + r"""Orthotropic linear-elastic material formulation. + + Parameters + ---------- + E1 : float + Young's modulus. + E2 : float + Young's modulus. + E3 : float + Young's modulus. + nu12 : float + Poisson ratio. + nu23 : float + Poisson ratio. + nu13 : float + Poisson ratio. + G12 : float + Shear modulus. + G23 : float + Shear modulus. + G13 : float + Shear modulus. + + Notes + ----- + .. math:: + + \begin{bmatrix} + \sigma_{11} \\ + \sigma_{22} \\ + \sigma_{33} \\ + \sigma_{12} \\ + \sigma_{23} \\ + \sigma_{31} + \end{bmatrix} = \frac{E}{(1+\nu)(1-2\nu)}\begin{bmatrix} + 1-\nu & \nu & \nu & 0 & 0 & 0\\ + \nu & 1-\nu & \nu & 0 & 0 & 0\\ + \nu & \nu & 1-\nu & 0 & 0 & 0\\ + 0 & 0 & 0 & \frac{1-2\nu}{2} & 0 & 0 \\ + 0 & 0 & 0 & 0 & \frac{1-2\nu}{2} & 0 \\ + 0 & 0 & 0 & 0 & 0 & \frac{1-2\nu}{2} + \end{bmatrix} \cdot \begin{bmatrix} + \varepsilon_{11} \\ + \varepsilon_{22} \\ + \varepsilon_{33} \\ + 2 \varepsilon_{12} \\ + 2 \varepsilon_{23} \\ + 2 \varepsilon_{31} + \end{bmatrix} + + with the strain tensor + + .. math:: + + \boldsymbol{\varepsilon} = \frac{1}{2} \left( \frac{\partial \boldsymbol{u}} + {\partial \boldsymbol{X}} + \left( \frac{\partial \boldsymbol{u}} + {\partial \boldsymbol{X}} \right)^T \right) + + Examples + -------- + .. pyvista-plot:: + :context: + + >>> import felupe as fem + >>> + >>> umat = fem.LinearElasticOrthotropic( + >>> E1=1, E2=1, E3=1, nu12=0.3, n23=0.3, nu13=0.3, G12=0.4, G23=0.4, G13=0.4 + >>> ) + >>> ax = umat.plot() + + .. pyvista-plot:: + :include-source: False + :context: + :force_static: + + >>> import pyvista as pv + >>> + >>> fig = ax.get_figure() + >>> chart = pv.ChartMPL(fig) + >>> chart.show() + + """ + + def __init__( + self, + E1=None, + E2=None, + E3=None, + nu12=None, + nu23=None, + nu13=None, + G12=None, + G23=None, + G13=None, + ): + self.E1 = E1 + self.E2 = E1 + self.E3 = E3 + + self.nu12 = nu12 + self.nu23 = nu23 + self.nu13 = nu13 + + self.G12 = G12 + self.G23 = G23 + self.G13 = G13 + + self.kwargs = { + "E1": self.E1, + "E2": self.E2, + "E3": self.E3, + "nu12": self.nu12, + "nu23": self.nu23, + "nu13": self.nu13, + "G12": self.G12, + "G23": self.G23, + "G13": self.G13, + } + + # aliases for gradient and hessian + self.stress = self.gradient + self.elasticity = self.hessian + + # initial variables for calling + # ``self.gradient(self.x)`` and ``self.hessian(self.x)`` + self.x = [np.eye(3), np.zeros(0)] + + def gradient( + self, + x, + E1=None, + E2=None, + E3=None, + nu12=None, + nu23=None, + nu13=None, + G12=None, + G23=None, + G13=None, + ): + r"""Evaluate the stress tensor (as a function of the deformation gradient). + + Parameters + ---------- + x : list of ndarray + List with Deformation gradient :math:`\boldsymbol{F}` (3x3) as first item. + E1 : float + Young's modulus. + E2 : float + Young's modulus. + E3 : float + Young's modulus. + nu12 : float + Poisson ratio. + nu23 : float + Poisson ratio. + nu13 : float + Poisson ratio. + G12 : float + Shear modulus. + G23 : float + Shear modulus. + G13 : float + Shear modulus. + + Returns + ------- + ndarray + Stress tensor (3x3) + + """ + + F, statevars = x[0], x[-1] + + if E1 is None: + E1 = self.E1 + + if E2 is None: + E2 = self.E2 + + if E3 is None: + E3 = self.E3 + + if nu12 is None: + nu12 = self.nu12 + + if nu23 is None: + nu23 = self.nu23 + + if nu13 is None: + nu13 = self.nu13 + + if G12 is None: + G12 = self.G12 + + if G23 is None: + G23 = self.G23 + + if G13 is None: + G13 = self.G13 + + # convert the deformation gradient to strain + H = F - identity(F) + strain = (H + transpose(H)) / 2 + + # init stress + elast = self.hessian( + x=x, + E1=E1, + E2=E2, + E3=E3, + nu12=nu12, + nu23=nu23, + n13=nu13, + G12=G12, + G23=G23, + G13=G13, + )[0] + + return [ddot(elast, strain, mode=(4, 2)), statevars] + + def hessian( + self, + x=None, + E1=None, + E2=None, + E3=None, + nu12=None, + nu23=None, + nu13=None, + G12=None, + G23=None, + G13=None, + shape=(1, 1), + dtype=None, + ): + r"""Evaluate the elasticity tensor. The Deformation gradient is only + used for the shape of the trailing axes. + + Parameters + ---------- + x : list of ndarray, optional + List with Deformation gradient :math:`\boldsymbol{F}` (3x3) as first item + (default is None). + E1 : float + Young's modulus. + E2 : float + Young's modulus. + E3 : float + Young's modulus. + nu12 : float + Poisson ratio. + nu23 : float + Poisson ratio. + nu13 : float + Poisson ratio. + G12 : float + Shear modulus. + G23 : float + Shear modulus. + G13 : float + Shear modulus. + shape : tuple of int, optional + Tuple with shape of the trailing axes (default is (1, 1)). + + Returns + ------- + ndarray + elasticity tensor (3x3x3x3) + + """ + + if E1 is None: + E1 = self.E1 + + if E2 is None: + E2 = self.E2 + + if E3 is None: + E3 = self.E3 + + if nu12 is None: + nu12 = self.nu12 + + if nu23 is None: + nu23 = self.nu23 + + if nu13 is None: + nu13 = self.nu13 + + if G12 is None: + G12 = self.G12 + + if G23 is None: + G23 = self.G23 + + if G13 is None: + G13 = self.G13 + + if x is not None: + dtype = x[0].dtype + + elast = np.zeros((3, 3, 3, 3, *shape), dtype=dtype) + + nu21 = nu12 * E2 / E1 + nu32 = nu23 * E3 / E2 + nu31 = nu13 * E3 / E1 + + J = 1 / (1 - nu12 * nu21 - nu23 * nu32 - nu31 * nu13 - 2 * nu21 * nu32 * nu13) + + elast[0, 0, 0, 0] = E1 * (1 - nu23 * nu32) * J + elast[1, 1, 1, 1] = E2 * (1 - nu13 * nu31) * J + elast[2, 2, 2, 2] = E3 * (1 - nu12 * nu21) * J + + elast[0, 0, 1, 1] = elast[1, 1, 0, 0] = E1 * (nu21 + nu31 * nu23) * J + elast[0, 0, 2, 2] = elast[2, 2, 0, 0] = E1 * (nu31 + nu21 * nu32) * J + elast[1, 1, 2, 2] = elast[2, 2, 1, 1] = E2 * (nu32 + nu12 * nu31) * J + + elast[ + [0, 1, 0, 1], + [1, 0, 1, 0], + [0, 0, 1, 1], + [1, 1, 0, 0], + ] = G12 + + elast[ + [0, 2, 0, 2], + [2, 0, 2, 0], + [0, 0, 2, 2], + [2, 2, 0, 0], + ] = G13 + + elast[ + [1, 2, 1, 2], + [2, 1, 2, 1], + [1, 1, 2, 2], + [2, 2, 1, 1], + ] = G23 + + return [elast] From 24105ddecf5bf9d14b08ee921350283fe8c165c4 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Thu, 29 Aug 2024 23:12:47 +0200 Subject: [PATCH 2/7] Update _linear_elastic_orthotropic.py --- .../_linear_elastic_orthotropic.py | 141 +++--------------- 1 file changed, 18 insertions(+), 123 deletions(-) diff --git a/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py b/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py index 506247a9..551b386b 100644 --- a/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py +++ b/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py @@ -108,15 +108,15 @@ class LinearElasticOrthotropic(ConstitutiveMaterial): def __init__( self, - E1=None, - E2=None, - E3=None, - nu12=None, - nu23=None, - nu13=None, - G12=None, - G23=None, - G13=None, + E1, + E2, + E3, + nu12, + nu23, + nu13, + G12, + G23, + G13, ): self.E1 = E1 self.E2 = E1 @@ -153,15 +153,6 @@ def __init__( def gradient( self, x, - E1=None, - E2=None, - E3=None, - nu12=None, - nu23=None, - nu13=None, - G12=None, - G23=None, - G13=None, ): r"""Evaluate the stress tensor (as a function of the deformation gradient). @@ -169,24 +160,6 @@ def gradient( ---------- x : list of ndarray List with Deformation gradient :math:`\boldsymbol{F}` (3x3) as first item. - E1 : float - Young's modulus. - E2 : float - Young's modulus. - E3 : float - Young's modulus. - nu12 : float - Poisson ratio. - nu23 : float - Poisson ratio. - nu13 : float - Poisson ratio. - G12 : float - Shear modulus. - G23 : float - Shear modulus. - G13 : float - Shear modulus. Returns ------- @@ -197,33 +170,6 @@ def gradient( F, statevars = x[0], x[-1] - if E1 is None: - E1 = self.E1 - - if E2 is None: - E2 = self.E2 - - if E3 is None: - E3 = self.E3 - - if nu12 is None: - nu12 = self.nu12 - - if nu23 is None: - nu23 = self.nu23 - - if nu13 is None: - nu13 = self.nu13 - - if G12 is None: - G12 = self.G12 - - if G23 is None: - G23 = self.G23 - - if G13 is None: - G13 = self.G13 - # convert the deformation gradient to strain H = F - identity(F) strain = (H + transpose(H)) / 2 @@ -231,15 +177,6 @@ def gradient( # init stress elast = self.hessian( x=x, - E1=E1, - E2=E2, - E3=E3, - nu12=nu12, - nu23=nu23, - n13=nu13, - G12=G12, - G23=G23, - G13=G13, )[0] return [ddot(elast, strain, mode=(4, 2)), statevars] @@ -247,15 +184,6 @@ def gradient( def hessian( self, x=None, - E1=None, - E2=None, - E3=None, - nu12=None, - nu23=None, - nu13=None, - G12=None, - G23=None, - G13=None, shape=(1, 1), dtype=None, ): @@ -267,24 +195,6 @@ def hessian( x : list of ndarray, optional List with Deformation gradient :math:`\boldsymbol{F}` (3x3) as first item (default is None). - E1 : float - Young's modulus. - E2 : float - Young's modulus. - E3 : float - Young's modulus. - nu12 : float - Poisson ratio. - nu23 : float - Poisson ratio. - nu13 : float - Poisson ratio. - G12 : float - Shear modulus. - G23 : float - Shear modulus. - G13 : float - Shear modulus. shape : tuple of int, optional Tuple with shape of the trailing axes (default is (1, 1)). @@ -295,32 +205,17 @@ def hessian( """ - if E1 is None: - E1 = self.E1 - - if E2 is None: - E2 = self.E2 - - if E3 is None: - E3 = self.E3 - - if nu12 is None: - nu12 = self.nu12 - - if nu23 is None: - nu23 = self.nu23 - - if nu13 is None: - nu13 = self.nu13 - - if G12 is None: - G12 = self.G12 + E1 = self.E1 + E2 = self.E2 + E3 = self.E3 - if G23 is None: - G23 = self.G23 + nu12 = self.nu12 + nu23 = self.nu23 + nu13 = self.nu13 - if G13 is None: - G13 = self.G13 + G12 = self.G12 + G23 = self.G23 + G13 = self.G13 if x is not None: dtype = x[0].dtype From 0bf46de142c749c8b9c682d6e1d4332eb6f68b74 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Thu, 29 Aug 2024 23:12:50 +0200 Subject: [PATCH 3/7] Update test_constitution.py --- tests/test_constitution.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/test_constitution.py b/tests/test_constitution.py index 15e2fe95..b38c11c0 100644 --- a/tests/test_constitution.py +++ b/tests/test_constitution.py @@ -150,6 +150,38 @@ def test_linear(): assert np.allclose(*check_dsde) +def test_linear_orthotropic(): + r, F = pre(sym=False, add_identity=True) + + for Material in [ + (fem.constitution.LinearElasticOrthotropic, {}), + ]: + LinearElastic, kwargs = Material + + le = LinearElastic( + E1=6919, + E2=271, + E3=450, + nu12=0.388, + nu23=0.278, + nu13=0.375, + G12=262, + G23=34, + G13=354, + **kwargs + ) + + stress = le.gradient(F)[:-1] + dsde = le.hessian(F) + + assert le.elasticity()[0].shape[-2:] == (1, 1) + + assert stress[0].shape == (3, 3, *F[0].shape[-2:]) + assert dsde[0].shape == (3, 3, 3, 3, 1, 1) + + assert np.allclose(stress, 0) + + def test_linear_planestress(): r, F = pre(sym=False, add_identity=True) F = [F[0][:2][:, :2]] @@ -708,6 +740,7 @@ def test_laplace(): if __name__ == "__main__": test_nh() test_linear() + test_linear_orthotropic() test_linear_planestress() test_linear_planestrain() test_kinematics() From ec60ba7103d147bf6f0ba50d902209e3d784e3ef Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Thu, 29 Aug 2024 23:12:53 +0200 Subject: [PATCH 4/7] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ec87e2e..12cd0983 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. The format - Add an optional `mechanics.Assemble(..., multiplier=None)` argument which is used in external items like `SolidBodyForce`, `SolidBodyGravity` and `PointLoad` and is applied in `newtonrhapson(items, ...)`. - Add a new submodule `view` which contains the `View...` classes like `ViewSolid` or `ViewField`, previously located at `tools._plot`. - Add the `grad`- and `hess`-arguments to the `reload()`- and `copy()`-methods of a `Region`, i.e. `Region.reload(grad=None, hess=None)`. +- Add `LinearElasticOrthotropic`. ### Changed - Change the internal initialization of `field = Field(region, values=1, dtype=None)` values from `field.values = np.ones(shape) * values` to `field = np.full(shape, fill_value=values, dtype=dtype)`. This enforces `field = Field(region, values=1)` to return the gradient array with data-type `int` which was of type `float` before. From cedb8f8301e7987f29f614763c5fa59c0cad02f3 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Thu, 29 Aug 2024 23:14:21 +0200 Subject: [PATCH 5/7] Update test_constitution.py --- tests/test_constitution.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_constitution.py b/tests/test_constitution.py index b38c11c0..61e012a9 100644 --- a/tests/test_constitution.py +++ b/tests/test_constitution.py @@ -158,6 +158,7 @@ def test_linear_orthotropic(): ]: LinearElastic, kwargs = Material + # doi.org/10.2478/ace-2018-0027 (pine wood) le = LinearElastic( E1=6919, E2=271, From 62a9ba5ff2243767da1903d3c8ed989f9bcfe092 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Thu, 29 Aug 2024 23:17:01 +0200 Subject: [PATCH 6/7] Update _linear_elastic_orthotropic.py --- .../_linear_elastic_orthotropic.py | 68 ++----------------- 1 file changed, 6 insertions(+), 62 deletions(-) diff --git a/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py b/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py index 551b386b..8b2cb23d 100644 --- a/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py +++ b/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py @@ -46,50 +46,15 @@ class LinearElasticOrthotropic(ConstitutiveMaterial): G13 : float Shear modulus. - Notes - ----- - .. math:: - - \begin{bmatrix} - \sigma_{11} \\ - \sigma_{22} \\ - \sigma_{33} \\ - \sigma_{12} \\ - \sigma_{23} \\ - \sigma_{31} - \end{bmatrix} = \frac{E}{(1+\nu)(1-2\nu)}\begin{bmatrix} - 1-\nu & \nu & \nu & 0 & 0 & 0\\ - \nu & 1-\nu & \nu & 0 & 0 & 0\\ - \nu & \nu & 1-\nu & 0 & 0 & 0\\ - 0 & 0 & 0 & \frac{1-2\nu}{2} & 0 & 0 \\ - 0 & 0 & 0 & 0 & \frac{1-2\nu}{2} & 0 \\ - 0 & 0 & 0 & 0 & 0 & \frac{1-2\nu}{2} - \end{bmatrix} \cdot \begin{bmatrix} - \varepsilon_{11} \\ - \varepsilon_{22} \\ - \varepsilon_{33} \\ - 2 \varepsilon_{12} \\ - 2 \varepsilon_{23} \\ - 2 \varepsilon_{31} - \end{bmatrix} - - with the strain tensor - - .. math:: - - \boldsymbol{\varepsilon} = \frac{1}{2} \left( \frac{\partial \boldsymbol{u}} - {\partial \boldsymbol{X}} + \left( \frac{\partial \boldsymbol{u}} - {\partial \boldsymbol{X}} \right)^T \right) - Examples -------- .. pyvista-plot:: :context: >>> import felupe as fem - >>> + >>> >>> umat = fem.LinearElasticOrthotropic( - >>> E1=1, E2=1, E3=1, nu12=0.3, n23=0.3, nu13=0.3, G12=0.4, G23=0.4, G13=0.4 + >>> E1=1, E2=1, E3=1, nu12=0.3, nu23=0.3, nu13=0.3, G12=0.4, G23=0.4, G13=0.4 >>> ) >>> ax = umat.plot() @@ -106,18 +71,7 @@ class LinearElasticOrthotropic(ConstitutiveMaterial): """ - def __init__( - self, - E1, - E2, - E3, - nu12, - nu23, - nu13, - G12, - G23, - G13, - ): + def __init__(self, E1, E2, E3, nu12, nu23, nu13, G12, G23, G13): self.E1 = E1 self.E2 = E1 self.E3 = E3 @@ -150,10 +104,7 @@ def __init__( # ``self.gradient(self.x)`` and ``self.hessian(self.x)`` self.x = [np.eye(3), np.zeros(0)] - def gradient( - self, - x, - ): + def gradient(self, x): r"""Evaluate the stress tensor (as a function of the deformation gradient). Parameters @@ -175,18 +126,11 @@ def gradient( strain = (H + transpose(H)) / 2 # init stress - elast = self.hessian( - x=x, - )[0] + elast = self.hessian(x=x)[0] return [ddot(elast, strain, mode=(4, 2)), statevars] - def hessian( - self, - x=None, - shape=(1, 1), - dtype=None, - ): + def hessian(self, x=None, shape=(1, 1), dtype=None): r"""Evaluate the elasticity tensor. The Deformation gradient is only used for the shape of the trailing axes. From 2d88aa4ecb381f41b6b781ee3a7342f57cf34d47 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Thu, 29 Aug 2024 23:22:24 +0200 Subject: [PATCH 7/7] Add `LinearElasticOrthotropic` to the tests --- docs/felupe/constitution/core.rst | 6 ++++++ .../_linear_elastic_orthotropic.py | 14 +++++++------- tests/test_constitution.py | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/felupe/constitution/core.rst b/docs/felupe/constitution/core.rst index 23bb1d86..b28a5398 100644 --- a/docs/felupe/constitution/core.rst +++ b/docs/felupe/constitution/core.rst @@ -22,6 +22,7 @@ This page contains the core (hard-coded) constitutive material model formulation LinearElasticPlaneStress constitution.LinearElasticTensorNotation LinearElasticLargeStrain + LinearElasticOrthotropic **Plasticity** @@ -93,6 +94,11 @@ This page contains the core (hard-coded) constitutive material model formulation .. autofunction:: felupe.linear_elastic_plastic_isotropic_hardening +.. autoclass:: felupe.LinearElasticOrthotropic + :members: + :undoc-members: + :inherited-members: + .. autoclass:: felupe.MaterialStrain :members: :undoc-members: diff --git a/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py b/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py index 8b2cb23d..b6ff19ec 100644 --- a/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py +++ b/src/felupe/constitution/linear_elasticity/_linear_elastic_orthotropic.py @@ -45,19 +45,19 @@ class LinearElasticOrthotropic(ConstitutiveMaterial): Shear modulus. G13 : float Shear modulus. - + Examples -------- .. pyvista-plot:: :context: - + >>> import felupe as fem >>> >>> umat = fem.LinearElasticOrthotropic( >>> E1=1, E2=1, E3=1, nu12=0.3, nu23=0.3, nu13=0.3, G12=0.4, G23=0.4, G13=0.4 >>> ) >>> ax = umat.plot() - + .. pyvista-plot:: :include-source: False :context: @@ -114,8 +114,8 @@ def gradient(self, x): Returns ------- - ndarray - Stress tensor (3x3) + ndarray of shape (3, 3, ...) + Stress tensor """ @@ -144,8 +144,8 @@ def hessian(self, x=None, shape=(1, 1), dtype=None): Returns ------- - ndarray - elasticity tensor (3x3x3x3) + ndarray of shape (3, 3, 3, 3, ...) + elasticity tensor """ diff --git a/tests/test_constitution.py b/tests/test_constitution.py index 61e012a9..898a1289 100644 --- a/tests/test_constitution.py +++ b/tests/test_constitution.py @@ -169,7 +169,7 @@ def test_linear_orthotropic(): G12=262, G23=34, G13=354, - **kwargs + **kwargs, ) stress = le.gradient(F)[:-1]