# Save the values of scalar filed u w together with the mesh Th and Th1 in a .vtk file

**URL:** https://community.freefem.org/t/save-the-values-of-scalar-filed-u-w-together-with-the-mesh-th-and-th1-in-a-vtk-file/2606
**Category:** General Discussion
**Created:** [July 17, 2023, 2:03am UTC](https://community.freefem.org/t/save-the-values-of-scalar-filed-u-w-together-with-the-mesh-th-and-th1-in-a-vtk-file/2606 "2023-07-17T02:03:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![HJGH](https://avatars.discourse-cdn.com/v4/letter/h/ecc23a/32.png) [@HJGH](https://community.freefem.org/u/HJGH)
#### Post date: [July 17, 2023, 2:03am UTC](https://community.freefem.org/t/save-the-values-of-scalar-filed-u-w-together-with-the-mesh-th-and-th1-in-a-vtk-file/2606/1 "2023-07-17T02:03:38Z")

</div>

Dear FF++Users & Developers,  
I was trying to save the values of scalar filed u w together with the mesh Th and Th1 in a .vtk file with  
savevtk(“uw.vtu”,Th,u,Th1,w,dataname=“uw source”);  
But that doesn’t seem to be possible, so I’d like to ask how this can be achieved.  
Thank you!

---

<div class="post-metadata">

### Author: ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)
#### Post date: [July 17, 2023, 6:52am UTC](https://community.freefem.org/t/save-the-values-of-scalar-filed-u-w-together-with-the-mesh-th-and-th1-in-a-vtk-file/2606/2 "2023-07-17T06:52:20Z")

</div>

Assuming `u` is defined on `Th` and `w` is defined on `Th1`, you need something like:

```auto
savevtk("filename1.vtu", Th, u, dataname = "u", order = 1);
savevtk("filename2.vtu", Th1, w, dataname = "w", order = 1);

```

---

<div class="post-metadata">

### Author: ![HJGH](https://avatars.discourse-cdn.com/v4/letter/h/ecc23a/32.png) [@HJGH](https://community.freefem.org/u/HJGH)
#### Post date: [July 17, 2023, 7:04am UTC](https://community.freefem.org/t/save-the-values-of-scalar-filed-u-w-together-with-the-mesh-th-and-th1-in-a-vtk-file/2606/3 "2023-07-17T07:04:50Z")

</div>

Thank you very much for your reply. But I want Th u and Th1 w to be stored in a .vtk file.

---

<div class="post-metadata">

### Author: ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)
#### Post date: [July 17, 2023, 8:05am UTC](https://community.freefem.org/t/save-the-values-of-scalar-filed-u-w-together-with-the-mesh-th-and-th1-in-a-vtk-file/2606/4 "2023-07-17T08:05:12Z")

</div>

Is there any particular reason for wanting a `.vtk` file? The `.vtk` format is deprecated, so you should use `.vtu`.

---

<div class="post-metadata">

### Author: ![HJGH](https://avatars.discourse-cdn.com/v4/letter/h/ecc23a/32.png) [@HJGH](https://community.freefem.org/u/HJGH)
#### Post date: [July 17, 2023, 8:25am UTC](https://community.freefem.org/t/save-the-values-of-scalar-filed-u-w-together-with-the-mesh-th-and-th1-in-a-vtk-file/2606/5 "2023-07-17T08:25:32Z")

</div>

Because I want to put the deformation of both rings in the same window for analysis, but Tecplot can’t do that.
