Extracting all the nodes on a particular boundary

48 views
Skip to first unread message

Wasim Niyaz Munshi ce21d400

unread,
Jan 19, 2023, 4:43:34 AM1/19/23
to deal.II User Group
Hello everyone.
I am trying to extract all the nodes present on a boundary with a particular id.
Would anyone be able to help me with this?
Also, for a  vector problem how do I extract a particular dof ( eg. I want the global dofs corresponding to the x-displacement of all the nodes on the top face)?
I know one way is to use something like : cell->vertex_dof_index(vertex_number)
Is there a way to skip the loop over elements and get the required info directly using the boundary id?

Thanks and regards
Wasim

Bruno Turcksin

unread,
Jan 19, 2023, 11:33:08 AM1/19/23
to deal.II User Group
Wasim,

You need to loop over the cells. That's the only way to get the information that you want.

Best,

Bruno

Wolfgang Bangerth

unread,
Jan 19, 2023, 11:44:50 AM1/19/23
to dea...@googlegroups.com
At the end of the day, as mentioned by Bruno, everything in deal.II
always works by way of a loop over all cells and then over the faces of
that cell.

Sometimes, there are functions that already do that for you. In your
case, this function is what you need:
https://dealii.org/developer/doxygen/deal.II/namespaceDoFTools.html#a05eb3b759a0491c2087cf3befcc39cc4

Best
W.



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

Bruno Turcksin

unread,
Jan 19, 2023, 11:54:54 AM1/19/23
to dea...@googlegroups.com
Nice, I looked for such a function in GridTools but I forgot about DoFTools.

Bruno

--
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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/UTCTGSXyEpI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/db7884bf-82e2-386c-9f75-9258a62a1dcf%40colostate.edu.
Reply all
Reply to author
Forward
0 new messages