How to define boundary conditions on edges and vertices in 3D?

40 views
Skip to first unread message

Michael Lee

unread,
Jun 10, 2021, 10:31:13 AM6/10/21
to deal.II User Group
Hello, deal.IIers,
I want to simulate the following problems (3D):
1) thin plate under pressure with four edges simply supported.
2) thin plate under pressure with four corner points simply supported.
 2021-06-10_082227.png    
For the first one, I tried the following code, but it seems boundary condition only works with face not on edge.

  for (const auto &cell : triangulation.cell_iterators())
          for (const auto &face : cell->face_iterators())
          {
            const auto center = face->center();
            if (face->at_boundary())
            {
                for (unsigned int j = 0; j < GeometryInfo<3>::lines_per_face; ++j)
                {                  
                  face->line(j)->set_boundary_id(2); //set the face boundary id
                  const auto center = face->line(j)->center(); // top x = const line fixed
                  if (face->line(j)->at_boundary())
                  if ( 
                       ((std::fabs(center(1) - 0) < 1e-12) && (std::fabs(center(2) - 0) < 1e-12) ) ||
                       ((std::fabs(center(1) - 2) < 1e-12) && (std::fabs(center(2) - 0) < 1e-12) ) ||
                       ((std::fabs(center(0) - 0) < 1e-12) && (std::fabs(center(2) - 0) < 1e-12) ) ||
                       ((std::fabs(center(0) - 3) < 1e-12) && (std::fabs(center(2) - 0) < 1e-12) ) 
                      ) // pinned lines
                  {
                      face->line(j)->set_boundary_id(0);
                  }
                } // line loop
             } // if at_boundary 
        } // cell loop

For the second problem, I don't even know how to set vertex boundary id. 

Any hints or advice will be appreciated!

Michael

Wolfgang Bangerth

unread,
Jun 10, 2021, 12:41:38 PM6/10/21
to dea...@googlegroups.com
On 6/10/21 8:31 AM, Michael Lee wrote:
> 1) thin plate under pressure with *four edges simply supported*.
> 2) thin plate under pressure with *four corner points simply supported*.
> 2021-06-10_082227.png
> For the first one, I tried the following code, but it seems boundary condition
> only works with face not on edge.

That is correct. Mathematically, you can only prescribe boundary conditions on
portions of the boundary (i.e., on *faces*) but not on edges in 3d or vertices
in 2d/3d. What is easy to do in deal.II matches what is mathematically possible.

Now, you will ask why other software packages allow you to do what is not easy
in deal.II. The answer is that other packages generally use a fixed mesh, and
on a fixed mesh, prescribing boundary conditions on a vertex is roughly
equivalent to prescribing boundary conditions on the adjacent faces. That's ok
if you keep the mesh fixed, but it means that you are changing the kind of
boundary conditions every time you change the mesh if you use software that
uses adaptive mesh refinement.

So my suggestion would be to think about the physical situation you want to
model, and translate that into prescribing boundary conditions on faces
instead of edges/vertices.

Best
W.

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

Michael Li

unread,
Jun 10, 2021, 2:52:06 PM6/10/21
to dea...@googlegroups.com

Thanks for confirming that. It saves me from keeping trying to define boundary conditions by setting boundary id on edges or vertices. I was too excited to think it is possible to do that when reading the code line(j)->set_boundary_id(2) in grid_generator.cc. Maybe it is just to distinct the edges with different boundary_ids for other use.

 

There are still many scenarios that we want to fix some points in the domain. I wonder if we can make use of the AffineConstraints class to deal with Dirichlet boundary conditions though it is not possible for Neumman BCs.

 

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/9e09474b-1e3f-7fbf-7527-01f6cdd256ef%40colostate.edu.

 

Wolfgang Bangerth

unread,
Jun 10, 2021, 4:22:37 PM6/10/21
to dea...@googlegroups.com
On 6/10/21 12:51 PM, Michael Li wrote:
> There are still many scenarios that we want to fix some points in the domain.
> I wonder if we can make use of the *AffineConstraints* class to deal with
> Dirichlet boundary conditions though it is not possible for Neumman BCs.

Yes, that is how one would do this. step-11, for example, constrains one node
as a linear combination of (many) others.
Reply all
Reply to author
Forward
0 new messages