Skip to content

Reply To: Extract Lattice data

#5892
achodankar
Participant

Hello Adrian,
The issue is fixed now. Thank you for patience and time. I really appreciate it.

Here is the code snippet:

int latticeNew[3];
T physNew[2];
ofstream pfile9;
pfile9.open(“physical_to_lattice_Coordinates.csv”);
pfile9 <<“phys_x,”<<“phys_y,”<<“i,” << “j” <<endl;

// 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)
{
physNew[0] = x_phys[iC][iX][iY];
physNew[1] = y_phys[iC][iX][iY];
cuboidGeometry.getLatticeR(latticeNew, physNew);
pfile9<<physNew[0]<<“,”<<physNew[1]<<“,”<<latticeNew[1]<<“,”<<latticeNew[2]<<endl;
}
}
}
pfile9.close();

Thank you.

Your sincerely,

Abhijeet C.