Numerical integration rules (cubatures) on the reference elements of the finite element method.
A cubature holds the abscissae and weights of a rule such that on the reference element .
| Constant | Element | Reference domain | Measure |
|---|---|---|---|
CUB_LIN |
line | 2 | |
CUB_TRI |
triangle | 1/2 | |
CUB_QUA |
quadrilateral | 4 | |
CUB_TET |
tetrahedron | 1/6 | |
CUB_HEX |
hexahedron | 8 | |
CUB_WED |
wedge / prism | triangle | 1 |
Triangle and tetrahedron abscissae are the Cartesian coordinates on the unit simplex, which equal the leading barycentric (area / volume) coordinates; the last barycentric coordinate is .
Rules are selected by their degree of exactness :
CUB_TRI, CUB_TET: all polynomials of total degree .CUB_LIN, CUB_QUA, CUB_HEX: all polynomials of degree
in each coordinate (tensor-product Gauss–Legendre with
points per direction). One degree or one per direction.CUB_WED: total degree in the triangle coordinates and
degree in the axial coordinate. One or two degrees.All rules have positive weights and interior abscissae. Triangle rules of degree 2, 4 and 5 and the tetrahedron rule of degree 2 are the tabulated symmetric rules; all other simplex rules are collapsed (conical product) Gauss–Jacobi rules, available for any degree.
Tensor-product rules vary the first coordinate fastest, and the Gauss points of each direction run from +1 down to -1. Wedge rules vary the triangle point fastest and the axial point slowest.
Abscissae and weights are real64; kinds are not exported, so take
real64 from iso_fortran_env. Invalid arguments to the constructor or
set stop with error stop and a message that starts with
cubature%set:.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | CUB_LIN | = | 1 |
Line element |
| integer, | public, | parameter | :: | CUB_TRI | = | 2 |
Triangle element |
| integer, | public, | parameter | :: | CUB_QUA | = | 3 |
Quadrilateral element |
| integer, | public, | parameter | :: | CUB_TET | = | 4 |
Tetrahedron element |
| integer, | public, | parameter | :: | CUB_HEX | = | 5 |
Hexahedron element |
| integer, | public, | parameter | :: | CUB_WED | = | 6 |
Wedge (prism) element |
Construct a rule, e.g. cubature(CUB_TRI, 4) or cubature(CUB_HEX, [3, 3, 1])
Construct a rule of degree degree in every direction
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | elm |
Element type, |
||
| integer, | intent(in) | :: | degree |
Degree of exactness |
Construct a rule with per-direction degrees
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | elm |
Element type, |
||
| integer, | intent(in) | :: | degree(:) |
Degrees of exactness, size 1 or number of directions |
Abscissae and weights of an integration rule on a reference element.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | elm | = | 0 |
Element type, |
|
| integer, | public | :: | dim | = | 0 |
Spatial dimension |
|
| integer, | public | :: | degree(3) | = | 0 |
Degree of exactness, see module documentation |
|
| integer, | public | :: | npoints | = | 0 |
Number of points |
|
| real(kind=rk), | public, | allocatable | :: | abscissae(:,:) |
Abscissae, shape |
||
| real(kind=rk), | public, | allocatable | :: | weights(:) |
Weights, shape |
Construct a rule, e.g. cubature(CUB_TRI, 4) or cubature(CUB_HEX, [3, 3, 1])
| private pure function new_iso (elm, degree) | Construct a rule of degree |
| private pure function new_aniso (elm, degree) | Construct a rule with per-direction degrees |
| generic, public :: set => set_iso, set_aniso | Build the rule in place |
| procedure, public :: is_valid | True if the rule is set and consistent |
| procedure, public :: summary | Write element, dimension, degrees, points |
| procedure, public :: show | Write the summary, points and weights |
| procedure, public :: destroy | Deallocate and reset |