This page describes the python modules based on the TFEL libraries.

The tfel.math module

Three classes standing for symmetric tensors are available:

The standard mathematical operations are defined:

The following functions are available:

Three classes standing for linear transformation of symmetric tensors to symmetric tensors:

The tfel.material module

The following functions are available:

The computeHosfordStress function, which compute the Hosford equivalent stress, is available.

The following functions are available:

The objects available are the following:

They can be constructed as:

from tfel.material import KGModuli
K=1e9
G=0.2e9
kg=KGModuli(K,G)

or

from tfel.material import KGModuli
K=1e9
G=0.2e9
kg=KGModuli(K,G)
kg2=KGModuli(kg)

and their methods permit to convert them:

These methods return a tuple, hence KGModuli(1e9,0.2e9).ToYoungNu() is a tuple and not a KGModuli object.

The tfel.material.homogenization module

Hill tensors

The following functions are available:

young=1e9
nu=0.2
P=tfel.material.homogenization.computeSphereHillTensor(young,nu)
young=1e9
nu=0.2
e=10.
n=tfel.math.TVector3D()
n[0]=0.
n[1]=0.
n[2]=1.
P=tfel.material.homogenization.computeAxisymmetricalHillTensor(young,nu,n,e)
young=1e9
nu=0.2
n_a=tfel.math.TVector3D()
n_b=tfel.math.TVector3D()
n_a[0]=0.
n_a[1]=0.
n_a[2]=1.
n_b[0]=0.
n_b[1]=1.
n_b[2]=0.
a=10.
b=1.
c=3.
P=tfel.material.homogenization.computeHillPolarisationTensor(young,nu,n_a,a,n_b,b,c)
C0=tfel.math.ST2toST23D()
for i in range(6):
    C0.__setitem__(i,i,1e9)
C0.__setitem__(0,2,0.1e9)
C0.__setitem__(2,0,0.1e9)


n_a=tfel.math.TVector3D()
n_b=tfel.math.TVector3D()
n_a[0]=0.
n_a[1]=0.
n_a[2]=1.
n_b[0]=0.
n_b[1]=1.
n_b[2]=0.

a=10.
b=1.
c=3.
max_it=14 #optional

P=tfel.material.homogenization.computeAnisotropicHillTensor(C0,n_a,a,n_b,b,c,max_it)

Localisation tensors

The following functions are available:

which are, in 3d, the same as those defined in tfel::material::homogenization::elasticity.

Here are some examples of computation:

young=1e9
nu=0.2
young_i=100e9
nu_i=0.3

# Spherical inclusion
A_S=tfel.material.homogenization.computeSphereLocalisationTensor(young,nu,young_i,nu_i)

# Axisymmetric ellipsoidal inclusion (or spheroid)
e=20.
n=tfel.math.TVector3D()
n[0]=0.
n[1]=0.
n[2]=1.
A_AE=tfel.material.homogenization.computeAxisymmetricalEllipsoidLocalisationTensor(young,nu,young_i,nu_i,n,e)

# General ellipsoidal inclusion
a=10.
b=1.
c=3.

n_a=tfel.math.TVector3D()
n_b=tfel.math.TVector3D()
n_a[0]=0.
n_a[1]=0.
n_a[2]=1.
n_b[0]=0.
n_b[1]=1.
n_b[2]=0.

A_GE=tfel.material.homogenization.computeEllipsoidLocalisationTensor(young,nu,young_i,nu_i,n_a,a,n_b,b,c)

# Anisotropic matrix
max_it=12 #optional
C0_glob=tfel.math.ST2toST23D() # C0_glob is defined in the basis in which the localisation tensor is returned
for i in range(6):
    C0_glob.__setitem__(i,i,1e9)
C0_glob.__setitem__(0,2,0.1e9)
C0_glob.__setitem__(2,0,0.1e9)

Ci_loc=tmath.ST2toST23D() # Ci_loc is defined in the basis defined by 'n_a' and 'n_b'
for i in range(6):
    Ci_loc.__setitem__(i,i,1e9)

A_AN=tfel.material.homogenization.computeAnisotropicLocalisationTensor(C0_glob,Ci_loc,n_a,a,n_b,b,c,max_it)

Homogenization schemes

The following functions are available:

which are, in 3d, the same as those defined in tfel::material::homogenization::elasticity. Here are some examples of computation:

young=1e9
nu=0.2
young_i=100e9
nu_i=0.3
f=0.2

# Spherical inclusions
pairDS=tfel.material.homogenization.computeSphereDiluteScheme(young,nu,f,young_i,nu_i)
pairMT=tfel.material.homogenization.computeSphereMoriTanakaScheme(young,nu,f,young_i,nu_i)
young_hom=pairDS[0]
nu_hom=pairDS[1]

# Ellipsoidal inclusions
a=10.
b=1.
c=3.

## Isotropic distribution of orientations
pair_I_DS=tfel.material.homogenization.computeIsotropicDiluteScheme(young,nu,f,young_i,nu_i,a,b,c)
pair_I_MT=tfel.material.homogenization.computeIsotropicMoriTanakaScheme(young,nu,f,young_i,nu_i,a,b,c)
young_I=pair_I_DS[0]
nu_I=pair_I_DS[1]

n_a=tfel.math.TVector3D()
n_b=tfel.math.TVector3D()
n_a[0]=0.
n_a[1]=0.
n_a[2]=1.
n_b[0]=0.
n_b[1]=1.
n_b[2]=0.

## Ellipsoids which turn around their axis 'a'
C_TI_DS=tfel.material.homogenization.computeTransverseIsotropicDiluteScheme(young,nu,f,young_i,nu_i,n_a,a,b,c)
C_TI_MT=tfel.material.homogenization.computeTransverseIsotropicMoriTanakaScheme(young,nu,f,young_i,nu_i,n_a,a,b,c)

## Oriented ellipsoids
C_O_DS=tfel.material.homogenization.computeOrientedDiluteScheme(young,nu,f,young_i,nu_i,n_a,a,n_b,b,c)
C_O_MT=tfel.material.homogenization.computeOrientedMoriTanakaScheme(young,nu,f,young_i,nu_i,n_a,a,n_b,b,c)

Homogenization bounds