Models#

The EasyFEA.Models module 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:

Models API#

Module implementing constitutive laws used in simulations.

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

Bases: str, Enum

Model types.

classmethod types()[source]#
beam = 'beam'#
damage = 'damage'#
elastic = 'elastic'#
hyperelastic = 'hyperelastic'#
thermal = 'thermal'#
weakForm = 'weakForm'#
class EasyFEA.Models.PhaseField(
material,
split,
regularization,
Gc,
l0,
solver=SolverType.History,
A=None,
useNumba=True,
)[source]#

Bases: _IModel

PhaseField class.

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'#
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]

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]]]]

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]]]

_Eigen_values_vectors_projectors(vector_e_pg, verif=False)[source]#

Computes the eigen values and eigen projectors of a second-order tensor (as a vector).

Return type:

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

A#

matrix characterizing the weak anisotropy in the crack surface density function

Gc: float#

critical energy release rate

property c_w[source]#

scaling parameter for accurate dissipation of crack energy

property dim: int[source]#

model dimension

property isHeterogeneous: bool[source]#

indicates whether the model has heterogeneous parameters

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

get diffusion therm

l0: float#

half crack width

property material: _Elastic[source]#

elastic material

property modelType: ModelType[source]#

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[source]#

thickness used in the model

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[source]#

indicates whether the model has heterogeneous parameters

k#

thermal conductivity [W m^-1]

property modelType: ModelType[source]#

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 \(\Krm \, \mathrm{u} + \Crm \, \vrm + \Mrm \, \arm = \Frm\).

property computeC: BiLinearForm | None[source]#

Function used to build stiffness matrix \(\Crm\).

property computeF: LinearForm | None[source]#

Function used to build force vector \(\Frm\).

property computeK: BiLinearForm | None[source]#

Function used to build stiffness matrix \(\Krm\).

property computeM: BiLinearForm | None[source]#

Function used to build stiffness matrix \(\Mrm\).

property dim: int[source]#

model dimension

property field: Field[source]#

Finite element field.

property modelType: ModelType[source]#

model type

thickness: float#
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[source]#

model dimension

property isHeterogeneous: bool[source]#

indicates whether the model has heterogeneous parameters

abstract property modelType: ModelType[source]#

model type

abstract property thickness: float[source]#

thickness used in the model

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

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.

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]]

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_pg,
result,
coef=np.float64(1.4142135623730951),
)[source]#

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

Parameters:
  • field_e_pg (_types.FloatArray) – Strain or stress field in each element and gauss points.

  • 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

Elastic module.

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

Bases: _Elastic

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]]]

_Behavior(C, useVoigtNotation)[source]#
Return type:

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

_Update()[source]#

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

Return type:

None

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

axis1 vector

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

axis2 vector

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

Bases: _Elastic

Isotropic Linearized Elastic material.

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]]]

_Behavior(dim=None)[source]#

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

In 2D:#

C -> C : Epsilon = Sigma [Sxx Syy sqrt(2)*Sxy]

S -> S : Sigma = Epsilon [Exx Eyy sqrt(2)*Exy]

In 3D:#

C -> C : Epsilon = Sigma [Sxx Syy Szz sqrt(2)*Syz sqrt(2)*Sxz sqrt(2)*Sxy]

S -> S : Sigma = Epsilon [Exx Eyy Ezz sqrt(2)*Eyz sqrt(2)*Exz sqrt(2)*Exy]

_Update()[source]#

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

Return type:

None

get_bulk()[source]#

Bulk modulus

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

Shear coefficient

E: float#

Young’s modulus

v: float#

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

class EasyFEA.Models.Elastic.Orthotropic(
dim,
E1,
E2,
E3,
G23,
G13,
G12,
v23,
v13,
v12,
axis_1=(1, 0, 0),
axis_2=(0, 1, 0),
planeStress=True,
thickness=1.0,
)[source]#

Bases: _Elastic

Orthotropic Linearized Elastic material.

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]]]

_Behavior(dim=None)[source]#

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

In 2D:#

C -> C : Epsilon = Sigma [Sxx Syy sqrt(2)*Sxy]

S -> S : Sigma = Epsilon [Exx Eyy sqrt(2)*Exy]

In 3D:#

C -> C : Epsilon = Sigma [Sxx Syy Szz sqrt(2)*Syz sqrt(2)*Sxz sqrt(2)*Sxy]

S -> S : Sigma = Epsilon [Exx Eyy Ezz sqrt(2)*Eyz sqrt(2)*Exz sqrt(2)*Exy]

_Update()[source]#

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

Return type:

None

E1: float#

Young’s modulus along axis_1.

E2: float#

Young’s modulus along axis_2.

E3: float#

Young’s modulus along axis_3.

G12: float#

Shear modulus in the 1-2 plane.

G13: float#

Shear modulus in the 1-3 plane.

G23: float#

Shear modulus in the 2-3 plane.

property _c11: float | ndarray[tuple[Any, ...], dtype[floating]][source]#
property _c12: float | ndarray[tuple[Any, ...], dtype[floating]][source]#
property _c13: float | ndarray[tuple[Any, ...], dtype[floating]][source]#
property _c22: float | ndarray[tuple[Any, ...], dtype[floating]][source]#
property _c23: float | ndarray[tuple[Any, ...], dtype[floating]][source]#
property _c33: float | ndarray[tuple[Any, ...], dtype[floating]][source]#
property _c44: float | ndarray[tuple[Any, ...], dtype[floating]][source]#
property _c55: float | ndarray[tuple[Any, ...], dtype[floating]][source]#
property _c66: float | ndarray[tuple[Any, ...], dtype[floating]][source]#
property axis_1: ndarray[tuple[Any, ...], dtype[floating]][source]#

Axis 1

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

Axis 2

v12: float#

Poisson’s ratio for transverse strain along the axis_2 when stressed along the axis_1.

v13: float#

Poisson’s ratio for transverse strain along the axis_3 when stressed along the axis_1.

v23: float#

Poisson’s ratio for transverse strain along the axis_3 when stressed along the axis_2.

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

Bases: _Elastic

Transversely Isotropic Linearized Elastic material.

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]]]

_Behavior(dim=None)[source]#

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

In 2D:#

C -> C : Epsilon = Sigma [Sxx Syy sqrt(2)*Sxy]

S -> S : Sigma = Epsilon [Exx Eyy sqrt(2)*Exy]

In 3D:#

C -> C : Epsilon = Sigma [Sxx Syy Szz sqrt(2)*Syz sqrt(2)*Sxz sqrt(2)*Sxy]

S -> S : Sigma = Epsilon [Exx Eyy Ezz sqrt(2)*Eyz sqrt(2)*Exz sqrt(2)*Exy]

_Update()[source]#

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

Return type:

None

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]][source]#

Transverse shear modulus.

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

Longitudinal axis

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

Transversal axis

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

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

vt: float#

Transverse Poisson ratio (-1<vt<1)

class EasyFEA.Models.Elastic._Elastic(dim, thickness, planeStress)[source]#

Bases: _IModel, ABC

Linearized Elasticity material.

ElasIsot, ElasIsotTrans and ElasAnisot inherit from _Elas class.

static Available_Laws()[source]#
Get_sqrt_C_S()[source]#

Returns the Matrix square root of C and S.

Return type:

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

abstractmethod 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]]]

_Apply_basis_transformation(dim, material_cM, material_sM, axis_1, axis_2)[source]#

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

Parameters:
  • dim (int) – dimension

  • material_cM (_types.FloatArray) – stiffness matrix

  • material_sM (_types.FloatArray) – compliance matrix

  • axis_1 (_types.FloatArray) – Axis 1

  • axis_2 (_types.FloatArray) – Axis 2

Returns:

global_cM, global_sM

Return type:

tuple[_types.FloatArray, _types.FloatArray]

abstractmethod _Update()[source]#

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

Return type:

None

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

Stifness matrix in Kelvin Mandel notation such that:

In 2D: C -> C: Epsilon = Sigma [Sxx, Syy, sqrt(2)*Sxy]

In 3D: C -> C: Epsilon = Sigma [Sxx, Syy, Szz, sqrt(2)*Syz, sqrt(2)*Sxz, sqrt(2)*Sxy].

(Lame’s law)

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

Compliance matrix in Kelvin Mandel notation such that:

In 2D: S -> S : Sigma = Epsilon [Exx, Eyy, sqrt(2)*Exy]

In 3D: S -> S: Sigma = Epsilon [Exx, Eyy, Ezz, sqrt(2)*Eyz, sqrt(2)*Exz, sqrt(2)*Exy].

(Hooke’s law)

property coef: float[source]#

kelvin mandel coef -> sqrt(2)

dim: int#
property isHeterogeneous: bool[source]#

indicates whether the model has heterogeneous parameters

property modelType: ModelType[source]#

model type

planeStress: bool#

the model uses plane stress simplification

property simplification: str[source]#

simplification used for the model

thickness: float#

Hyper elastic module.

class EasyFEA.Models.HyperElastic.HolzapfelOgden(
dim,
C0,
C1,
C2,
C3,
C4,
C5,
C6,
C7,
K,
Mu1,
Mu2,
T1,
T2,
ks=100,
thickness=1.0,
)[source]#

Bases: _HyperElastic

Compute_W(hyperElasticState)[source]#

Computes the quadratic energy W(u).

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

We_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_d2Wde(hyperElasticState)[source]#

Computes dΣde.

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

dΣde_e_pg of shape (Ne, pg, d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_dWde(hyperElasticState)[source]#

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

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Return type:

FeArray

Returns:

  • FeArray – Σ_e_pg of shape (Ne, pg, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

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

C0: float#
C1: float#
C2: float#
C3: float#
C4: float#
C5: float#
C6: float#
C7: float#
K: float#

Bulk modulus

Mu1: float#
Mu2: float#
T1#

direction(s) 1, used for the invariants I4 and I8

T2#

direction(s) 2, used for the invariants I6 and I8

class EasyFEA.Models.HyperElastic.HyperElasticState(mesh, u, matrixType)[source]#

Bases: object

Hyperelastic state.

static _CheckFormat(mesh, u, matrixType)[source]#
Return type:

None

Compute_C()[source]#

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

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 1 0

  • 0 0 1

  • dim = 2

  • ——-

  • cxx cxy 0

  • cyx cyy 0

  • 0 0 1

  • dim = 3

  • ——-

  • cxx cxy cxz

  • cyx cyy cyz

  • czx czy czz

Compute_De()[source]#

Computes De(u) derivative green lagrange matrix.

Return type:

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

Returns if dim = 2#

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

Returns if dim = 3#

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

Compute_Epsilon()[source]#

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

Return type:

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

Returns if dim = 2#

FeArray

Eps_e_pg of shape (Ne, pg, 3)

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

Returns if dim = 3#

FeArray

Eps_e_pg of shape (Ne, pg, 6)

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

Compute_F()[source]#

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

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

Compute_GreenLagrange()[source]#

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

Returns:

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

Return type:

FeArray

Compute_I1()[source]#

Computes I1(u)

Returns:

I1_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_I2()[source]#

Computes I2(u)

Returns:

I2_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_I3()[source]#

Computes I3(u)

Returns:

I3_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_I4(T)[source]#

Computes I4(u)

Parameters:

T (_types.FloatArray) – direction(s)

Returns:

I4_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_I6(T)[source]#

Computes I6(u)

Parameters:

T (_types.FloatArray) – direction(s)

Returns:

I6_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_I8(T1, T2)[source]#

Computes I8(u)

Parameters:
  • T1 (_types.FloatArray) – direction(s) 1

  • T2 (_types.FloatArray) – direction(s) 2

Returns:

I8_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_J()[source]#

Computes the deformation gradient J = det(F)

Returns:

J_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_d2I1dC()[source]#

Computes d2I1dC(u)

Returns:

d2I1dC of shape (d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_d2I2dC()[source]#

Computes d2I2dC(u)

Returns:

d2I2dC of shape (d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_d2I3dC()[source]#

Computes d2I3dC(u)

Returns:

d2I3dC_e_pg of shape (Ne, pg, d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_d2I4dC()[source]#

Computes d2I4dC(u)

Returns:

d2I4dC of shape (d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_d2I6dC()[source]#

Computes d2I6dC(u)

Returns:

d2I6dC of shape (d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_d2I8dC()[source]#

Computes d2I8dC(u)

Returns:

d2I8dC of shape (d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_dI1dC()[source]#

Computes dI1dC(u)

Returns:

dI1dC of shape (d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_dI2dC()[source]#

Computes dI2dC(u)

Returns:

dI2dC_e_pg of shape (Ne, pg, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_dI3dC()[source]#

Computes dI3dC(u)

Returns:

dI3dC_e_pg of shape (Ne, pg, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_dI4dC(T)[source]#

Computes dI4dC(u)

Parameters:

T (_types.FloatArray) – direction(s)

Returns:

dI4dC_e_pg of shape (Ne, pg, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_dI6dC(T)[source]#

Computes dI6dC(u)

Parameters:

T (_types.FloatArray) – direction(s)

Returns:

dI6dC_e_pg of shape (Ne, pg, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_dI8dC(T1, T2)[source]#

Computes dI8dC(u)

Parameters:
  • T1 (_types.FloatArray) – direction(s) 1

  • T2 (_types.FloatArray) – direction(s) 2

Returns:

dI8dC_e_pg of shape (Ne, pg, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

_Compute_Anisotropic_Invariants(T1, T2)[source]#
_Compute_Anisotropic_Invariants_First_Derivatives(T1, T2)[source]#
_Compute_C()[source]#

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

returns [cxx, cxy, cxz, cyx, cyy, cyz, czx, czy, czz]

Return type:

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

_GetDims()[source]#

return Ne, nPg, dim

Return type:

tuple[int, int, int]

_Get_normalized_components(T)[source]#
Return type:

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

_Slice_Matrix(matrix)[source]#
_Slice_Vector(vector)[source]#
property mesh[source]#
class EasyFEA.Models.HyperElastic.MooneyRivlin(dim, K1, K2, K=0.0, thickness=1.0)[source]#

Bases: _HyperElastic

Compute_W(hyperElasticState)[source]#

Computes the quadratic energy W(u).

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

We_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_d2Wde(hyperElasticState)[source]#

Computes dΣde.

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

dΣde_e_pg of shape (Ne, pg, d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_dWde(hyperElasticState)[source]#

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

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Return type:

FeArray

Returns:

  • FeArray – Σ_e_pg of shape (Ne, pg, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

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

K: float#

Bulk modulus

K1: float#

Kappa1

K2: float#

Kappa2

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

Bases: _HyperElastic

Compute_W(hyperElasticState)[source]#

Computes the quadratic energy W(u).

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

We_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_d2Wde(hyperElasticState)[source]#

Computes dΣde.

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

dΣde_e_pg of shape (Ne, pg, d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_dWde(hyperElasticState)[source]#

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

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Return type:

FeArray

Returns:

  • FeArray – Σ_e_pg of shape (Ne, pg, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

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

K: float#

Bulk modulus

class EasyFEA.Models.HyperElastic.SaintVenantKirchhoff(dim, lmbda, mu, K=0.0, thickness=1.0)[source]#

Bases: _HyperElastic

Compute_W(hyperElasticState)[source]#

Computes the quadratic energy W(u).

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

We_e_pg of shape (Ne, pg)

Return type:

FeArray

Compute_d2Wde(hyperElasticState)[source]#

Computes dΣde.

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

dΣde_e_pg of shape (Ne, pg, d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

Compute_dWde(hyperElasticState)[source]#

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

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Return type:

FeArray

Returns:

  • FeArray – Σ_e_pg of shape (Ne, pg, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

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

K: float#

Bulk modulus

lmbda: float#

Lame’s first parameter

mu: float#

Shear modulus

class EasyFEA.Models.HyperElastic._HyperElastic(dim, thickness)[source]#

Bases: _IModel, ABC

HyperElastic material.

NeoHookean, MooneyRivlin, SaintVenantKirchhoff and HolzapfelOgden inherit from _HyperElas class.

static Available_Laws()[source]#
Compute_Tangent_and_Residual(hyperElasticState)[source]#

Computes the tangent matrix and the residual vector.

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

tangent_e_pg (Ne, pg, d, d), with d = dof_n * mesh.nPe

Return type:

tuple[FeArray, FeArray]

abstractmethod Compute_W(hyperElasticState)[source]#

Computes the quadratic energy W(u).

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

We_e_pg of shape (Ne, pg)

Return type:

FeArray

abstractmethod Compute_d2Wde(hyperElasticState)[source]#

Computes dΣde.

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Returns:

dΣde_e_pg of shape (Ne, pg, d, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

Return type:

FeArray

abstractmethod Compute_dWde(hyperElasticState)[source]#

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

Parameters:

hyperElasticState (HyperElasticState) – Hyperelastic state containing the mesh, the discretized field, and the matrix type.

Return type:

FeArray

Returns:

  • FeArray – Σ_e_pg of shape (Ne, pg, d), where d = 1, 3, 6 depending on whether the solution dimension is 1D, 2D, or 3D.

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

property coef: float[source]#

kelvin mandel coef -> sqrt(2)

dim: float#
property isHeterogeneous: bool[source]#

indicates whether the model has heterogeneous parameters

property modelType: ModelType[source]#

model type

thickness: float#

Beam module.

class EasyFEA.Models.Beam.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][source]#

beams areas

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

model dimensions

1D -> tension compression

2D -> tension compression + bending + flexion

3D -> all

property dof_n: int[source]#

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[source]#

model type

property nBeam: int[source]#

Number of beams in the structure

property thickness: float[source]#

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.Beam.Isotropic(dim, line, section, E, v, yAxis=(0, 1, 0))[source]#

Bases: _Beam

Isotropic elastic beam.

Get_D()[source]#

Returns a matrix characterizing the beam’s stiffness behavior.

Return type:

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

E: float#

Young’s modulus

property mu: float[source]#

shear modulus (G)

v: float#

Poisson’s ratio

class EasyFEA.Models.Beam._Beam(dim, line, section, yAxis=(0, 1, 0))[source]#

Bases: _IModel

Beam class model.

abstractmethod Get_D()[source]#

Returns a matrix characterizing the beam’s stiffness behavior.

Return type:

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

_Calc_P()[source]#

P matrix use to transform beam coordinates to global coordinates.

[ix, jx, kx

iy, jy, ky

iz, jz, kz]

coord(x,y,z) = P • coord(i,j,k)

Return type:

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

property Iy: float[source]#

squared moment of the cross-section around y-axis.

int_S z^2 dS

property Iz: float[source]#

squared moment of the cross-section around z-axis.

int_S y^2 dS

property J: float[source]#

polar area moment of inertia (Iy + Iz).

property area: float[source]#

cross-section area.

property dim[source]#

model dimension

property dof_n: int[source]#

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 line: Line[source]#

average fiber line of the beam.

property modelType: ModelType[source]#

model type

property name: str[source]#

beam name/tag

property section: Mesh[source]#

beam cross-section in (x,y) plane

property thickness: float[source]#

thickness used in the model

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

perpendicular cross-beam axis (fiber)

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

vertical cross-beam axis