Questions about cook_membrane.cc

58 views
Skip to first unread message

Lance Zhang

unread,
Jun 9, 2023, 5:27:25 AM6/9/23
to deal.II User Group
Hello,

I am a novice in dealII and I am interested in dealII.

Currently, I am trying to use the code of cook_membrane.cc to create  a cantilever.
Please take a look at the link for your reference.

1)May I know how I could create a Rectangular cuboid like the object a) below? and then change the Rectangular  into a mesh?


image_2023-06-09_111218320.png

2)I tried to configure the parameter of const Point<dim> top_right = (dim == 3 ? Point<dim>(48.0, 44.0, 0.5) : Point<dim>(48.0, 44.0)) ,but I got failed information.



template <int dim,typename NumberType>
void Solid<dim,NumberType>::make_grid()
{

Divide the beam, but only along the x- and y-coordinate directions

std::vector< unsigned int > repetitions(dim, parameters.elements_per_edge);

Only allow one element through the thickness (modelling a plane strain condition)

if (dim == 3)
repetitions[dim-1] = 1;
const Point<dim> bottom_left = (dim == 3 ? Point<dim>(0.0, 0.0, -0.5) : Point<dim>(0.0, 0.0));
const Point<dim> top_right = (dim == 3 ? Point<dim>(48.0, 44.0, 0.5) : Point<dim>(48.0, 44.0));
repetitions,
bottom_left,
top_right);
image_2023-06-09_112028575.pngn In the code lines:
1067  template <int dim,typename NumberType>
1068   void Solid<dim,NumberType>::make_grid()
1069   {
1070     // Divide the beam, but only along the x- and y-coordinate directions
1071     std::vector< unsigned int > repetitions(dim, parameters.elements_per_edge);
1072     // Only allow one element through the thickness
1073     // (modelling a plane strain condition)
1074     if (dim == 3)
1075       repetitions[dim-1] = 1;
1076
1077     const Point<dim> bottom_left = (dim == 3 ? Point<dim>(0.0, 0.0, -0.9) : Point<dim>(0.0, 0.0));
1078     const Point<dim> top_right = (dim == 3 ? Point<dim>(48.0, 44.0, 20) : Point<dim>(48.0, 44.0));


Could anyone provide any hint or suggestions?

Thank you in advance!

Best regards
Lance

Daniel Arndt

unread,
Jun 9, 2023, 9:57:08 AM6/9/23
to dea...@googlegroups.com
Lance,

Have a look at the documentation for GridGenerator::subdivided_hyper_recyangle (https://www.dealii.org/current/doxygen/deal.II/namespaceGridGenerator.html#ac76417d7404b75cf53c732f456e6e971).
You need to specify the coordinates of the corner with the lowest coordinates in all space dimensions, the corner with the highest coordinates in all space dimensions, as well as the subdivisions for all space dimensions.

Best,
Daniel

--
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/7debea34-8d99-4716-8e73-c62370efea69n%40googlegroups.com.

Lance Zhang

unread,
Jun 11, 2023, 7:00:52 AM6/11/23
to deal.II User Group
Hello  Daniel,

thanks for your message.

With the link I have created  rectangular cuboid and using subdivided_hyper_rectangle() I got points rectangular cuboid in as well.

But I still have one question.

If I want to describe a deformation when the rectangular cuboid  object receives a force F , how could I control the mesh moving during the force deformation ? Should I use cell or node in the surface of  rectangular cuboid to represent the displacement?I s there any function in dealII for mesh control?

Thanks in advance!
Best regards
Lance
image_2023-06-11_125315201.png
image_2023-06-11_125355704.png

Wolfgang Bangerth

unread,
Jun 11, 2023, 6:43:40 PM6/11/23
to dea...@googlegroups.com
On 6/11/23 05:00, Lance Zhang wrote:
>
> If I want to describe a deformation when the rectangular cuboid object
> receives a force F , how could I control the mesh moving during the force
> deformation ? Should I use cell or node in the surface of rectangular cuboid
> to represent the displacement?I s there any function in dealII for mesh control?

Lance:
You will want to read step-18.
Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Lance Zhang

unread,
Jun 19, 2023, 6:08:11 PM6/19/23
to deal.II User Group
Hello  Wolfgang,

thanks for your message.

Currently,I tried to implement adding local stiffness matrix into global  stiffness matrix.

1.May I know which parameter can control the index of cells and add the local stiffness matrix of cell into global matrix?

2.Whether is each cell matrix a kind of FullMatrix<double>   and local_dof_indices a local index parameter?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  template <int dim,typename NumberType>
  struct Assembler_Base
  {
    virtual ~Assembler_Base() {}

    // Here we deal with the tangent matrix assembly structures. The
    // PerTaskData object stores local contributions.
    struct PerTaskData_ASM
    {
      const Solid<dim,NumberType>          *solid;
      FullMatrix<double>                   cell_matrix;
      Vector<double>                       cell_rhs;
      std::vector<types::global_dof_index> local_dof_indices;

      PerTaskData_ASM(const Solid<dim,NumberType> *solid)
        :
        solid (solid),
        cell_matrix(solid->dofs_per_cell, solid->dofs_per_cell),
        cell_rhs(solid->dofs_per_cell),
        local_dof_indices(solid->dofs_per_cell)
      {}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
I will appreciate it if you could provide any hint or suggestions.
I wish I could receive your reply.

Best regards
Lance

Wolfgang Bangerth

unread,
Jun 20, 2023, 12:08:11 AM6/20/23
to dea...@googlegroups.com
On 6/19/23 16:08, Lance Zhang wrote:
>
> Currently,I tried to implement adding local stiffness matrix into global
> stiffness matrix.
>
> 1.May I know which parameter can control the index of cells and add the local
> stiffness matrix of cell into global matrix?

Lance,
I think you probably want to go back to the programs cook_membrane.cc builds
on. Every tutorial program in deal.II, starting with step-3, has to add local
contributions to the global matrix. Please read through step-3, for example.

Best
Wolfgang
Reply all
Reply to author
Forward
0 new messages