# The type "9" of cell of the "vtk" can not be input in FreeFem

**URL:** https://community.freefem.org/t/the-type-9-of-cell-of-the-vtk-can-not-be-input-in-freefem/1098
**Category:** General Discussion
**Created:** [July 18, 2021, 6:35am UTC](https://community.freefem.org/t/the-type-9-of-cell-of-the-vtk-can-not-be-input-in-freefem/1098 "2021-07-18T06:35:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![HGH](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@HGH](https://community.freefem.org/u/HGH)
#### Post date: [July 18, 2021, 6:35am UTC](https://community.freefem.org/t/the-type-9-of-cell-of-the-vtk-can-not-be-input-in-freefem/1098/1 "2021-07-18T06:35:44Z")

</div>

Dear all,

I have many results of “vtk” file from the other fluid software, and I need to input these “vtk” files into my FreeFEM++ programs to calculate next step. The mesh of “vtk” is two dimensional, and the cell type is 9. I used the “vtkload” to read the “vtk" files, but I failed. It seems like the FreeFEM++ has not include the type “9” of the cell of the “vtk”. Is anyone has good solution for this?

Thank you

![2021-07-18 153129](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/5d65ea70c9bd2c84b4b13bf56cdde0f3b3183c83.png)

 ![2021-07-18 153026](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/f8919dc2cb2088928475d2e9501206ad2f8864f1.png)

The type 9 of cell of “vtk”

![2021-07-18 153504](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/79e7985c0a88626460cd1956ac8f0b6a60c691bd.png)

---

<div class="post-metadata">

### Author: ![HGH](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@HGH](https://community.freefem.org/u/HGH)
#### Post date: [July 20, 2021, 1:48am UTC](https://community.freefem.org/t/the-type-9-of-cell-of-the-vtk-can-not-be-input-in-freefem/1098/2 "2021-07-20T01:48:44Z")

</div>

I found the “cell case 9” is not included in “iovtk.cpp”, so the “vtkload” is not used.  
How to solve this problem?

 ![2021-07-20 104629](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/3001fe454b2c2139e204aa7857f1d7fa2dcb08b4.png)

---

<div class="post-metadata">

### Author: ![julienG](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/julieng/32/222_2.png) [@julienG](https://community.freefem.org/u/julienG)
#### Post date: [July 20, 2021, 2:16am UTC](https://community.freefem.org/t/the-type-9-of-cell-of-the-vtk-can-not-be-input-in-freefem/1098/3 "2021-07-20T02:16:46Z")

</div>

Only vertex, edges, triangles and tetrahedrons are considered in Freefem++  
(see [here](https://github.com/FreeFem/FreeFem-sources-alh-dev-backup/blob/4de7c5cddf834ea5e0402d6203830de7e9d02d2f/examples%2B%2B-load/iovtk.cpp#L210)).  
You can moat likely do the conversion from quad to triangles inside vtk.

---

<div class="post-metadata">

### Author: ![HGH](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@HGH](https://community.freefem.org/u/HGH)
#### Post date: [July 20, 2021, 2:41am UTC](https://community.freefem.org/t/the-type-9-of-cell-of-the-vtk-can-not-be-input-in-freefem/1098/4 "2021-07-20T02:41:55Z")

</div>

Thank you Julien for your answer.

Yes, your method I can understand. But you know, my target is not to import the model through the “vtk” file. As I said in the first question, this “vtk” file is a two-dimensional rectangular model generated by other fluid simulation programs(not FreeFEM++), which contains the fluid force and pressure information on each point of each element. I mainly want to input these fluid force and pressure values into each point of my FreeFEM++ model.

The solution I think is to let the FreeFEM++ program read the information of each coordinate point first, and then the fluid force and pressure information in the “vtk” file can be input into my FreeFEM++ program one by one. Is there any better idea?

Best

---

<div class="post-metadata">

### Author: ![HGH](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@HGH](https://community.freefem.org/u/HGH)
#### Post date: [July 21, 2021, 7:37am UTC](https://community.freefem.org/t/the-type-9-of-cell-of-the-vtk-can-not-be-input-in-freefem/1098/5 "2021-07-21T07:37:23Z")

</div>

How about using the C++ or python to write the “vtk” reading program, and compile with FreeFEM++. Maybe FreeFEM++'s language is not enough for reading “vtk”. I read the “iovtk.cpp”, and I got the read “mesh” part. It seems not very simple to read the “vtk”. Any guy who know how to read the “vtk” without "load “iovtk:” on FreeFEM++?

 ![スクリーンショット 2021-07-21 163713](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/46543aac1f49100c7f07a8630af8b045998f7b02.png)
