
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
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/b939b310-fd2b-46ee-83fa-59b46e6f9130n%40googlegroups.com.
Dr. Bangerth,
Thank you for your hints. I tried using shape_value, but it seems finite_element_output is a protected member. The error shows as follows:
error: ‘dealii::internal::FEValuesImplementation::FiniteElementRelatedData<2, 2> dealii::FEValuesBase<2, 2>::finite_element_output’ is protected within this context
59 | double shape_value = fe_values.finite_element_output.shape_value(i, q_index);
^~~~~~~~~~~~~~~~~~~~~
error: ‘class dealii::internal::FEValuesImplementation::FiniteElementRelatedData<2, 2>’ has no member named ‘shape_value’; did you mean ‘shape_values’?
By the way, I also want to get the shape_grad of the reference cell to compare with some other code implementation regarding shape function.
Based on Thong’s method, the following codes gives me the desired results for a Q1 element:
const FE_Q<2> Q_2d_element(1);
const Point<2> center(1, 1);
for(unsigned int i=0; i<Q_2d_element.n_dofs_per_cell(); i++)
{
std::cout << " shape value = " << Q_2d_element.shape_value(i, center);
std::cout << " shape grad = " << Q_2d_element.shape_grad(i, center) << std::endl;
}
I wonder if there are other ways to access the shape_grad on the ref cell directly. Do I need to use fe_values.inverse_jacobian(q_index) to convert from shape_grad on the real cell to the reference cell?
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/8cd6a2e7-5ad5-fbf5-3240-3237352335a9%40colostate.edu.