FEM.Elements.E2D package#

Collection of 2D Elements

Submodules#

FEM.Elements.E2D.Element2D module#

Defines a general 2D element

class FEM.Elements.E2D.Element2D.Element2D(coords: numpy.ndarray, _coords: numpy.ndarray, gdl: numpy.ndarray, **kargs)#

Bases: FEM.Elements.Element.Element

Create a 2D element

Parameters
  • coords (np.ndarray) – Element coordinate matrix

  • _coords (np.ndarray) – Element coordinate matrix for graphical interface purposes

  • gdl (np.ndarray) – Degree of freedom matrix

draw() None#

Create a graph of element

isInside(x: numpy.ndarray) numpy.ndarray#

Test if a given points is inside element domain

Parameters

x (np.ndarray) – Point to be tested

Returns

Bolean array of test result

Return type

np.ndarray

jacobianGraph() None#

Create the determinant jacobian graph

FEM.Elements.E2D.LTriangular module#

TRIANGULAR ELEMENT#

Defines the lagrange first order triangular element

https://raw.githubusercontent.com/ZibraMax/FEM/master/docs/source/Ltriangular.png

3 nodes triangular element. (Reddy, 2005)#

Shape Functions#

\[\begin{split}\Psi_i=\left[\begin{matrix}- x - y + 1.0\\x\\y\end{matrix}\right]\end{split}\]

Shape Functions Derivatives#

\[\begin{split}\frac{\partial \Psi_i}{\partial x_j}=\left[\begin{matrix}-1 & -1\\1 & 0\\0 & 1\end{matrix}\right]\end{split}\]
class FEM.Elements.E2D.LTriangular.LTriangular(coords: numpy.ndarray, gdl: numpy.ndarray, n: int = 2, **kargs)#

Bases: FEM.Elements.E2D.Element2D.Element2D, FEM.Elements.E2D.TriangularScheme.TriangularScheme

Creates a lagrangian triangular element of order 1

Parameters
  • coords (np.ndarray) – Element coordinates matrix

  • gdl (np.ndarray) – Element gdl matrix

  • n (int, optional) – Number of Gauss Points. Defaults to 2.

dpsis(z: numpy.ndarray) numpy.ndarray#

Calculates the shape functions derivatives of a given natural coordinates

Parameters

z (np.ndarray) – Natural coordinates matrix

Returns

Shape function derivatives evaluated in Z points

Return type

np.ndarray

psis(z: numpy.ndarray) numpy.ndarray#

Calculates the shape functions of a given natural coordinates

Parameters

z (np.ndarray) – Natural coordinates matrix

Returns

Shape function evaluated in Z points

Return type

np.ndarray

FEM.Elements.E2D.QTriangular module#

TRIANGULAR SECOND ORDER ELEMENT#

Defines the lagrange second order triangular element

https://raw.githubusercontent.com/ZibraMax/FEM/master/docs/source/QTriangular.png

6 nodes triangular element. (Reddy, 2005)#

Shape Functions#

\[\begin{split}\Psi_i=\left[\begin{matrix}\left(x + y - 0.5\right) \left(2.0 x + 2.0 y - 2.0\right)\\2.0 x \left(x - 0.5\right)\\2.0 y \left(y - 0.5\right)\\x \left(- 4.0 x - 4.0 y + 4.0\right)\\4.0 x y\\- 4.0 y \left(x + y - 1.0\right)\end{matrix}\right]\end{split}\]

Shape Functions Derivatives#

\[\begin{split}\frac{\partial \Psi_i}{\partial x_j}=\left[\begin{matrix}4.0 x + 4.0 y - 3.0 & 4.0 x + 4.0 y - 3.0\\4.0 x - 1.0 & 0\\0 & 4.0 y - 1.0\\- 8.0 x - 4.0 y + 4.0 & - 4.0 x\\4.0 y & 4.0 x\\- 4.0 y & - 4.0 x - 8.0 y + 4.0\end{matrix}\right]\end{split}\]
class FEM.Elements.E2D.QTriangular.QTriangular(coords: numpy.ndarray, gdl: numpy.ndarray, n: int = 3, **kargs)#

Bases: FEM.Elements.E2D.Element2D.Element2D, FEM.Elements.E2D.TriangularScheme.TriangularScheme

Creates a lagrangian element of order 2

Parameters
  • coords (np.ndarray) – Element coordinates matrix

  • gdl (np.ndarray) – Element gdl matrix

  • n (int, optional) – Number of Gauss Points. Defaults to 2.

dpsis(z: numpy.ndarray) numpy.ndarray#

Calculates the shape functions derivatives of a given natural coordinates

Parameters

z (np.ndarray) – Natural coordinates matrix

Returns

Shape function derivatives evaluated in Z points

Return type

np.ndarray

psis(z: numpy.ndarray) numpy.ndarray#

Calculates the shape functions of a given natural coordinates

Parameters

z (np.ndarray) – Natural coordinates matrix

Returns

Shape function evaluated in Z points

Return type

np.ndarray

FEM.Elements.E2D.Quadrilateral module#

QUADRILATERAL ELEMENT#

Defines the lagrange first order quadrilateral element

https://raw.githubusercontent.com/ZibraMax/FEM/master/docs/source/Quadrilateral.png

4 nodes quadrilateral element. (Reddy, 2005)#

Shape Functions#

\[\begin{split}\Psi_i=\left[\begin{matrix}\left(0.25 - 0.25 x\right) \left(1.0 - y\right)\\\left(1.0 - y\right) \left(0.25 x + 0.25\right)\\\left(0.25 x + 0.25\right) \left(y + 1.0\right)\\\left(0.25 - 0.25 x\right) \left(y + 1.0\right)\end{matrix}\right]\end{split}\]

Shape Functions Derivatives#

\[\begin{split}\frac{\partial \Psi_i}{\partial x_j}=\left[\begin{matrix}0.25 y - 0.25 & 0.25 x - 0.25\\0.25 - 0.25 y & - 0.25 x - 0.25\\0.25 y + 0.25 & 0.25 x + 0.25\\- 0.25 y - 0.25 & 0.25 - 0.25 x\end{matrix}\right]\end{split}\]
class FEM.Elements.E2D.Quadrilateral.Quadrilateral(coords: numpy.ndarray, gdl: numpy.ndarray, n: int = 2, **kargs)#

Bases: FEM.Elements.E2D.Element2D.Element2D, FEM.Elements.E2D.RectangularScheme.RectangularScheme

Creates a lagrangian rectangular element of order 1

Parameters
  • coords (np.ndarray) – Element coordinates matrix

  • gdl (np.ndarray) – Element gdl matrix

  • n (int, optional) – Number of Gauss Points. Defaults to 2.

dpsis(z: numpy.ndarray) numpy.ndarray#

Calculates the shape functions derivatives of a given natural coordinates

Parameters

z (np.ndarray) – Natural coordinates matrix

Returns

Shape function derivatives evaluated in Z points

Return type

np.ndarray

psis(z: numpy.ndarray) numpy.ndarray#

Calculates the shape functions of a given natural coordinates

Parameters

z (np.ndarray) – Natural coordinates matrix

Returns

Shape function evaluated in Z points

Return type

np.ndarray

FEM.Elements.E2D.RectangularScheme module#

Define the rectangular scheme used by rectangular elements

class FEM.Elements.E2D.RectangularScheme.RectangularScheme(n: int, **kargs)#

Bases: object

Generates a rectangular integration scheme

Parameters

n (int) – Number of gauss points

FEM.Elements.E2D.Serendipity module#

QUADRILATERAL SERENDIPITY ELEMENT#

Defines the serendipity second order quadrilateral element

https://raw.githubusercontent.com/ZibraMax/FEM/master/docs/source/Serendipity.png

8 nodes quadrilateral element. (Reddy, 2005)#

Shape Functions#

\[\begin{split}\Psi_i=\left[\begin{matrix}\left(0.25 - 0.25 x\right) \left(1.0 - y\right) \left(- x - y - 1.0\right)\\\left(1.0 - y\right) \left(0.25 x + 0.25\right) \left(x - y - 1.0\right)\\\left(0.25 x + 0.25\right) \left(y + 1.0\right) \left(x + y - 1.0\right)\\\left(0.25 - 0.25 x\right) \left(y + 1.0\right) \left(- x + y - 1.0\right)\\\left(0.5 - 0.5 x^{2.0}\right) \left(1.0 - y\right)\\\left(1.0 - y^{2.0}\right) \left(0.5 x + 0.5\right)\\\left(0.5 - 0.5 x^{2.0}\right) \left(y + 1.0\right)\\\left(0.5 - 0.5 x\right) \left(1.0 - y^{2.0}\right)\end{matrix}\right]\end{split}\]

Shape Functions Derivatives#

\[\begin{split}\frac{\partial \Psi_i}{\partial x_j}=\left[\begin{matrix}- \left(0.25 - 0.25 x\right) \left(1.0 - y\right) + \left(0.25 y - 0.25\right) \left(- x - y - 1.0\right) & - \left(0.25 - 0.25 x\right) \left(1.0 - y\right) + \left(0.25 x - 0.25\right) \left(- x - y - 1.0\right)\\\left(0.25 - 0.25 y\right) \left(x - y - 1.0\right) + \left(1.0 - y\right) \left(0.25 x + 0.25\right) & - \left(1.0 - y\right) \left(0.25 x + 0.25\right) + \left(- 0.25 x - 0.25\right) \left(x - y - 1.0\right)\\\left(0.25 x + 0.25\right) \left(y + 1.0\right) + \left(0.25 y + 0.25\right) \left(x + y - 1.0\right) & \left(0.25 x + 0.25\right) \left(y + 1.0\right) + \left(0.25 x + 0.25\right) \left(x + y - 1.0\right)\\- \left(0.25 - 0.25 x\right) \left(y + 1.0\right) + \left(- 0.25 y - 0.25\right) \left(- x + y - 1.0\right) & \left(0.25 - 0.25 x\right) \left(y + 1.0\right) + \left(0.25 - 0.25 x\right) \left(- x + y - 1.0\right)\\- 1.0 x^{1.0} \left(1.0 - y\right) & 0.5 x^{2.0} - 0.5\\0.5 - 0.5 y^{2.0} & - 2.0 y^{1.0} \left(0.5 x + 0.5\right)\\- 1.0 x^{1.0} \left(y + 1.0\right) & 0.5 - 0.5 x^{2.0}\\0.5 y^{2.0} - 0.5 & - 2.0 y^{1.0} \left(0.5 - 0.5 x\right)\end{matrix}\right]\end{split}\]
class FEM.Elements.E2D.Serendipity.Serendipity(coords: numpy.ndarray, gdl: numpy.ndarray, n: int = 3, **kargs)#

Bases: FEM.Elements.E2D.Element2D.Element2D, FEM.Elements.E2D.RectangularScheme.RectangularScheme

Creates a Serendipity element

Parameters
  • coords (np.ndarray) – Coordinate matrix of element

  • gdl (np.ndarray) – Coordinate matrix of element GDL’s

  • n (int, optional) – Number of gauss points. Defaults to 3.

dpsis(z: numpy.ndarray) numpy.ndarray#

Calculates the shape functions derivatives of a given natural coordinates

Parameters

z (np.ndarray) – Natural coordinates matrix

Returns

Shape function derivatives evaluated in Z points

Return type

np.ndarray

psis(z: numpy.ndarray) numpy.ndarray#

Calculates the shape functions of a given natural coordinates

Parameters

z (np.ndarray) – Natural coordinates matrix

Returns

Shape function evaluated in Z points

Return type

np.ndarray

FEM.Elements.E2D.TriangularScheme module#

Define the triangular scheme used by triangular elements

class FEM.Elements.E2D.TriangularScheme.TriangularScheme(n: int, **kargs)#

Bases: object

Generate a triangular integration scheme

Parameters

n (int) – Number of gauss points