# Exporting velocity profile

**URL:** https://community.freefem.org/t/exporting-velocity-profile/1013
**Category:** General Discussion
**Created:** [June 4, 2021, 1:24pm UTC](https://community.freefem.org/t/exporting-velocity-profile/1013 "2021-06-04T13:24:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zese](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zese/32/917_2.png) [@zese](https://community.freefem.org/u/zese)
#### Post date: [June 4, 2021, 1:24pm UTC](https://community.freefem.org/t/exporting-velocity-profile/1013/1 "2021-06-04T13:24:15Z")

</div>

dear all

I want to export inlet velocity profile from freefem to a text file. the profile is related to the inlet (x=0,y) with border label of 1. I wrote as below but it seems that it gives me the wrong values when I compare them with the probed data.

ofstream file1(“radial velocity.txt”);

int Nbtriangle=th.nbe;  
for (int k=0; k\<Nbtriangle; k++)  
{  
int L=th.be(k).label;  
if (L==1)  
{

```
		real xx=th.be(k)[1].x;
		real yy=th.be(k)[1].y;
		real xx2=th.be(k)[0].x;
		real yy2=th.be(k)[0].y;
		file1 << xx << " " << yy << " " << ur(xx,yy)<< xx2 << " " << yy2 << " " << ur(xx2,yy2) << endl;
		
	}
}

```

how I can export the velocity profile?

---

<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, 1:15pm UTC](https://community.freefem.org/t/exporting-velocity-profile/1013/2 "2024-06-13T13:15:22Z")

</div>

Hello !  
Did you find an anwer to the question ?

---

<div class="post-metadata">

### Author: ![zese](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zese/32/917_2.png) [@zese](https://community.freefem.org/u/zese)
#### Post date: [June 13, 2024, 3:34pm UTC](https://community.freefem.org/t/exporting-velocity-profile/1013/3 "2024-06-13T15:34:34Z")

</div>

Hi,

Yes I did.

```auto
int Nbtriangle=th.nbe;
	ofstream file1("velocity.txt");
	for (int k=0; k<Nbtriangle; k++)
	{
		int L=th.be(k).label;
		if (L==1)
		{
			real yy1=th.be(k)[1].y;
            real xx1=th.be(k)[1].x;
          
			file8 << xx1 <<" " << yy1 << " " << velocity(xx1,yy1) << endl;
		}
	}

```

---

<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:34pm UTC](https://community.freefem.org/t/exporting-velocity-profile/1013/4 "2024-06-13T16:34:53Z")

</div>

Thanks for sharing !
