# Quadrature Points

Numerical quadrature (or, quadrature rules) are primary components of finite element methods. Numerical quadrature is used for evaluating integration, which is necessary for computing the finite element matrices and vectors.

Numerical quadrature are evaluated on reference elements. Every numerical quadrature rule has an order of accuracy.

A quadrature rule is denoted by weights $w_{i}$ and quadrature points $\xi_{i}$.

After getting $\{\xi, w\}$ we can compute an integration by using following expression:

$\int_{\Omega^{*}} f(\mathbf{x}) d\Omega = \sum_{i=1}^{n}{f(\mathbf{x}_{i})}w_{i}$where, $\Omega^{*}$ denotes the reference element domain.

easifemBasedefines a user-defined data type called QuadraturePoint_ to handle the quadrature points.

Quadrature points $\xi$ are located in the reference element.

## Creating an instance of `QuadraturePoint_`

Initiate
- Use Initiate method for constructing an instance of QuadraturePoint.
- To use this subroutine we need to create ReferenceElement first.

The following example shows how to construct **GaussLegendre** quadrature points on line.

`PROGRAM main`

USE easifemBase

IMPLICIT NONE

TYPE(QuadraturePoint_) :: obj

TYPE(ReferenceLine_) :: refelem

INTEGER(I4B) :: order

refelem = ReferenceLine(nsd=1_I4B)

CALL display(refelem, "refelem: ")

order = 4_I4B

CALL initiate(obj=obj, &

& refelem=refelem, &

& order=order, &

& quadratureType=GaussLegendre)

CALL display(obj, "ans: ")

END PROGRAM main

we can use following values for `quadratureType`

, which are declared in easifemBase's GlobalData:

- GaussLegendre
- GaussLegendreLobatto
- GaussLegendreRadau, GaussLegendreRadauLeft
- GaussLegendreRadauRight
- GaussChebyshev
- GaussChebyshevLobatto
- GaussChebyshevRadau, GaussChebyshevRadauLeft
- GaussChebyshevRadauRight
- GaussJacobi
- GaussJacobiLobatto
- GaussJacobiRadau, GaussJacobiRadauLeft
- GaussJacobiRadauRight
- GaussUltraspherical
- GaussUltrasphericalLobatto
- GaussUltrasphericalRadau, GaussUltraspericalRadauLeft
- GaussUltrasphericalRadauRight

In the case of `GaussJacobi***`

, `alpha`

and `beta`

should be given, and in the case of `GaussUltraspherical**`

, `lambda`

should be given.

In the case of triangle, tetrahedron, pyramid, and prism, `quadratureType`

is ineffective, that is, we do not use `quadratureType`

for these elements.

## Reference elements

You can learn more about quadrature points from following pages.