Jacobian matrix of the element center

28 views
Skip to first unread message

Léonhard YU

unread,
Jun 18, 2025, 10:57:04 AM6/18/25
to deal.II User Group
Dear all,

 sorry for the second message on the same day. I need interpolate the Jacobian matrix of at the center of an element. I wrote the following part but I am not sure whether it is right (because this is my first time to use FE_nothing)

...DoFHandler<dim>::active_cell_iterator &cell
...
// update the Jacobian matrix at the center of the cell
Point<dim> center_point;
for (unsigned int i = 0; i < dim; ++i)
center_point[i] = 0.5;
Quadrature<dim> center_quadrature(center_point);
FE_Nothing<dim> fe_nothing;
MappingQ1<dim> mapping;
FEValues<dim> temp_fe_values(mapping, fe_nothing, center_quadrature, update_jacobians);
temp_fe_values.reinit(cell);
DerivativeForm<1, dim, dim> center_jacobian = temp_fe_values.jacobian(0);
double det_J0 = center_jacobian.determinant();

Best Regards,
Leo

Wolfgang Bangerth

unread,
Jun 18, 2025, 11:36:54 AM6/18/25
to dea...@googlegroups.com
On 6/18/25 08:57, Léonhard YU wrote:
>
>  sorry for the second message on the same day. I need interpolate the
> Jacobian matrix of at the center of an element. I wrote the following part but
> I am not sure whether it is right (because this is my first time to use
> FE_nothing)

This looks right to me, though of course I haven't tested it. The way you
convince yourself that it's right is that you apply this to cells for which
you know what the Jacobian should be -- say, for a mesh of squares, a mesh of
rectangles, or something that is rotated. In those cases, you can compute the
Jacobian on a piece of paper and compare with what your code gives.

Best
W.
Reply all
Reply to author
Forward
0 new messages