Dear Mr. Heltai,

Thanks a lot. it works now.

Best regards,

Yunfei


Luca Heltai <[email protected]> 于2025年8月18日周一 16:56写道:

> Careful: you are still using
>
> > fe_values.shape_value
>
> but you should be using
>
> > fe_face_values.shape_value
>
> and
>
> > fe_face_values.JxW(q_point);
>
> You are now adding just *volumetric* forces on *some* quadrature points
> *inside* the cell, not on the boundary.
>
> Best,
> L.
>
>
>
> > On 18 Aug 2025, at 16:17, Yunfei Huang <[email protected]> wrote:
> >
> > Hi Everyone,
> >
> > Here, I have attempted to add the Neumann boundary conditions (forces)
> to the 2D elasticity problem. Now I can see that the top two layers of
> grids are under force. The force on the top layer is smaller than that on
> the second layer.  please see my attachment figure.
> >
> > My question is: should there be one layer or not in the boundary layer?
> > If it is only one layer, why did I get these results?
> >
> > Here is my code:
> > for (; cell!=endc; ++cell){
> > cell_matrix = 0;
> > cell_rhs = 0;
> >
> > int traction_surface_id = 7;
> > for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
> > if (cell->face(face)->at_boundary() &&
> > cell->face(face)->boundary_id() == traction_surface_id)
> > {
> > fe_face_values.reinit(cell, face);
> >
> boundary_force_neumann.vector_value_list(fe_face_values.get_quadrature_points(),
> > boundary_force_values);
> >
> > for (unsigned int q_point=0; q_point<n_face_q_points; ++q_point)
> > {
> > for (unsigned int i = 0; i < dofs_per_cell; ++i)
> > {
> > const unsigned int component_i = fe.system_to_component_index(i).first;
> > // if (component_i==1)
> > cell_rhs(i) += fe_values.shape_value(i,q_point) *
> > boundary_force_values[q_point][component_i]*
> > // neumann_value[0][component_i]*
> > fe_values.JxW(q_point);
> > }
> > }
> > }
> >
> > Best regards,
> >
> > Yunfei
> >
> > --
> > 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].
> > To view this discussion visit
> https://groups.google.com/d/msgid/dealii/8d2c5d91-364f-46db-8f90-e38c75747cecn%40googlegroups.com
> .
> > <Screenshot 2025-08-18 at 16.13.47.png>
>
> --
> 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].
> To view this discussion visit
> https://groups.google.com/d/msgid/dealii/555B48CF-9E7C-4F97-BDB7-435B55CB5290%40gmail.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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/dealii/CAKdrMG6i5-NC54xV%3Db4YF_syN%2BROnxBV90F5bFDf%2B8gsnnA45g%40mail.gmail.com.

Reply via email to