From ed895fa30f2a2ddc91e4f3557d2dfef67fb44072 Mon Sep 17 00:00:00 2001 From: Dorian Date: Fri, 6 Dec 2024 11:29:37 +0100 Subject: [PATCH] Add See also section in disctrings --- src/Elasticipy/FourthOrderTensor.py | 56 ++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/src/Elasticipy/FourthOrderTensor.py b/src/Elasticipy/FourthOrderTensor.py index c683f0d..1801775 100644 --- a/src/Elasticipy/FourthOrderTensor.py +++ b/src/Elasticipy/FourthOrderTensor.py @@ -430,6 +430,12 @@ def hexagonal(cls, *, C11=0., C12=0., C13=0., C33=0., C44=0., phase_name=None): Returns ------- FourthOrderTensor + + See Also + -------- + transverse_isotropic : creates a transverse-isotropic tensor from engineering parameters + cubic : create a tensor from cubic symmetry + tetragonal : create a tensor from tetragonal symmetry """ return cls.fromCrystalSymmetry(symmetry='hexagonal', C11=C11, C12=C12, C13=C13, C33=C33, C44=C44, phase_name=phase_name, prefix='C') @@ -453,6 +459,11 @@ def trigonal(cls, *, C11=0., C12=0., C13=0., C14=0., C33=0., C44=0., C15=0., pha Returns ------- FourthOrderTensor + + See Also + -------- + tetragonal : create a tensor from tetragonal symmetry + orthorhombic : create a tensor from orthorhombic symmetry """ return cls.fromCrystalSymmetry(point_group='3', C11=C11, C12=C12, C13=C13, C14=C14, C15=C15, C33=C33, C44=C44, phase_name=phase_name, prefix='C') @@ -474,9 +485,15 @@ def tetragonal(cls, *, C11=0., C12=0., C13=0., C33=0., C44=0., C16=0., C66=0., p 16 component in Voigt notation (for point groups 4, -4 and 4/m only) phase_name : str, optional Phase name to display + Returns ------- FourthOrderTensor + + See Also + -------- + trigonal : create a tensor from trigonal symmetry + orthorhombic : create a tensor from orthorhombic symmetry """ return cls.fromCrystalSymmetry(point_group='4', C11=C11, C12=C12, C13=C13, C16=C16, C33=C33, C44=C44, C66=C66, phase_name=phase_name, prefix='C') @@ -496,6 +513,11 @@ def cubic(cls, *, C11=0., C12=0., C44=0., phase_name=None): Returns ------- StiffnessTensor + + See Also + -------- + hexagonal : create a tensor from hexagonal symmetry + orthorhombic : create a tensor from orthorhombic symmetry """ return cls.fromCrystalSymmetry(symmetry='cubic', C11=C11, C12=C12, C44=C44, phase_name=phase_name, prefix='C') @@ -513,7 +535,6 @@ def orthorhombic(cls, *, C11=0., C12=0., C13=0., C22=0., C23=0., C33=0., C44=0., C23 : float C33 : float C44 : float - C44 : float C55 : float C66 : float phase_name : str, optional @@ -522,6 +543,11 @@ def orthorhombic(cls, *, C11=0., C12=0., C13=0., C22=0., C23=0., C33=0., C44=0., Returns ------- FourthOrderTensor + + See Also + -------- + monoclinic : create a tensor from monoclinic symmetry + orthorhombic : create a tensor from orthorhombic symmetry """ return cls.fromCrystalSymmetry(symmetry='orthorhombic', C11=C11, C12=C12, C13=C13, C22=C22, C23=C23, C33=C33, C44=C44, C55=C55, C66=C66, @@ -564,6 +590,11 @@ def monoclinic(cls, *, C11=0., C12=0., C13=0., C22=0., C23=0., C33=0., C44=0., C Returns ------- FourthOrderTensor + + See Also + -------- + triclinic : create a tensor from triclinic symmetry + orthorhombic : create a tensor from orthorhombic symmetry """ diad_y = not (None in (C15, C25, C35, C46)) diad_z = not (None in (C16, C26, C36, C45)) @@ -618,6 +649,11 @@ def triclinic(cls, C11=0., C12=0., C13=0., C14=0., C15=0., C16=0., Returns ------- FourthOrderTensor + + See Also + -------- + monoclinic : create a tensor from monoclinic symmetry + orthorhombic : create a tensor from orthorhombic symmetry """ matrix=np.array([[C11, C12, C13, C14, C15, C16], [C12, C22, C23, C24, C25, C26], @@ -800,6 +836,10 @@ def isotropic(cls, E=None, nu=None, lame1=None, lame2=None, phase_name=None): ------- Corresponding isotropic stiffness tensor + See Also + -------- + transverse_isotropic : create a transverse-isotropic tensor + Examples -------- On can check that the shear modulus for steel is around 82 GPa: @@ -868,6 +908,10 @@ def orthotropic(cls, *, Ex, Ey, Ez, nu_xy, nu_xz, nu_yz, Gxy, Gxz, Gyz, **kwargs Returns ------- StiffnessTensor + + See Also + -------- + transverse_isotropic : create a stiffness tensor for transverse-isotropic symmetry """ tri_sup = np.array([[1/Ex, -nu_xy/Ey, -nu_xz/Ez, 0, 0, 0], [0, 1/Ey, -nu_yz/Ez, 0, 0, 0], @@ -901,11 +945,15 @@ def transverse_isotropic(cls, *, Ex, Ez, nu_xy, nu_xz, Gxz, **kwargs): Returns ------- StiffnessTensor + + See Also + -------- + orthotropic : create a stiffness tensor for orthotropic symmetry """ Gxy = Ex / (2 * (1+nu_xy)) - C = cls.orthotropic(Ex=Ex, Ey=Ex, Ez=Ez, - nu_xy=nu_xy, nu_xz=nu_xz, nu_yz=nu_xz, - Gxy=Gxy, Gxz=Gxz, Gyz=Gxz, **kwargs) + C = StiffnessTensor.orthotropic(Ex=Ex, Ey=Ex, Ez=Ez, + nu_xy=nu_xy, nu_xz=nu_xz, nu_yz=nu_xz, + Gxy=Gxy, Gxz=Gxz, Gyz=Gxz, **kwargs) C.symmetry = 'transverse-isotropic' return C