Triangulation neighbor information when using GridIn::read_vtk

44 views
Skip to first unread message

sml.i...@gmail.com

unread,
Jul 26, 2017, 11:18:44 AM7/26/17
to deal.II User Group
Hello all

I am trying to read in a triangulation from a vtk file (generated by the dealii library). It works, but it seems like no information about neighboring cells is generated: iterating through the cells and calling cell->neighbor_index(face) always gives -1, indicating that the face is at the boundary (which it is certainly not in all cases). Do I need to generate this manually? Or adjust the vtk file? Or is the vtk format no suited for this?

Thanks for your help.

Best,
Samuel

Wolfgang Bangerth

unread,
Jul 26, 2017, 2:38:39 PM7/26/17
to dea...@googlegroups.com, sml.i...@gmail.com
It is, in general. I think the question is what's in the VTK file. How did you
generate it?

(If you generated it by writing it from deal.II's DataOut class, then the
resulting mesh will have the property you note because we duplicate each
vertex of the mesh as many times as there are adjacent cells.)

Best
W.


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

sml.i...@gmail.com

unread,
Jul 26, 2017, 2:55:45 PM7/26/17
to deal.II User Group, sml.i...@gmail.com, bang...@colostate.edu
Exactly, I generated it using GridOut. I see the problem now. I replaced all duplicate vertices in the vtk file, now it works as it should. Thanks for the clarification!

Best,
Samuel

Wolfgang Bangerth

unread,
Jul 26, 2017, 3:04:16 PM7/26/17
to sml.i...@gmail.com, deal.II User Group
On 07/26/2017 12:55 PM, sml.i...@gmail.com wrote:
> Exactly, I generated it using GridOut. I see the problem now. I replaced all
> duplicate vertices in the vtk file, now it works as it should. Thanks for the
> clarification!

Great.

But just to clarify, you used GridOut or DataOut? The former should work; the
latter we know doesn't.

sml.i...@gmail.com

unread,
Jul 26, 2017, 3:18:50 PM7/26/17
to deal.II User Group, sml.i...@gmail.com, bang...@colostate.edu
I must admit that I don't really remember ... I think it was GridOut, since I specifically wanted to export only the grid and not some solution data. What dou you mean with "GridOut should work"?

Wolfgang Bangerth

unread,
Aug 4, 2017, 6:27:29 PM8/4/17
to sml.i...@gmail.com, deal.II User Group
On 07/26/2017 01:18 PM, sml.i...@gmail.com wrote:
> I must admit that I don't really remember ... I think it was GridOut, since I
> specifically wanted to export only the grid and not some solution data. What
> dou you mean with "GridOut should work"?

I was wrong thinking that the GridOut::write_vtk() function should result in a
file that can be read in again via GridIn. I've documented this here now:
https://github.com/dealii/dealii/pull/4698
Reply all
Reply to author
Forward
0 new messages