square pyramid boundary

28 views
Skip to first unread message

Loylick

unread,
Dec 11, 2016, 9:14:58 PM12/11/16
to deal.II User Group
Hello!
I would like to know how to implement a square pyramid boundary with the Dealii library tools? I've looked through the examples but have not found anything alike. Examples are given mostly on hyper cube domains.

Alex

Wolfgang Bangerth

unread,
Dec 11, 2016, 9:48:13 PM12/11/16
to dea...@googlegroups.com
The *boundary* part of the square pyramid is actually pretty simple, because
all faces are flat. So StraightBoundary is the correct boundary description.

But I suspect that you are asking how to create a *mesh* for this geometry, right?

Best
W.

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

Loylick

unread,
Dec 11, 2016, 10:31:18 PM12/11/16
to deal.II User Group, bang...@colostate.edu
Hi Wolfgang!
To be precise I need the Triangulation object if it is what you call a *mesh*, that is it.

Jean-Paul Pelteret

unread,
Dec 12, 2016, 2:10:37 AM12/12/16
to deal.II User Group, bang...@colostate.edu
Dear Loylick,

For these more complex grids that are not defined in GridGenerator, you have a few options. You can:
1. Use other GridGenerator functions in conjunction with the GridGenerator::merge_triangulations function so assemble it piece-wise
2. Use external meshing software, such as GMsh or Cubit
3. Construct the grid by hand, such as is demonstrated in step-14.

Regards,
Jean-Paul

Loylick

unread,
Dec 12, 2016, 9:08:40 PM12/12/16
to deal.II User Group, bang...@colostate.edu
Hi! Thanks for reply.

Following to 1) I have built my square pyramid from 2 simplexes end merged them. Next problem arose immediately. I realized that I did not quite understand which of set_boundary functions to use.  Is the following code enough or I should use some more sophisticated approach? Maybe set_all_boundary_ids will do better?
cell = tria.begin_active(),
endc = tria.end();
for (; cell!=endc; ++cell)
{
   for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
   {
      if (cell->face(face)->at_boundary())   cell->face(face)->set_boundary_id(1);

Jean-Paul Pelteret

unread,
Dec 13, 2016, 12:57:03 AM12/13/16
to deal.II User Group, bang...@colostate.edu
Dear Loylick,

Great, I'm glad you've managed to create a grid using the merge function. The way that you've specified the boundary id's is typically fine. The other function sets the boundary id's of both the faces and edges, which is unnecessary for most cases.

Regards,
Jean-Paul
Reply all
Reply to author
Forward
0 new messages