I am learning about finite element methods, and was trying to implement some examples in Julia. So

one of the common steps in FEM is implementing Gauss Quadrature for approximating the integral of each element in the mesh.

I used `QuadGK.jl`

for computing the integral in 1d. However, the `QuadGK.jl`

package docs indicate that the package only solves 1-dimensional integrals. However, for solving 2 and 3 dimensional elements, I imagine I need to use a package like `FastGaussQuadrature.jl`

. The QuadGK function also includes an api or function signature to handle the change of interval, such as `integral, error = quadgk(x -> cos(200x), 0, 1)`

. However, I did not find something similar for `FastGaussQuadrature`

.

My specific question is, how do I use `FastGaussQuadrature`

to compute the integral of a 2d (triangle) or 3d (tetrahedral) element. That means, given a set of nodes/points and their coordinates, `[x, y, z]`

, how would I use the package to compute the integral for the loading function `f`

over a mesh element, or how would I use this package to compute the integral over a mesh element for the stiffness side of the equation.

I believe that FastGaussQuadrature computes the quadrature weights assuming an interval from [-1.0, 1.0]. So if my elements are of a different size in 2 or 3 dimensions, how would I adapt that interval to match the [-1.0, 1.0].

Thanks.