This page describes the python
modules based on the
TFEL
libraries.
tfel.math
modulestensor
classThree classes standing for symmetric tensors are available:
Stensor1D
: symmetric tensor in \(1D\).Stensor2D
: symmetric tensor in \(2D\).Stensor3D
: symmetric tensor in \(3D\).The standard mathematical operations are defined:
The following functions are available:
sigmaeq
: computes the von Mises norm of a symmetric
tensor.tresca
: computes the Tresca norm of a symmetric
tensor.st2tost2
classThree classes standing for linear transformation of symmetric tensors to symmetric tensors:
ST2toST1D
: linear transformation of symmetric tensors
to symmetric tensors in \(1D\).ST2toST2D
: linear transformation of symmetric tensors
to symmetric tensors in \(2D\).ST2toST3D
: linear transformation of symmetric tensors
to symmetric tensors in \(3D\).tfel.material
moduleThe following functions are available:
buildFromPiPlane
: returns a tuple containing the three
eigenvalues of the stress corresponding to the given point in the \(\pi\)-plane.projectOnPiPlane
: projects a stress state, defined its
three eigenvalues or by a symmetric tensor, on the \(\pi\)-plane.The computeHosfordStress
function, which compute the
Hosford equivalent stress, is available.
The following functions are available:
makeBarlatLinearTransformation1D
: builds a \(1D\) linear transformation of the stress
tensor.makeBarlatLinearTransformation2D
: builds a \(2D\) linear transformation of the stress
tensor.makeBarlatLinearTransformation3D
: builds a \(3D\) linear transformation of the stress
tensor.computeBarlatStress
: computes the Barlat equivalent
Barlat stress.The objects available are the following:
They can be constructed as:
from tfel.material import KGModuli
=1e9
K=0.2e9
G=KGModuli(K,G) kg
or
from tfel.material import KGModuli
=1e9
K=0.2e9
G=KGModuli(K,G)
kg=KGModuli(kg) kg2
and their methods permit to convert them:
ToYoungNu()
ToLambdaMu()
ToKG()
These methods return a tuple
, hence
KGModuli(1e9,0.2e9).ToYoungNu()
is a tuple
and
not a KGModuli object.
tfel.material.homogenization
moduleThe following functions are available:
computeSphereHillTensor
corresponds to the function
computeSphereHillPolarisationTensor
of
tfel::material::homogenization::elasticity
in 3d, where the
arguments are Young modulus and Poisson ratio:=1e9
young=0.2
nu=tfel.material.homogenization.computeSphereHillTensor(young,nu) P
computeAxisymmetricalHillTensor
corresponds to the
function computeAxisymmetricalHillPolarisationTensor
of
tfel::material::homogenization::elasticity
in 3d:=1e9
young=0.2
nu=10.
e=tfel.math.TVector3D()
n0]=0.
n[1]=0.
n[2]=1.
n[=tfel.material.homogenization.computeAxisymmetricalHillTensor(young,nu,n,e) P
computeHillTensor
corresponds to the function
computeHillPolarisationTensor
of
tfel::material::homogenization::elasticity
in 3d:=1e9
young=0.2
nu=tfel.math.TVector3D()
n_a=tfel.math.TVector3D()
n_b0]=0.
n_a[1]=0.
n_a[2]=1.
n_a[0]=0.
n_b[1]=1.
n_b[2]=0.
n_b[=10.
a=1.
b=3.
c=tfel.material.homogenization.computeHillPolarisationTensor(young,nu,n_a,a,n_b,b,c) P
computeAnisotropicHillTensor
corresponds to the
function computeAnisotropicHillTensor
of
tfel::material::homogenization::elasticity
in 3d (where the
stiffness tensor, a tfel.math.ST2toST23D
object, is an
argument):=tfel.math.ST2toST23D()
C0for i in range(6):
__setitem__(i,i,1e9)
C0.__setitem__(0,2,0.1e9)
C0.__setitem__(2,0,0.1e9)
C0.
=tfel.math.TVector3D()
n_a=tfel.math.TVector3D()
n_b0]=0.
n_a[1]=0.
n_a[2]=1.
n_a[0]=0.
n_b[1]=1.
n_b[2]=0.
n_b[
=10.
a=1.
b=3.
c=14 #optional
max_it
=tfel.material.homogenization.computeAnisotropicHillTensor(C0,n_a,a,n_b,b,c,max_it) P
The following functions are available:
computeSphereLocalisationTensor
computeAxisymmetricalEllipsoidLocalisationTensor
computeEllipsoidLocalisationTensor
computeAnisotropicLocalisationTensor
which are, in 3d, the same as those defined in
tfel::material::homogenization::elasticity
.
Here are some examples of computation:
=1e9
young=0.2
nu=100e9
young_i=0.3
nu_i
# Spherical inclusion
=tfel.material.homogenization.computeSphereLocalisationTensor(young,nu,young_i,nu_i)
A_S
# Axisymmetric ellipsoidal inclusion (or spheroid)
=20.
e=tfel.math.TVector3D()
n0]=0.
n[1]=0.
n[2]=1.
n[=tfel.material.homogenization.computeAxisymmetricalEllipsoidLocalisationTensor(young,nu,young_i,nu_i,n,e)
A_AE
# General ellipsoidal inclusion
=10.
a=1.
b=3.
c
=tfel.math.TVector3D()
n_a=tfel.math.TVector3D()
n_b0]=0.
n_a[1]=0.
n_a[2]=1.
n_a[0]=0.
n_b[1]=1.
n_b[2]=0.
n_b[
=tfel.material.homogenization.computeEllipsoidLocalisationTensor(young,nu,young_i,nu_i,n_a,a,n_b,b,c)
A_GE
# Anisotropic matrix
=12 #optional
max_it=tfel.math.ST2toST23D() # C0_glob is defined in the basis in which the localisation tensor is returned
C0_globfor i in range(6):
__setitem__(i,i,1e9)
C0_glob.__setitem__(0,2,0.1e9)
C0_glob.__setitem__(2,0,0.1e9)
C0_glob.
=tmath.ST2toST23D() # Ci_loc is defined in the basis defined by 'n_a' and 'n_b'
Ci_locfor i in range(6):
__setitem__(i,i,1e9)
Ci_loc.
=tfel.material.homogenization.computeAnisotropicLocalisationTensor(C0_glob,Ci_loc,n_a,a,n_b,b,c,max_it) A_AN
The following functions are available:
computeSphereDiluteScheme
computeSphereMoriTanakaScheme
computeOrientedDiluteScheme
computeOrientedMoriTanakaScheme
computeIsotropicDiluteScheme
computeIsotropicMoriTanakaScheme
computeTransverseIsotropicDiluteScheme
computeTransverseIsotropicMoriTanakaScheme
which are, in 3d, the same as those defined in
tfel::material::homogenization::elasticity
. Here are some
examples of computation:
=1e9
young=0.2
nu=100e9
young_i=0.3
nu_i=0.2
f
# Spherical inclusions
=tfel.material.homogenization.computeSphereDiluteScheme(young,nu,f,young_i,nu_i)
pairDS=tfel.material.homogenization.computeSphereMoriTanakaScheme(young,nu,f,young_i,nu_i)
pairMT=pairDS[0]
young_hom=pairDS[1]
nu_hom
# Ellipsoidal inclusions
=10.
a=1.
b=3.
c
## Isotropic distribution of orientations
=tfel.material.homogenization.computeIsotropicDiluteScheme(young,nu,f,young_i,nu_i,a,b,c)
pair_I_DS=tfel.material.homogenization.computeIsotropicMoriTanakaScheme(young,nu,f,young_i,nu_i,a,b,c)
pair_I_MT=pair_I_DS[0]
young_I=pair_I_DS[1]
nu_I
=tfel.math.TVector3D()
n_a=tfel.math.TVector3D()
n_b0]=0.
n_a[1]=0.
n_a[2]=1.
n_a[0]=0.
n_b[1]=1.
n_b[2]=0.
n_b[
## Ellipsoids which turn around their axis 'a'
=tfel.material.homogenization.computeTransverseIsotropicDiluteScheme(young,nu,f,young_i,nu_i,n_a,a,b,c)
C_TI_DS=tfel.material.homogenization.computeTransverseIsotropicMoriTanakaScheme(young,nu,f,young_i,nu_i,n_a,a,b,c)
C_TI_MT
## Oriented ellipsoids
=tfel.material.homogenization.computeOrientedDiluteScheme(young,nu,f,young_i,nu_i,n_a,a,n_b,b,c)
C_O_DS=tfel.material.homogenization.computeOrientedMoriTanakaScheme(young,nu,f,young_i,nu_i,n_a,a,n_b,b,c) C_O_MT
computeVoigtStiffness
corresponds to the function
computeVoigtStiffness
of
tfel::material::homogenization::elasticity
for 2 phases in
dimension 3.computeReussStiffness
corresponds to the function
computeReussStiffness
of
tfel::material::homogenization::elasticity
for 2 phases in
dimension 3.computeIsotropicHashinShtrikmanBounds
corresponds to
the function computeIsotropicHashinShtrikmanBounds
of
tfel::material::homogenization::elasticity
for 2 phases in
dimension 3.