Dear Prof.Wolfgang,
I checked again my codes and looked at the shape functions on the edge.
When I looked at one edge of a cell with its degree of freedom, for
example, with the edge length is 1, I saw the shape functions at quadrature
points on the edge is (0,0,1).
Thus, if I calculate the integral over the edge by hand and  got the result
is 1 as what you said.

I have a question that when assembling the right hand side with the formula
as:
 F_i  =  - \int_Omega  \varphi_i(x)  Js(x)  dx  at quadrature point x
located on the source edge, and F_i = 0 everywhere else.
I actually take the integral over the cell rather than the edge, isn't it?
And there are 4 cells in 3D and 2 cells in 2D which contains the edge.
Should I assemble the right hand side by the following procedure ?
1. find the cell containing the source edge
2. find the dof in the cell represent for the edge.
3. Loop over the cell quadrature points:
if the quadrature point are on the edge then compute:
 F_i  += - Omega  \varphi_i(x)  Js(x) JxW(x)
if it not:
F_i  += 0
The right hand side for other dofs that do not represent for source edge
are set to be 0.

As the shape functions are scaled by a factor of inverse edge length, not
only the cell right hand side but also the cell matrix will change when
refining the mesh.
I don't know if both of them change, the solution would change with them?

I thought about when refining the mesh, for example, the initial mesh has
the source edge with 2 vertices are (0,0,0) and (0,0,1),
and the refined mesh has 2 source edges with vertices are (0,0,0),
(0,0,0.5) and (0,0,0.5), (0,0,1), respectively.
The results get by function
VectorTools::point_value(dof_handler,solution,point,values);
are not the same for the 2 mesh with my codes.

I think there should be some where I was wrong when assembling the matrix
and the right hand side.

I would like to thank you very much for your great support.
Best regards,
Pham Ngoc Kien



Vào Th 5, 21 thg 3, 2019 vào lúc 22:54 Wolfgang Bangerth <
[email protected]> đã viết:

>
> Pham,
>
> > When  testing my codes with FENedelec and FENedelecSZ elements, I saw
> that the
> > shape functions change versus the mesh size.
> > I think that for each edge of a cell, the shape functions for the degree
> of
> > freedom related to that edge are scaled with the inverse edge length.
> > For example, assuming I have a cell that is a cube, whose edge length is
> 1,
> > the shape function at the quadrature point located on the edge is {0, 0,
> 1}.
> > For the smaller cell whose edge length is 0.5, the shape function values
> is
> > {0, 0, 2}.
>
> Yes. This can be because of two things:
> * Shape functions are transformed by the Piola or a related transform that
>    multiplies shape functions by a measure related to the size of the cell.
> * Shape functions can be defined not as point values at specific points,
>    but as *integrals* over an edge or a face. So if the degree of freedom
>    is that the integral of a shape function (or its tangential component)
>    over an edge needs to be 1.0, then the *height* of the function needs to
>    increase by a factor of 2 if the size of the cell is reduced by a
> factor of
>    2.
>
>
> > In my limited opinion, the shape function is defined in unit cell over
> > [0,1]^3, and the shape function should not change when the real cell
> change
> > its size.
>
> This is not necessarily so. It depends on the finite element and the
> corresponding transform, see above.
>
>
> > This problem leads to the change of my solution when using the finer
> mesh
> > compared to that of coarser one.
>
> What is the problem you are encountering?
>
> If you refine the mesh and the height of the shape functions increase by a
> factor, then the entries of the solution vector will just go down by a
> factor
> of 2. The product of shape function times solution coefficients will then
> remain the same.
>
> Best
>   W.
>
> --
> ------------------------------------------------------------------------
> Wolfgang Bangerth          email:                 [email protected]
>                             www: http://www.math.colostate.edu/~bangerth/
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to