Hi Dear Thang,

Thank you for you code snippet! It is simple and works well and is what I want. The link helps me understand the shape function in deal.ii.

 

Have a good weekend!

Michael

 

From: Thang W Pham
Sent: Saturday, September 11, 2021 12:20 AM
To: deal.II User Group
Subject: [deal.II] Re: How to get the shape_value at the quadrature point in the reference cell?

 

Hi Michael,

I think you should have a look at FE_Q (Lagrange elements) at this link. In deal.II, the reference cell's domain is [0,1]^2 for 2d element. So, the point you are about to evaluate (to get the value of phi_i equal 0.25)  is (0.5, 0.5).
You can refer to this snippet:

/*

  const FE_Q<2> Q_2d_element(1);

  const Point<2> center(0.5, 0.5);

  for(int i=0; i<Q_2d_element.n_dofs_per_cell(); i++){

    std::cout << Q_2d_element.shape_value(i, center) << std::endl;

  }

*/

//output 0.25 0.25 0.25 0.25

Also  have a look at step-3 to understand how FE_Q works in real problem since the shape functions will be evaluated at real cell coordinates. Good luck.

 

Regards,

T.P

 

Vào lúc 07:48:35 UTC+9 ngày Thứ Bảy, 11 tháng 9, 2021, lian...@gmail.com đã viết:

Deal deal.ii comunity,

 

I want to require the value of a shape function at some quadrature point. But the following code throws an error saying finite_element_output is protected.

     double shape_value = fe_values.finite_element_output.shape_values(i, q_index);

 

For a 2D bilinear element, I expect the shape values  at the cell center(kesi=0, eta=0) are 0.25 for all the 4 shape functions.

              

Is there other way to acquire this information?

 

Best,

Michael

--
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/b939b310-fd2b-46ee-83fa-59b46e6f9130n%40googlegroups.com.

 

--
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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/11C955E7-916F-420A-94AD-9479516E24F8%40hxcore.ol.

Reply via email to