SCOREC / fep

Finite Element Programming course materials
6 stars 4 forks source link

W for element stiffness #29

Closed startrekman closed 3 years ago

startrekman commented 3 years ago

So since we are on [0,1] instead of [-1,1], when we performed quad integration, do we need to change the integration points using the formula listed on this page for an integral from a to b? If sure, I am unsure how to change the ip locations.

https://en.wikipedia.org/wiki/Gaussian_quadrature

Any advice/ pointers would be very helpful, thank you for your help.

mortezah commented 3 years ago

@startrekman

Can you be a little more specific as to what part of the assignment this question is in regards to?

The interval information is taken care of by doing a change of coordinate. Say you want to integrate f(x) over a given element Int f(x) dx. First, you need to re-write that integral in the parametric (xi) coordinate (note that that would introduce a Jacobian determinant) so you will have something like Int f(xi) det(J) dxi. Then you will apply the quadrature to the integral in terms of xi. That way, you do not have to worry about change of coordinates since MFEM (and most finite element code) will give you the quadrature points and weights in the parent (xi) coordinates.

startrekman commented 3 years ago

Are you refrencing ip.weight?

mortezah commented 3 years ago

@startrekman I am not sure if I understand your comment.

In general to compute the integral

using quadrature you will use the sum

where is the coordinate of the qth quadrature point and is the weight associated with it.

In applications you usually need to compute the following integral (over the physical space)

to do this will first need to transform the integral into the parent coordinate of the element using change of variable (see for example https://www.math24.net/change-variables-triple-integrals) to get

where J is the determinant of the Jacobian. Then you will apply the quadrature rule.