Reply To: Extract Lattice data
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Extract Lattice data › Reply To: Extract Lattice data
Hello Adrian,
I forgot to include the code. My apologies. Here is the code:
//——————Convert physical coordinates to lattice coordinates————–
std::vector<int> latticeR(2,T());
cout<<“——-Convert Physical coordinates to Lattice coordinates———-“<<endl;
for (int iC=0; iC < cuboidGeometry.getNc(); ++iC)
{
for (int iX=0; iX < cuboidGeometry.get(iC).getNx(); ++iX)
{
for (int iY=0; iY < cuboidGeometry.get(iC).getNy(); ++iY)
{
physCord[0] = x_phys[iX][iY][iC];
physCord[1] = y_phys[iX][iY][iC];
cuboidGeometry.getLatticeR(physCord, latticeR);
cout<<physCord[0]<<“,”<<physCord[1]<<“,”<<latticeR[0]<<“,”<<latticeR[1]<<endl;
}
cout<<endl;
}
cout<<endl;
}
cout<<“—————————————————————“<<endl;
//———————————————————————————–
Thank you.
Yours sincerely,
Abhijeet