Skip to content

quadrature

gripyth.elements.quadrature

Quadrature (numerical integration) of the elements.

MODULE DESCRIPTION
shape_functions

Shape function (N) and its derivative (dN).

CLASS DESCRIPTION
Quadrature

Describes the quadrature method of the finite elements.

FUNCTION DESCRIPTION
gaussian

Returns Gauss points and integration weights for Gaussian quadrature.

gaussian_1d

Returns Gauss points and weights for 1d Gaussian quadrature.

quadrature

Computes quadrature points and weights for given element type.

simplex

Returns Gauss points and weights for simplex elements.

simplex_2d

Returns Gauss points and weights for 2d simplex elements.

simplex_3d

Returns Gauss points and weights for 2d simplex elements.

Quadrature dataclass

Describes the quadrature method of the finite elements.

METHOD DESCRIPTION
__init__

Generates quadrature points for given element types.

ATTRIBUTE DESCRIPTION
N

shape functions

TYPE: NDArray[float64]

N_tract

shape functions of tractions

TYPE: NDArray[float64]

boundary_type

boundary element type

TYPE: ElementType

dN

derivatives of shape functions

TYPE: NDArray[float64]

dN_tract

shape-function derivatives of tractions

TYPE: NDArray[float64]

element_type

bulk element type

TYPE: ElementType

gauss_points

Gauss points

TYPE: NDArray[float64]

gauss_points_tract

Gauss points of tractions

TYPE: NDArray[float64]

gauss_weights

Gauss weights

TYPE: NDArray[float64]

gauss_weights_tract

Gauss weights of tractions

TYPE: NDArray[float64]

n_gauss_points

number of Gauss points

TYPE: int

order

quadrature order

TYPE: int

N instance-attribute

N: NDArray[float64] = N

shape functions

N_tract instance-attribute

N_tract: NDArray[float64] = N_tract

shape functions of tractions

boundary_type instance-attribute

boundary_type: ElementType = boundary_type

boundary element type

dN instance-attribute

dN: NDArray[float64] = dN

derivatives of shape functions

dN_tract instance-attribute

dN_tract: NDArray[float64] = dN_tract

shape-function derivatives of tractions

element_type instance-attribute

element_type: ElementType = element_type

bulk element type

gauss_points instance-attribute

gauss_points: NDArray[float64] = gauss_points

Gauss points

gauss_points_tract instance-attribute

gauss_points_tract: NDArray[float64] = gauss_points_tract

Gauss points of tractions

gauss_weights instance-attribute

gauss_weights: NDArray[float64] = gauss_weights

Gauss weights

gauss_weights_tract instance-attribute

gauss_weights_tract: NDArray[float64] = gauss_weights_tract

Gauss weights of tractions

n_gauss_points property

n_gauss_points: int

number of Gauss points

order instance-attribute

order: int = order

quadrature order

__init__

__init__(
    dim: int = 2,
    element_type: ElementType = ElementType.QUAD4,
    boundary_type: ElementType = ElementType.LINE2,
    order: int = 2,
)

Generates quadrature points for given element types.

Input:

  • dim: geometric dimension of the elements
  • element_type: bulk element type
  • boundary_type: boundary element type
  • order: quadrature order

Returns an object with various attributes describing the quadrature (numerical integration) and shape function of the finite elements.

gaussian

gaussian(
    order: int, dim: int
) -> tuple[NDArray[float64], NDArray[float64]]

Returns Gauss points and integration weights for Gaussian quadrature.

Input:

  • order: desired order of quadrature
  • dim: spatial dimension of the problem

Output:

  • points: matrix containing the coordinates of the Gauss points
  • weights: vector with the numerical integration weights

gaussian_1d

gaussian_1d(
    order: int,
) -> tuple[NDArray[float64], NDArray[float64]]

Returns Gauss points and weights for 1d Gaussian quadrature.

Input:

  • order: desired order of quadrature

Output:

  • points: vector containing the 1d coordinates of the Gauss points
  • weights: vector containing the 1d numerical integration weights

quadrature

quadrature(
    element_type: ElementType = ElementType.QUAD4,
    order: int = 2,
    dim: int = 2,
) -> tuple[NDArray[float64], NDArray[float64]]

Computes quadrature points and weights for given element type.

Input:

  • element_type: type of finite element
  • order: desired order of quadrature
  • dim: spatial dimension of the problem

Output:

  • points: matrix containing the coordinates of the Gauss points (parametric space)
  • weights: vector with the numerical integration weights

simplex

simplex(
    order, dim
) -> tuple[NDArray[float64], NDArray[float64]]

Returns Gauss points and weights for simplex elements.

simplex_2d

simplex_2d(
    order: int,
) -> tuple[NDArray[float64], NDArray[float64]]

Returns Gauss points and weights for 2d simplex elements.

simplex_3d

simplex_3d(
    order: int,
) -> tuple[NDArray[float64], NDArray[float64]]

Returns Gauss points and weights for 2d simplex elements.