# Need help regarding simulation

**URL:** https://community.freefem.org/t/need-help-regarding-simulation/3310
**Category:** General Discussion
**Created:** [June 12, 2024, 6:00pm UTC](https://community.freefem.org/t/need-help-regarding-simulation/3310 "2024-06-12T18:00:16Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)
#### Post date: [June 12, 2024, 6:00pm UTC](https://community.freefem.org/t/need-help-regarding-simulation/3310/1 "2024-06-12T18:00:16Z")

</div>

I want to get following types of figure of Cahn-Hilliard equation.

 ![Screenshot_2024-06-12-20-32-19-735_com.google.android.apps.docs](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/7/7baf7e4f709857a6cd2deac96dbe6aa672172a47.jpeg)  
 ![Screenshot_2024-06-12-23-26-07-599_com.google.android.apps.docs](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/c/c8bb0ae6aad03e0487d165df32a0f160097fb704.jpeg)

Can you help me please how to do this kind of things using freefem++. I am facing problem regarding this.  
I wan to such type of computations. I need some demo examples so that i can understand how i can create this. Please help if anyone know.

---

<div class="post-metadata">

### Author: ![airwarriorg91](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/airwarriorg91/32/2387_2.png) [@airwarriorg91](https://community.freefem.org/u/airwarriorg91)
#### Post date: [June 12, 2024, 6:34pm UTC](https://community.freefem.org/t/need-help-regarding-simulation/3310/2 "2024-06-12T18:34:50Z")

</div>

Go through the example of Laplace equation and try to replace the Laplace equation with the weak formulation of your PDE. Then you can export the solution to paraview vtk file and use paraview for generating figures like that.

I recommend checking out the examples and Videos by TuxRider for FreeFEM. They would be helpful and teach you all the necessary stuff to use FreeFEM

---

<div class="post-metadata">

### Author: ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)
#### Post date: [June 12, 2024, 6:58pm UTC](https://community.freefem.org/t/need-help-regarding-simulation/3310/3 "2024-06-12T18:58:11Z")

</div>

Thanks for your reply. Can you share some demo example or tutorial for this things.

---

<div class="post-metadata">

### Author: ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)
#### Post date: [June 13, 2024, 3:55am UTC](https://community.freefem.org/t/need-help-regarding-simulation/3310/4 "2024-06-13T03:55:52Z")

</div>

[Heat-EI.edp](https://community.freefem.org/uploads/short-url/up7ZyFri1Gx6QtC2N8W9mfQ3OTr.edp) (1.7 KB)  
I am getting the Vtk File. What to do next??. Please tell brother how i can see such figure that i want?

---

<div class="post-metadata">

### Author: ![airwarriorg91](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/airwarriorg91/32/2387_2.png) [@airwarriorg91](https://community.freefem.org/u/airwarriorg91)
#### Post date: [June 13, 2024, 4:34am UTC](https://community.freefem.org/t/need-help-regarding-simulation/3310/5 "2024-06-13T04:34:18Z")

</div>

Import the iovtk library.

```auto
load "iovtk" //place this in the start of the code

savevtk("output.vtu", Th, u1,u2, p, dataname="U V P", order=[1,1,1]); 
//place this after the problem is solved and you have solution.

```

This will output a paraview readable file which you can load in Paraview and generated images like that. Paraview is recommended for better images otherwise you can simply plot the solution and save it.

If you are not aware about Paraview. It is a post-processing tool. Tux-riders channel has a series of tutorial on that too.

---

<div class="post-metadata">

### Author: ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)
#### Post date: [June 13, 2024, 4:44am UTC](https://community.freefem.org/t/need-help-regarding-simulation/3310/6 "2024-06-13T04:44:17Z")

</div>

But I see TuxRider doing everything in Python and Linux. I am using Windows10.

---

<div class="post-metadata">

### Author: ![airwarriorg91](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/airwarriorg91/32/2387_2.png) [@airwarriorg91](https://community.freefem.org/u/airwarriorg91)
#### Post date: [June 13, 2024, 4:51am UTC](https://community.freefem.org/t/need-help-regarding-simulation/3310/7 "2024-06-13T04:51:29Z")

</div>

The code remains same whether you use FreeFEM on windows or linux. It doesn’t change.  
In windows also you can use the same command to run the code through CMD.

`FreeFem++ foo.edp`  
Refer to these videos:

https://www.youtube.com/embed/videoseries?list=PL6fjYEpJFi7W6ayU8zKi7G0-EZmkjtbPo&wmode=transparent&rel=0&autohide=1&showinfo=1&enablejsapi=1

[![](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/c/c341ccccba0f2b8e668d89a857058134ee2a4887.jpeg "[FreeFEM 7] Visualization and input/output (IO) operations in FreeFEM") ](https://www.youtube.com/watch?v=algfmHKNsX4&t=149s)

---

<div class="post-metadata">

### Author: ![Monirul25](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/monirul25/32/3287_2.png) [@Monirul25](https://community.freefem.org/u/Monirul25)
#### Post date: [June 13, 2024, 4:53am UTC](https://community.freefem.org/t/need-help-regarding-simulation/3310/8 "2024-06-13T04:53:31Z")

</div>

Thank you so much brother. I will see. Many many thanks.
