Elements¤
tatva.element.Element
¤
Element()
Base Module for all finite elements, compatible with JAX.
Methods:
-
get_jacobian– -
get_local_values–Returns a tuple containing the interpolated value, gradient, and determinant of the Jacobian.
-
gradient– -
interpolate– -
shape_function–Returns the shape functions and their derivatives at a point.
-
shape_function_derivative–Returns the derivative of the shape functions with respect to the local coordinates.
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).
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:
-
interpolate– -
get_jacobian– -
get_local_values– -
gradient– -
shape_function– -
shape_function_derivative–Returns the derivative of the shape functions with respect to the local coordinates.
Attributes:
tatva.element.Tri3
¤
Tri3()
A 3-node linear triangular element.
Methods:
-
get_jacobian– -
get_local_values–Returns a tuple containing the interpolated value, gradient, and determinant of the Jacobian.
-
gradient– -
interpolate– -
shape_function–Returns the shape functions evaluated at the local coordinates (xi, eta).
-
shape_function_derivative–Returns the derivative of the shape functions with respect to the local coordinates (xi, eta).
Attributes:
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).
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:
-
get_jacobian– -
get_local_values–Returns a tuple containing the interpolated value, gradient, and determinant of the Jacobian.
-
gradient– -
interpolate– -
shape_function– -
shape_function_derivative–Returns the derivative of the shape functions with respect to the local coordinates (xi, eta).
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)
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).
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:
-
get_jacobian– -
get_local_values–Returns a tuple containing the interpolated value, gradient, and determinant of the Jacobian.
-
gradient– -
interpolate– -
shape_function–Returns the shape functions evaluated at the local coordinates (xi, eta, zeta).
-
shape_function_derivative–Returns the derivative of the shape functions with respect to the local coordinates (xi, eta, zeta).
Attributes:
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).
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:
-
get_jacobian– -
get_local_values–Returns a tuple containing the interpolated value, gradient, and determinant of the Jacobian.
-
gradient– -
interpolate– -
shape_function–Returns the shape functions evaluated at the local coordinates (xi, eta, zeta).
-
shape_function_derivative–Returns the derivative of the shape functions.
Attributes:
-
a– -
quad_points– -
quad_weights–
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_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).
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.