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:
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
Operations on Integration Points (interpolation, projection, etc.) for operations on integrated points using Gauss points.
Shape functions collection (1D, 2D) for shape functions used in conjunction with Gauss quadrature.
Function signatures#
All of the gauss points methods follow a similar interface.
Parameters
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_weightsisTrue, 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 the natural coordinates \(\xi\) and weights of Gauss quadrature points for a 2-node segment element. |
|
Get the natural coordinates \(\xi\) and weights of Gauss quadrature points for a 3-node segment element. |
2-Dimensional elements#
Get the natural coordinates \((\xi, \eta)\) and weights of Gauss quadrature points for a 3-node triangle element. |
|
Get the natural coordinates \((\xi, \eta)\) and weights of Gauss quadrature points for a 6-node triangle element. |
|
Get the natural coordinates \((\xi, \eta)\) and weights of Gauss quadrature points for a 4-node quadrangle element. |
|
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 the natural coordinates and weights of Gauss quadrature points for a specified element type. |