On 05/06/2018 09:05 AM, Zhao Yidong wrote:
>
> Indeed, my problem is this:
> 1. I have fe which is a FiniteElement class, and I have fe_values which is a
> FEValues class. I also have QGauss<dim> quadrature to create fe_values.
> 2. I iterate on every quadrature point in a iteration on every cell, store the
> quadrature points.
> 3. Use fe_values.value(i, q) to calculate shape functions, and
> fe.shape_value(i, point) to calculate another shape function, but find they
> are different.
>
> So I want to know what's the difference between this two methods? Because I
> want to separate the fe and quadrature points, so can I use fe.shape_value to
> calculate the shape functions?
FiniteElement defines shape functions on the reference element. FEValues
describes these shape functions on the real cell. For many elements, you get
the same result whether you
* evaluate the shape function on the reference cell at a quadrature point
also defined on the reference cell (via FiniteElement::shape_value and
Quadrature::point)
* evaluate the shape function on the real cell at a quadrature point
also defined on the real cell (via FEValues::shape_value, with quadrature
point locations also available from FEValues).
But there are also elements for which this is not true. It's not clear to me
what exactly you do in your comparison -- can you show a piece of code?
(You will have to use FEValues anyway at one point if you also want the
*gradients* of the shape functions -- these are never the same on reference
and real cell.)