Skip to content

Reply To: Extract Lattice data

#5842
achodankar
Participant

Hello Adrian,
Thank you very much for your prompt reply and help. I got the physical coordinates and material no using the following code, and its working fine.

for (int iC=0; iC < cuboidGeometry.getNc(); ++iC)
{
//cuboid = cuboidGeometry.get(iC);
for (int iX=0; iX < cuboidGeometry.get(iC).getNx(); ++iX)
{
for (int iY=0; iY < cuboidGeometry.get(iC).getNy(); ++iY)
{
latticeE[0] = iX;
latticeE[1] = iY;
physCord=cuboidGeometry.getPhysR(iC, iX, iY);
x_phys[iX][iY][iC] = physCord[0];
y_phys[iX][iY][iC] = physCord[1];
x_lattice[iX][iY][iC] = latticeE[0];
y_lattice[iX][iY][iC] = latticeE[1];
materialno = superGeometry.getBlockGeometry(iC).get(iX, iY);
material_no[iX][iY][iC] = superGeometry.getBlockGeometry(iC).get(iX, iY);
cout<<iC<<“,”<<latticeE[0]<<“,”<<latticeE[1]<<“,”<<materialno<<“,”<<physCord[0]<<“,”<<physCord[1]<<endl;
myfile9<<iC<<“,”<<latticeE[0]<<“,”<<latticeE[1]<<“,”<<materialno<<“,”<<physCord[0]<<“,”<<physCord[1]<<endl;
}
cout<<endl;
}
cout<<endl;
}

I have saved the physical coordinates in an array and then trying to convert it to lattice coordinates using the following code, but it is not working correctly. The y lattice coordinate remains the same for the same x and updates for changing x. The x lattice coordinate doesn’t update.
For example:
———————————————–
physical coordinates lattice coordinates
———————————————–
(0,0) (0,0)
(0,0.1) (0,0)
(0,0.2) (0,0)
………………………….
………………………..
(0,1) (0,1)
———————————-
(0.1,0) (0,1)
(0.1,0.1) (0,1)
(0.1,0.2) (0,1)
………………………….
………………………..
(0.1,1) (0,1)
—————————————

I would really appreciate your suggestion.

Thank you for your patience.

Yours sincerely,

Abhijeet