Skip to content

Extract Lattice data

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #5888
    achodankar
    Participant

    Hello Adrian,
    Same result.

    int latticeNew[2];
    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[0]<<“,”<<latticeNew[1]<<endl;
    }
    }
    }
    pfile9.close();

    Thank you.

    Yours sincerely,

    Abhijeet

    #5891
    Adrian
    Keymaster

    latticeNew is still only of size 2…

    #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.

Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.