pysdic.fem.get_segment_2_gauss_points#

get_segment_2_gauss_points(return_weights=False)[source]#

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

The 1-point Gauss-Legendre rule is used. It integrates exactly polynomials up to degree 1 over the reference segment \([-1, 1]\).

Parameters:

return_weights (bool, optional (default: False)) – If True, the function will also return the weights associated with each Gauss point.

Returns:

  • gauss_points (numpy.ndarray) – Natural coordinates of the Gauss points. The returned array has shape \((1, 1)\).

  • weights (numpy.ndarray) – Only returned if return_weights is True. Weights associated with each Gauss point, with shape \((1,)\). They sum to \(2\), the length of the reference segment.

Return type:

ndarray | Tuple[ndarray, ndarray]

Notes

A 2-node segment element uses the following Gauss points and weights for numerical integration:

Point No.

\((\xi)\)

Weight \(w\)

1

\(0\)

\(2\)

Gauss quadrature points for 2-node segment element

See also

pysdic.fem.compute_segment_2_shape_functions

Shape functions for 2-node segment 1D-elements.

pysdic.fem.get_gauss_points

Gauss points for any supported element type.

Examples

Get the Gauss points for a 2-node segment element:

1import numpy
2from pysdic.fem import get_segment_2_gauss_points
3
4gauss_points = get_segment_2_gauss_points()
5print("Gauss points:")
6print(gauss_points)
Gauss points:
[[0.]]