Map from dof index to vertex index

54 views
Skip to first unread message

Kaushik Das

unread,
Jul 15, 2021, 5:09:03 PM7/15/21
to deal.II User Group
Hello,

Is there a way to know which dof_index is located at which vertex. 

For example, I want to "map" a dof_index that I get from affine_constrains.get_constraint_entries(line);

to a vertex index that are in the range of triangulation.begin_vertex() and triangulation.end_vertex().

Thank you,
Kaushik 

Wolfgang Bangerth

unread,
Jul 15, 2021, 6:30:35 PM7/15/21
to dea...@googlegroups.com
Kaushik,
there is no such way in the library because, in general, DoFs need not be
located on vertices. That is only true for the Q1 element.

But if you look at the implementation of the
DoFTools::map_dofs_to_support_points(), you can probably come up with a way to
get what you are looking, assuming you really are only using Q1 elements.

Best
W.


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

Jean-Paul Pelteret

unread,
Jul 16, 2021, 1:21:34 AM7/16/21
to dea...@googlegroups.com
To add to what Wolfgang has already said, there’s this entry in our FAQ on this topic (well, the reverse mapping from vertex to DoF):


--
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/b963d470-97f9-f79a-3ab8-4c31dbb70c94%40colostate.edu.

Kaushik Das

unread,
Jul 17, 2021, 8:39:41 AM7/17/21
to dea...@googlegroups.com
Thank you, Prof. Bangerth. 
Yes, I am using Q1 elements. 
I was able to do it following your hint. 
I am assuming that the ordering/sequence of dofs that we get from cell->get_dof_indices() will always be the same as the ordering/sequence of vertexes in a cell, that is the 'canonical' ordering given in GeometryInfo. Will that be true for linear hex Q1 elements always?

Thank you very much,
Kaushik 

--
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/cNZzfrSjTF4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.

Wolfgang Bangerth

unread,
Jul 19, 2021, 12:35:26 PM7/19/21
to dea...@googlegroups.com
On 7/17/21 6:39 AM, Kaushik Das wrote:
> I am assuming that the ordering/sequence of dofs that we get
> from cell->get_dof_indices() will always be the same as the ordering/sequence
> of vertexes in a cell, that is the 'canonical' ordering given in GeometryInfo.
> Will that be true for linear hex Q1 elements always?

Yes.
Reply all
Reply to author
Forward
0 new messages