Gauss quadrature points collection#

Description and mathematical background#

The package pysdic provides shape functions for various types of elements used in finite element analysis. To facilitate numerical integration over these elements, Gauss quadrature points and weights are provided.

A Gauss quadrature rule approximates the integral of a function over an element by evaluating the function at specific points (the Gauss points) and weighting these evaluations appropriately. In a space of dimension \(E\), we consider a \(K\)-dimensional element (with \(K \leq E\)) defined by \(N_{vpe}\) nodes/vertices.

The integral of a function \(f\) over the element can be approximated as:

\[\int_{Element} f(\xi, \eta, \zeta, ...) dV \approx \sum_{i=1}^{N_{gp}} w_i f(\xi_i, \eta_i, \zeta_i, ...)\]

where \(N_{gp}\) is the number of Gauss points, \((\xi_i, \eta_i, \zeta_i, ...)\) are the coordinates of the Gauss points in the local coordinate system, and \(w_i\) are the corresponding weights.

See also

Function signatures#

All of the gauss points methods follow a similar interface.

Parameters

return_weights: bool, optional

If True, the method also returns the weights associated with each Gauss point. Default is False.

Returns

gauss_points: numpy.ndarray

Natural coordinates of the Gauss points. The returned array has shape \((N_{gp}, K)\) where \(N_{gp}\) is the number of Gauss points and \(K\) is the dimension of the element.

weights: numpy.ndarray, optional

If return_weights is True, the method also returns an array of weights with shape \((N_{gp},)\) associated with each Gauss point.

Usage#

Lets illustrate the usage of one of the gauss points methods with an example for a 2-node line element.

 1import numpy
 2import pysdic
 3
 4# Get Gauss points and weights for 2-node segment element
 5gauss_points, weights = pysdic.get_segment_2_gauss_points(return_weights=True)
 6print("Expected Gauss points shape: (Np, K)")
 7print("Gauss Points shape:", gauss_points.shape)
 8print("Gauss Points values")
 9print(gauss_points)
10print("Expected Weights shape: (Np,)")
11print("Weights shape:", weights.shape)
12print("Weights values")
13print(weights)
Expected Gauss points shape: (Np, K)
Gauss Points shape: (1, 1)
Gauss Points values
[[0.]]
Expected Weights shape: (Np,)
Weights shape: (1,)
Weights values
[2.]

Implemented Gauss points methods#

1-Dimensional elements#

get_segment_2_gauss_points

Get the natural coordinates \(\xi\) and weights of Gauss quadrature points for a 2-node segment element.

get_segment_3_gauss_points

Get the natural coordinates \(\xi\) and weights of Gauss quadrature points for a 3-node segment element.

2-Dimensional elements#

get_triangle_3_gauss_points

Get the natural coordinates \((\xi, \eta)\) and weights of Gauss quadrature points for a 3-node triangle element.

get_triangle_6_gauss_points

Get the natural coordinates \((\xi, \eta)\) and weights of Gauss quadrature points for a 6-node triangle element.

get_quadrangle_4_gauss_points

Get the natural coordinates \((\xi, \eta)\) and weights of Gauss quadrature points for a 4-node quadrangle element.

get_quadrangle_8_gauss_points

Get the natural coordinates \((\xi, \eta)\) and weights of Gauss quadrature points for an 8-node quadrangle element.

3-Dimensional elements#

Note

3D gauss points are not yet implemented. Please contact the maintainers if you need this feature.

Dispatcher function#

get_gauss_points

Get the natural coordinates and weights of Gauss quadrature points for a specified element type.

References elements for implemented Gauss points methods#

Element Type

Reference Element

segment_2 (2-node line element)

../_images/segment_2_gp.png

segment_3 (3-node line element)

../_images/segment_3_gp.png

triangle_3 (3-node triangular element)

../_images/triangle_3_gp.png

triangle_6 (6-node triangular element)

../_images/triangle_6_gp.png

quadrangle_4 (4-node quadrilateral element)

../_images/quadrangle_4_gp.png

quadrangle_8 (8-node quadrilateral element)

../_images/quadrangle_8_gp.png