models#

The EasyFEA/models/ module in EasyFEA provides essential tools for creating and managing models. These models are used to build _Simu instances and mainly contain material parameters.

With this module, you can construct:

Detailed materials API#

Module containing constitutive laws for materials, including elastic, hyperelastic, damage, thermal, and beam materials.

EasyFEA.models.Apply_Pmat(P, M, toGlobal=True)[source]#

Performs a basis transformation from the material’s coordinate system to the (x,y,z) coordinate system to orient the material in space.

Caution: P must be in Kelvin mandel notation

Parameters:
  • P (_types.FloatArray) – P in mandel notation obtained with Get_Pmat

  • M (_types.FloatArray) – 3x3 or 6x6 matrix

  • toGlobal (bool, optional) –

    sets wheter you want to get matrix in global or material coordinates, by default True

    if toGlobal:

    Matrix_global = P * C_material * P’

    else:

    Matrix_material = P’ * Matrix_global * P

Returns:

new matrix

Return type:

_types.FloatArray

class EasyFEA.models.BeamElasIsot(dim, line, section, E, v, yAxis=(0, 1, 0))[source]#

Bases: _Beam

Isotropic elastic beam.

E: float#

Young’s modulus

Get_D()[source]#

Returns a matrix characterizing the beam’s stiffness behavior.

Return type:

ndarray[tuple[Any, ...], dtype[floating]]

property mu: float#

shear modulus (G)

v: float#

Poisson’s ratio

class EasyFEA.models.BeamStructure(beams)[source]#

Bases: _IModel

Beam structure class.

Calc_D_e_pg(groupElem)[source]#

Returns a matrix characterizing the beams’s stiffness behavior.

Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

Get_axis_e(groupElem)[source]#

Returns the fiber and cross bar vertical axis on every elements.

return xAxis_e, yAxis_e

Return type:

tuple[ndarray[tuple[Any, ...], dtype[floating]], ndarray[tuple[Any, ...], dtype[floating]]]

property areas: list[float]#

beams areas

property beams: list[_Beam]#
property dim: int#

model dimensions

1D -> tension compression

2D -> tension compression + bending + flexion

3D -> all

property dof_n: int#

Degrees of freedom per node.

1D -> [u1, … , un]

2D -> [u1, v1, rz1, …, un, vn, rzn]

3D -> [u1, v1, w1, rx1, ry1, rz1, …, u2, v2, w2, rx2, ry2, rz2]

property modelType: ModelType#

model type

property nBeam: int#

Number of beams in the structure

property thickness: float#

The beam structure can have several beams and therefore different sections.

You need to look at the section of the beam you are interested in.

class EasyFEA.models.ElasAnisot(dim, C, useVoigtNotation, axis1=(1, 0, 0), axis2=(0, 1, 0), thickness=1.0)[source]#

Bases: _Elas

Anisotropic Linearized Elastic material.

Set_C(C, useVoigtNotation=True, update_S=True)[source]#

Updates the constitutives laws by updating the C stiffness and S compliance matrices in Kelvin Mandel notation.

Parameters:
  • C (_types.FloatArray) – Stifness matrix (Lamé’s law)

  • useVoigtNotation (bool, optional) – uses Kevin Mandel’s notation, by default True

  • update_S (bool, optional) – updates the compliance matrix (Hooke’s law), by default True

Walpole_Decomposition()[source]#

Walpole’s decomposition in Kelvin Mandel notation such that:

C = sum(ci * Ei).

returns ci, Ei

Return type:

tuple[ndarray[tuple[Any, ...], dtype[floating]], ndarray[tuple[Any, ...], dtype[floating]]]

property axis1: ndarray[tuple[Any, ...], dtype[floating]]#

axis1 vector

property axis2: ndarray[tuple[Any, ...], dtype[floating]]#

axis2 vector

class EasyFEA.models.ElasIsot(dim, E=210000.0, v=0.3, planeStress=True, thickness=1.0)[source]#

Bases: _Elas

Isotropic Linearized Elastic material.

E: float#

Young’s modulus

Walpole_Decomposition()[source]#

Walpole’s decomposition in Kelvin Mandel notation such that:

C = sum(ci * Ei).

returns ci, Ei

Return type:

tuple[ndarray[tuple[Any, ...], dtype[floating]], ndarray[tuple[Any, ...], dtype[floating]]]

get_bulk()[source]#

Bulk modulus

get_lambda()[source]#
get_mu()[source]#

Shear coefficient

v: float#

Poisson’s ratio (-1<v<0.5)

class EasyFEA.models.ElasIsotTrans(dim, El, Et, Gl, vl, vt, axis_l=(1, 0, 0), axis_t=(0, 1, 0), planeStress=True, thickness=1.0)[source]#

Bases: _Elas

Transversely Isotropic Linearized Elastic material.

El: float#

Longitudinal Young’s modulus.

Et: float#

Transverse Young’s modulus.

Gl: float#

Longitudinal shear modulus.

property Gt: float | ndarray[tuple[Any, ...], dtype[floating]]#

Transverse shear modulus.

Walpole_Decomposition()[source]#

Walpole’s decomposition in Kelvin Mandel notation such that:

C = sum(ci * Ei).

returns ci, Ei

Return type:

tuple[ndarray[tuple[Any, ...], dtype[floating]], ndarray[tuple[Any, ...], dtype[floating]]]

property axis_l: ndarray[tuple[Any, ...], dtype[floating]]#

Longitudinal axis

property axis_t: ndarray[tuple[Any, ...], dtype[floating]]#

Transversal axis

property kt: float | ndarray[tuple[Any, ...], dtype[floating]]#
vl: float#

Longitudinal Poisson’s ratio (-1<vl<0.5).

vt: float#

Transverse Poisson ratio (-1<vt<1)

EasyFEA.models.Get_Pmat(axis_1, axis_2, useMandel=True)[source]#

Constructs Pmat to pass from the material coordinates (x,y,z) to the global coordinate (X,Y,Z) such that:

if useMandel:

return [Pm]

else:

return [Ps], [Pe]

In Kelvin Mandel notation:#

Sig & Eps en [11, 22, 33, sqrt(2)*23, sqrt(2)*13, sqrt(2)*12]

[C_global] = [Pm] * [C_material] * [Pm]^T & [C_material] = [Pm]^T * [C_global] * [Pm]

[S_global] = [Pm] * [S_material] * [Pm]^T & [S_material] = [Pm]^T * [S_global] * [Pm]

Sig_global = [Pm] * Sig_material & Sig_material = [Pm]^T * Sig_global

Eps_global = [Pm] * Eps_material & Eps_material = [Pm]^T * Eps_global

In Voigt’s notation:#

Sig [S11, S22, S33, S23, S13, S12]

Eps [E11, E22, E33, 2*E23, 2*E13, 2*E12]

[C_global] = [Ps] * [C_material] * [Ps]^T & [C_material] = [Pe]^T * [C_global] * [Pe]

S_global = [Pe] * [S_material] * [Pe]^T & [S_material] = [Ps]^T * S_global * [Ps]

Sig_global = [Ps] * Sig_material & Sig_material = [Pe]^T * Sig_global

Eps_global = [Pe] * Eps_material & Eps_material = [Ps]^T * Eps_global

P matrices are orhogonal such that: inv([P]) = [P]^T

Here we use “Chevalier 1988 : Comportements élastique et viscoélastique des composites”

EasyFEA.models.Heterogeneous_Array(array)[source]#

Builds a heterogeneous array.

class EasyFEA.models.HyperElastic[source]#

Bases: object

static Compute_C(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the right Cauchy-Green tensor C(u) = F(u)’.F(u)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

Returns:

  • FeArray – C_e_pg of shape (Ne, pg, 3, 3)

  • dim = 1

  • ——-

  • cxx 0 0

  • 0 0 0

  • 0 0 0

  • dim = 2

  • ——-

  • cxx cxy 0

  • cyx cyy 0

  • 0 0 0

  • dim = 3

  • ——-

  • cxx cxy cxz

  • cyx cyy cyz

  • czx czy czz

static Compute_De(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes De(u)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

  • 2 (Returns if dim =)

  • ------------------

  • FeArray.FeArrayALike

    D_e_pg of shape (Ne, pg, 3, 4)

    [1+dxux, 0, dxuy, 0] # xx

    [0, dyux, 0, 1+dyuy] # yy

    2**(-1/2) [dyux, 1+dxux, 1+dyuy, dxuy # xy

  • 3 (Returns if dim =)

  • ------------------

  • FeArray.FeArrayALike

    D_e_pg of shape (Ne, pg, 6, 9)

    [1+dxux, 0, 0, dxuy, 0, 0, dxuz, 0, 0] # xx

    [0, dyux, 0, 0, 1+dyuy, 0, 0, dyuz, 0] # yy

    [0, 0, dzux, 0, 0, dzuy, 0, 0, 1+dzuz] # zz

    2**(-1/2) [0, dzux, dyux, 0, dzuy, 1 + dyuy, 0, 1 + dzuz, dyuz] # yz

    2**(-1/2) [dzux, 0, 1 + dxux, dzuy, 0, dxuy, 1 + dzuz, 0, dxuz] # xz

    2**(-1/2) [dyux, 1+dxux, 0, 1+dyuy, dxuy, 0, dyuz, dxuz, 0] # xy

Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

static Compute_Epsilon(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the linearized deformation Epsilon = 1/2 (grad(u)’ + grad(u))

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

  • 2 (Returns if dim =)

  • ------------------

  • FeArray

    Eps_e_pg of shape (Ne, pg, 3)

    [xx, yy, 2**(-1/2) xy]

  • 3 (Returns if dim =)

  • ------------------

  • FeArray

    Eps_e_pg of shape (Ne, pg, 6)

    [xx, yy, zz, 2**(-1/2) yz, 2**(-1/2) xz, 2**(-1/2) xy]

Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

static Compute_F(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the deformation gradient F(u) = I + grad(u)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

Returns:

  • FeArray – F(u) of shape (Ne, pg, 3, 3)

  • dim = 1

  • ——-

  • 1+dxux 0 0

  • 0 1 0

  • 0 0 1

  • dim = 2

  • ——-

  • 1+dxux dyux 0

  • dxuy 1+dyuy 0

  • 0 0 1

  • dim = 3

  • ——-

  • 1+dxux dyux dzux

  • dxuy 1+dyuy dzuy

  • dxuz dyuz 1+dzuz

static Compute_GreenLagrange(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the Green-Lagrange deformation E = 1/2 (C - I)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

E_e_pg of shape (Ne, pg, dim, dim)

Return type:

FeArray

static Compute_I1(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes I1(u)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

I1_e_pg of shape (Ne, pg)

Return type:

FeArray

static Compute_I2(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes I2(u)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

I2_e_pg of shape (Ne, pg)

Return type:

FeArray

static Compute_I3(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes I3(u)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

I3_e_pg of shape (Ne, pg)

Return type:

FeArray

static Compute_I4(mesh, u, T, matrixType=MatrixType.rigi)[source]#

Computes I4(u)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • T (_types.FloatArray) – direction

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

I4_e_pg of shape (Ne, pg)

Return type:

FeArray

static Compute_J(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the deformation gradient J = det(F)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

J_e_pg of shape (Ne, pg)

Return type:

FeArray

static Compute_d2I1dC()[source]#

Computes d2I1dC(u)

Returns:

d2I1dC of shape (6, 6)

Return type:

FeArray

static Compute_d2I2dC()[source]#

Computes d2I2dC(u)

Returns:

d2I2dC of shape (6, 6)

Return type:

FeArray

static Compute_d2I3dC(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes d2I3dC(u)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

d2I3dC_e_pg of shape (Ne, pg, 6, 6)

Return type:

FeArray

static Compute_d2I4dC()[source]#

Computes d2I4dC(u)

Returns:

d2I4dC of shape (6, 6)

Return type:

FeArray

static Compute_dI1dC()[source]#

Computes dI1dC(u)

Returns:

dI1dC of shape (6)

Return type:

FeArray

static Compute_dI2dC(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes dI2dC(u)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

dI2dC_e_pg of shape (Ne, pg, 3, 3)

Return type:

FeArray

static Compute_dI3dC(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes dI3dC(u)

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [ux1, uy1, uz1, …, uxN, uyN, uzN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

dI3dC_e_pg of shape (Ne, pg, 3, 3)

Return type:

FeArray

static Compute_dI4dC(T)[source]#

Computes dI4dC(u)

Parameters:
  • mesh (Mesh) – mesh

  • T (_types.FloatArray) – direction

Returns:

dI4dC_e_pg of shape (Ne, pg, 6)

Return type:

FeArray

EasyFEA.models.KelvinMandel_Matrix(dim, M)[source]#

Apply Kelvin Mandel coefficient to constitutive laws.

Return type:

ndarray[tuple[Any, ...], dtype[floating]]

In 2D:#

[1, 1, r2]

[1, 1, r2]

[r2, r2, 2]]

In 3D:#

[1,1,1,r2,r2,r2]

[1,1,1,r2,r2,r2]

[1,1,1,r2,r2,r2]

[r2,r2,r2,2,2,2]

[r2,r2,r2,2,2,2]

[r2,r2,r2,2,2,2]]

class EasyFEA.models.ModelType(value)[source]#

Bases: str, Enum

Model types.

beam = 'beam'#
damage = 'damage'#
elastic = 'elastic'#
hyperelastic = 'hyperelastic'#
thermal = 'thermal'#
classmethod types()[source]#
weakForm = 'weakForm'#
class EasyFEA.models.MooneyRivlin(dim, K1, K2, thickness=1.0)[source]#

Bases: _HyperElas

Compute_W(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the quadratic energy W(u).

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [u1, v1, w1, …, uN, vN, wN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

We_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_d2Wde(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes dΣde.

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [u1, v1, w1, …, uN, vN, wN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

dΣde_e_pg of shape (Ne, pg, 6, 6)

Return type:

FeArray

Compute_dWde(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the second Piola-Kirchhoff tensor Σ(u).

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [u1, v1, w1, …, uN, vN, wN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Return type:

FeArray

Returns:

  • FeArray – Σ_e_pg of shape (Ne, pg, 6)

  • Σxx, Σyy, Σzz, sqrt(2) Σyz, sqrt(2) Σxz, sqrt(2) Σxy

K1: float#

Kappa1

K2: float#

Kappa2

class EasyFEA.models.NeoHookean(dim, K, thickness=1.0)[source]#

Bases: _HyperElas

Compute_W(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the quadratic energy W(u).

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [u1, v1, w1, …, uN, vN, wN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

We_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_d2Wde(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes dΣde.

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [u1, v1, w1, …, uN, vN, wN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

dΣde_e_pg of shape (Ne, pg, 6, 6)

Return type:

FeArray

Compute_dWde(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the second Piola-Kirchhoff tensor Σ(u).

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [u1, v1, w1, …, uN, vN, wN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Return type:

FeArray

Returns:

  • FeArray – Σ_e_pg of shape (Ne, pg, 6)

  • Σxx, Σyy, Σzz, sqrt(2) Σyz, sqrt(2) Σxz, sqrt(2) Σxy

K: float#

Bulk modulus

class EasyFEA.models.PhaseField(material, split, regularization, Gc, l0, solver=SolverType.History, A=None)[source]#

Bases: _IModel

PhaseField class.

A#

matrix characterizing the weak anisotropy in the crack surface density function

Calc_C(Epsilon_e_pg, verif=False)[source]#

Computes the splited stifness matrices for the given strain field.

Parameters:

Epsilon_e_pg (FeArray.FeArrayALike) – strains field (e, p, D)

Returns:

cP_e_pg, cM_e_pg: positive and negative stifness matrices (e, p, D, D)

Return type:

FeArray

Calc_Sigma_e_pg(Epsilon_e_pg)[source]#

Computes the Stress field using the strains and the split such that:

SigmaP_e_pg = cP_e_pg * Epsilon_e_pg

SigmaM_e_pg = cM_e_pg * Epsilon_e_pg

Parameters:

Epsilon_e_pg (FeArray.FeArrayALike) – strains field (e, p, D)

Returns:

SigmaP_e_pg, SigmaM_e_pg: positive and negative stress fields (e, p, D)

Return type:

FeArray

Calc_psi_e_pg(Epsilon_e_pg)[source]#

Computes the elastic energy densities.

psiP_e_pg = 1/2 SigmaP_e_pg * Epsilon_e_pg

psiM_e_pg = 1/2 SigmaM_e_pg * Epsilon_e_pg

Such as :

SigmaP_e_pg = cP_e_pg * Epsilon_e_pg

SigmaM_e_pg = cM_e_pg * Epsilon_e_pg

Return type:

tuple[Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]], Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]]

Gc: float#

critical energy release rate

Get_f_e_pg(PsiP_e_pg)[source]#

Returns source therm

Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

Get_g_e_pg(d_n, mesh, matrixType, k_res=1e-12)[source]#

Returns degradation function

Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

Get_r_e_pg(PsiP_e_pg)[source]#

Returns reaction therm

Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

static Get_regularizations()[source]#

Returns regularizations available

Return type:

list[ReguType]

static Get_solvers()[source]#

Returns available solvers used to manage crack irreversibility

Return type:

list[SolverType]

static Get_splits()[source]#

Returns splits available

Return type:

list[SplitType]

class ReguType(value)[source]#

Bases: str, Enum

Regularization models.

AT1 = 'AT1'#
AT2 = 'AT2'#
class SolverType(value)[source]#

Bases: str, Enum

Solver used to manage crack irreversibility.

BoundConstrain = 'BoundConstrain'#
History = 'History'#
HistoryDamage = 'HistoryDamage'#
class SplitType(value)[source]#

Bases: str, Enum

Split models.

Amor = 'Amor'#
AnisotStrain = 'AnisotStrain'#
AnisotStrain_MP = 'AnisotStrain_MP'#
AnisotStrain_NoCross = 'AnisotStrain_NoCross'#
AnisotStrain_PM = 'AnisotStrain_PM'#
AnisotStress = 'AnisotStress'#
AnisotStress_MP = 'AnisotStress_MP'#
AnisotStress_NoCross = 'AnisotStress_NoCross'#
AnisotStress_PM = 'AnisotStress_PM'#
Bourdin = 'Bourdin'#
He = 'He'#
Miehe = 'Miehe'#
Stress = 'Stress'#
Zhang = 'Zhang'#
property c_w#

scaling parameter for accurate dissipation of crack energy

property dim: int#

model dimension

property isHeterogeneous: bool#

indicates whether the model has heterogeneous parameters

property k: float | ndarray[tuple[Any, ...], dtype[floating]]#

get diffusion therm

l0: float#

half crack width

property material: _Elas#

elastic material

property modelType: ModelType#

model type

regularization: ReguType#

crack regularization model

solver: SolverType#

solver used to manage crack irreversibility

split: SplitType#

split used to decompose the elastic energy density

property thickness: float#

thickness used in the model

EasyFEA.models.Project_Kelvin(A, orderA=None)[source]#

Projects the tensor A in Kelvin Mandel notation.

Parameters:
  • A (_types.FloatArray) – tensor A (2 or 4 order tensor)

  • orderA (int, optional) – tensor order, by default None

Returns:

Projected tensor

Return type:

_types.FloatArray

EasyFEA.models.Project_matrix_to_vector(matrix, coef=np.float64(1.4142135623730951))[source]#
Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

EasyFEA.models.Project_vector_to_matrix(vector, coef=np.float64(1.4142135623730951))[source]#
Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

EasyFEA.models.Reshape_variable(variable, Ne, nPg)[source]#

Resizes variable to (Ne, nPg, …) shape.

Return type:

Union[FeArray, ndarray[tuple[Any, ...], dtype[Any]]]

EasyFEA.models.Result_in_Strain_or_Stress_field(field_e, result, coef=np.float64(1.4142135623730951))[source]#

Extracts a specific result from a 2D or 3D strain or stress field.

Parameters:
  • field_e (_types.FloatArray) – Strain or stress field in each element.

  • result (str) –

    Desired result/value to extract:

    2D: [xx, yy, xy, vm, Strain, Stress]

    3D: [xx, yy, zz, yz, xz, xy, vm, Strain, Stress]

  • coef (float, optional) – Coefficient used to scale cross components in the field (e.g., xy/coef in dim=2, or yz/coef, xz/coef, xy/coef if dim=3).

Returns:

The extracted field corresponding to the specified result.

Return type:

_types.FloatArray

class EasyFEA.models.SaintVenantKirchhoff(dim, lmbda, mu, thickness=1.0)[source]#

Bases: _HyperElas

Compute_W(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the quadratic energy W(u).

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [u1, v1, w1, …, uN, vN, wN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

We_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_d2Wde(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes dΣde.

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [u1, v1, w1, …, uN, vN, wN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Returns:

dΣde_e_pg of shape (Ne, pg, 6, 6)

Return type:

FeArray

Compute_dWde(mesh, u, matrixType=MatrixType.rigi)[source]#

Computes the second Piola-Kirchhoff tensor Σ(u).

Parameters:
  • mesh (Mesh) – mesh

  • u (_types.FloatArray) – discretized displacement field [u1, v1, w1, …, uN, vN, wN] of size Nn * dim

  • matrixType (MatrixType, optional) – matrix type, by default MatrixType.rigi

Return type:

FeArray

Returns:

  • FeArray – Σ_e_pg of shape (Ne, pg, 6)

  • Σxx, Σyy, Σzz, sqrt(2) Σyz, sqrt(2) Σxz, sqrt(2) Σxy

lmbda: float#

Lame’s first parameter

mu: float#

Shear modulus

class EasyFEA.models.Thermal(k, c=0.0, thickness=1.0)[source]#

Bases: _IModel

Thermal class.

c#

mass heat capacity [J K^-1 kg^-1]

dim: int#
property isHeterogeneous: bool#

indicates whether the model has heterogeneous parameters

k#

thermal conductivity [W m^-1]

property modelType: ModelType#

model type

thickness: float#
class EasyFEA.models.WeakForms(field, computeK, computeC=None, computeM=None, computeF=None, thickness=1.0)[source]#

Bases: _IModel

Class responsible for computing the finite element matrices used in the system ( K u + C v + M a = F ).

property computeC: BiLinearForm | None#

Function used to build damping matrix C from ( K u + C v + M a = F ).

property computeF: LinearForm | None#

Function used to build force vector F from ( K u + C v + M a = F ).

property computeK: BiLinearForm | None#

Function used to build stiffness matrix K from ( K u + C v + M a = F ).

property computeM: BiLinearForm | None#

Function used to build mass matrix M from ( K u + C v + M a = F ).

property dim: int#

model dimension

property field: Field#

Finite element field.

property modelType: ModelType#

model type

thickness#
class EasyFEA.models._IModel[source]#

Bases: Observable, Updatable, ABC

Model interface.

Need_Update(value=True)[source]#

Indicates whether the object needs to be updated.

abstract property dim: int#

model dimension

property isHeterogeneous: bool#

indicates whether the model has heterogeneous parameters

abstract property modelType: ModelType#

model type

abstract property thickness: float#

thickness used in the model