Skip to content

Elements¤

tatva.element.Element ¤

Element()

Base Module for all finite elements, compatible with JAX.

Methods:

get_jacobian ¤

get_jacobian(xi: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array]

get_local_values ¤

get_local_values(xi: Array, nodal_values: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array, jax.Array]

Returns a tuple containing the interpolated value, gradient, and determinant of the Jacobian.

Parameters:

  • xi ¤
    (Array) –

    Local coordinates (shape: (n_dim,)).

  • nodal_values ¤
    (Array) –

    Values at the nodes of the element (shape: (n_nodes, n_values)).

  • nodal_coords ¤
    (Array) –

    Coordinates of the nodes of the element (shape: (n_nodes, n_dim)).

Returns:

  • tuple[Array, Array, Array]

    A tuple containing: - Interpolated value at the local coordinates (shape: (n_values,)). - Gradient of the nodal values at the local coordinates (shape: (n_dim, n_values)). - Determinant of the Jacobian (scalar).

gradient ¤

gradient(xi: Array, nodal_values: Array, nodal_coords: Array) -> Array

interpolate ¤

interpolate(xi: Array, nodal_values: Array) -> Array

shape_function ¤

shape_function(xi: Array) -> Array

Returns the shape functions and their derivatives at a point.

shape_function_derivative ¤

shape_function_derivative(xi: Array) -> Array

Returns the derivative of the shape functions with respect to the local coordinates.

tatva.element.Line2 ¤

Line2()

A 2-node linear interval element.

Methods:

Attributes:

quad_points class-attribute ¤

quad_points = Array([[0.]], dtype=float32)

quad_weights class-attribute ¤

quad_weights = Array([2.], dtype=float32)

interpolate ¤

interpolate(xi: Array, nodal_values: Array) -> Array

get_jacobian ¤

get_jacobian(xi: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array]

get_local_values ¤

get_local_values(xi: Array, nodal_values: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array, jax.Array]

gradient ¤

gradient(xi: Array, nodal_values: Array, nodal_coords: Array) -> Array

shape_function ¤

shape_function(xi: Array) -> Array

shape_function_derivative ¤

shape_function_derivative(xi: Array) -> Array

Returns the derivative of the shape functions with respect to the local coordinates.

tatva.element.Tri3 ¤

Tri3()

A 3-node linear triangular element.

Methods:

Attributes:

quad_points class-attribute ¤

quad_points = Array([[0.33333334, 0.33333334]], dtype=float32)

quad_weights class-attribute ¤

quad_weights = Array([0.5], dtype=float32)

get_jacobian ¤

get_jacobian(xi: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array]

get_local_values ¤

get_local_values(xi: Array, nodal_values: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array, jax.Array]

Returns a tuple containing the interpolated value, gradient, and determinant of the Jacobian.

Parameters:

  • xi ¤
    (Array) –

    Local coordinates (shape: (n_dim,)).

  • nodal_values ¤
    (Array) –

    Values at the nodes of the element (shape: (n_nodes, n_values)).

  • nodal_coords ¤
    (Array) –

    Coordinates of the nodes of the element (shape: (n_nodes, n_dim)).

Returns:

  • tuple[Array, Array, Array]

    A tuple containing: - Interpolated value at the local coordinates (shape: (n_values,)). - Gradient of the nodal values at the local coordinates (shape: (n_dim, n_values)). - Determinant of the Jacobian (scalar).

gradient ¤

gradient(xi: Array, nodal_values: Array, nodal_coords: Array) -> Array

interpolate ¤

interpolate(xi: Array, nodal_values: Array) -> Array

shape_function ¤

shape_function(xi: Array) -> Array

Returns the shape functions evaluated at the local coordinates (xi, eta).

shape_function_derivative ¤

shape_function_derivative(*_args, **_kwargs) -> Array

Returns the derivative of the shape functions with respect to the local coordinates (xi, eta).

tatva.element.Quad4 ¤

Quad4()

A 4-node bilinear quadrilateral element.

Methods:

Attributes:

quad_points class-attribute ¤

quad_points = Array([[-0.57735026, -0.57735026],
       [ 0.57735026, -0.57735026],
       [-0.57735026,  0.57735026],
       [ 0.57735026,  0.57735026]], dtype=float32)

quad_weights class-attribute ¤

quad_weights = Array([1., 1., 1., 1.], dtype=float32)

get_jacobian ¤

get_jacobian(xi: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array]

get_local_values ¤

get_local_values(xi: Array, nodal_values: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array, jax.Array]

Returns a tuple containing the interpolated value, gradient, and determinant of the Jacobian.

Parameters:

  • xi ¤
    (Array) –

    Local coordinates (shape: (n_dim,)).

  • nodal_values ¤
    (Array) –

    Values at the nodes of the element (shape: (n_nodes, n_values)).

  • nodal_coords ¤
    (Array) –

    Coordinates of the nodes of the element (shape: (n_nodes, n_dim)).

Returns:

  • tuple[Array, Array, Array]

    A tuple containing: - Interpolated value at the local coordinates (shape: (n_values,)). - Gradient of the nodal values at the local coordinates (shape: (n_dim, n_values)). - Determinant of the Jacobian (scalar).

gradient ¤

gradient(xi: Array, nodal_values: Array, nodal_coords: Array) -> Array

interpolate ¤

interpolate(xi: Array, nodal_values: Array) -> Array

shape_function ¤

shape_function(xi: Array) -> Array

shape_function_derivative ¤

shape_function_derivative(xi: Array) -> Array

Returns the derivative of the shape functions with respect to the local coordinates (xi, eta).

tatva.element.Tetrahedron4 ¤

Tetrahedron4()

A 4-node linear tetrahedral element.

Methods:

Attributes:

quad_points class-attribute ¤

quad_points = Array([[0.25, 0.25, 0.25]], dtype=float32)

quad_weights class-attribute ¤

quad_weights = Array([0.16666667], dtype=float32)

get_jacobian ¤

get_jacobian(xi: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array]

get_local_values ¤

get_local_values(xi: Array, nodal_values: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array, jax.Array]

Returns a tuple containing the interpolated value, gradient, and determinant of the Jacobian.

Parameters:

  • xi ¤
    (Array) –

    Local coordinates (shape: (n_dim,)).

  • nodal_values ¤
    (Array) –

    Values at the nodes of the element (shape: (n_nodes, n_values)).

  • nodal_coords ¤
    (Array) –

    Coordinates of the nodes of the element (shape: (n_nodes, n_dim)).

Returns:

  • tuple[Array, Array, Array]

    A tuple containing: - Interpolated value at the local coordinates (shape: (n_values,)). - Gradient of the nodal values at the local coordinates (shape: (n_dim, n_values)). - Determinant of the Jacobian (scalar).

gradient ¤

gradient(xi: Array, nodal_values: Array, nodal_coords: Array) -> Array

interpolate ¤

interpolate(xi: Array, nodal_values: Array) -> Array

shape_function ¤

shape_function(xi: Array) -> Array

Returns the shape functions evaluated at the local coordinates (xi, eta, zeta).

shape_function_derivative ¤

shape_function_derivative(*_args, **_kwargs) -> Array

Returns the derivative of the shape functions with respect to the local coordinates (xi, eta, zeta).

tatva.element.Hexahedron8 ¤

Hexahedron8()

A 8-node linear hexahedral element.

Methods:

Attributes:

a class-attribute ¤

a = Array(0.57735026, dtype=float32, weak_type=True)

quad_points class-attribute ¤

quad_points = Array([[-0.57735026, -0.57735026, -0.57735026],
       [ 0.57735026, -0.57735026, -0.57735026],
       [ 0.57735026,  0.57735026, -0.57735026],
       [-0.57735026,  0.57735026, -0.57735026],
       [-0.57735026, -0.57735026,  0.57735026],
       [ 0.57735026, -0.57735026,  0.57735026],
       [ 0.57735026,  0.57735026,  0.57735026],
       [-0.57735026,  0.57735026,  0.57735026]], dtype=float32)

quad_weights class-attribute ¤

quad_weights = Array([1., 1., 1., 1., 1., 1., 1., 1.], dtype=float32)

get_jacobian ¤

get_jacobian(xi: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array]

get_local_values ¤

get_local_values(xi: Array, nodal_values: Array, nodal_coords: Array) -> tuple[jax.Array, jax.Array, jax.Array]

Returns a tuple containing the interpolated value, gradient, and determinant of the Jacobian.

Parameters:

  • xi ¤
    (Array) –

    Local coordinates (shape: (n_dim,)).

  • nodal_values ¤
    (Array) –

    Values at the nodes of the element (shape: (n_nodes, n_values)).

  • nodal_coords ¤
    (Array) –

    Coordinates of the nodes of the element (shape: (n_nodes, n_dim)).

Returns:

  • tuple[Array, Array, Array]

    A tuple containing: - Interpolated value at the local coordinates (shape: (n_values,)). - Gradient of the nodal values at the local coordinates (shape: (n_dim, n_values)). - Determinant of the Jacobian (scalar).

gradient ¤

gradient(xi: Array, nodal_values: Array, nodal_coords: Array) -> Array

interpolate ¤

interpolate(xi: Array, nodal_values: Array) -> Array

shape_function ¤

shape_function(xi: Array) -> Array

Returns the shape functions evaluated at the local coordinates (xi, eta, zeta).

shape_function_derivative ¤

shape_function_derivative(xi: Array) -> Array

Returns the derivative of the shape functions.