How to get the vertex index on all the boundaries.

27 views
Skip to first unread message

ztdep...@gmail.com

unread,
Jul 2, 2023, 9:49:24 AM7/2/23
to deal.II User Group
I read in 2d mesh from "unv" file and i want to get all  the  vertex index on all the boundaries and also output the name of the each boundaries. 
Could you please give me some suggestions.

Wolfgang Bangerth

unread,
Jul 2, 2023, 11:13:23 AM7/2/23
to dea...@googlegroups.com
On 7/2/23 07:49, ztdep...@gmail.com wrote:
> **
>
> I read in 2d mesh from "unv" file and i want to get all  the  vertex index on
> all the boundaries and also output the name of the each boundaries.
> Could you please give me some suggestions.

I don't know whether there is a convenient way to obtain the vertex indices on
the boundary. You might just have to loop over all cells, over all faces of
that cell, and ask whether it's on the boundary.

But if you want the indices of *degrees of freedom* on the boundary, there is
a function in namespace DoFTools to extract those.

As for names: UNV is unique in that it allows giving a name (a string) to each
boundary. Most other mesh formats do not, and deal.II does not store this
string, just its integer number. So there is no way to query that name within
a deal.II program: It is ignored when reading UNV files.

Best
W.

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


Reply all
Reply to author
Forward
0 new messages