# Coordinate transformation for line integrals; quadrature rules

1. Nov 1, 2013

### hkcool

Hi all,

The context of this problem is as follows: I'm trying to implement a discontinuous finite element method and the formulation calls for the computation of line integrals over the edges of the mesh.

Anyway, more generally, I need to evaluate $\int_{e}f(x,y)ds$, where $e$ is a line segment (corresponding to the edge of a 2D-mesh element). I'm trying to compute this integral numerically using a 1D-quadrature rule on the interval $[-1,1]$, but I think perhaps my mapping is incorrect.

To begin, let $\mathbf{\hat{x}}_{g}$ be a quadrature point on the interval $[-1,1]$ (i.e. $\mathbf{\hat{x}}_{g} = (\hat{x}_{g},0)$) with corresponding quadrature weight $w_{g}$. Now there exists an affine mapping $\zeta: [-1,1] \to e$. Thus, $\mathbf{x}_{g} = \zeta(\mathbf{\hat{x}}_{g})$ is on the line segment $e$.

But I'm confused how the integral should look now:
$$\int_{e}f(x,y)ds \approx \sum_{k=1}^{n_{g}}w_{k}f(\mathbf{x}_{g})?$$

I know if I was trying to actually map the line of integration from $e$ to $[-1,1]$ then I would need to multiply the integrand by $\zeta'$, the derivative of the transformation, but that's not exactly what I'm trying to do here.

The problem: Using the quadrature rule as given above is actually not correct since my implementation in my code produces the wrong results using this quadrature rule. I'm assuming I'm missing some transformation factor, but am at a loss as to what it should be.

Also, if there is a section of this message board that is more tailored to finite elements and has experience users that can answer specific questions about FEM, I would be extremely grateful to be pointed in the right direction!

2. Nov 2, 2013

### SteamKing

Staff Emeritus