Exporting velocity profile

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?

Hello !
Did you find an anwer to the question ?

Hi,

Yes I did.

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;
		}
	}
1 Like

Thanks for sharing !