Skip to content

Reply To: Extract Lattice data

#5836
achodankar
Participant

Hello Adrian,
I followed your procedure and was able to get the physical coordinates from lattice coordinates. However, I was unable to get obtain the lattice coordinates from given physical coordinates. I would appreciate your suggestions on this matter.

The code snippet is as follows:

!!—————————————————————————————-
//——————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] = double(iX)*cuboidGeometry.getMinDeltaR();
physCord[1] = double(iY)*cuboidGeometry.getMinDeltaR();
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