Skip to content

Commit

Permalink
Add See also section in disctrings
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianDepriester committed Dec 6, 2024
1 parent 3fb73a8 commit ed895fa
Showing 1 changed file with 52 additions and 4 deletions.
56 changes: 52 additions & 4 deletions src/Elasticipy/FourthOrderTensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand All @@ -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')
Expand All @@ -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')

Expand All @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit ed895fa

Please sign in to comment.