Page 1 of 1

Tracking phase space coordinates during simulation

Posted: Thu 13 Apr 2023 18:29
by austin-hoover
Is it possible to write the 6D phase space coordinates to a file at multiple points in the simulation, controlling the output file names; e.g., "coords_001.dst", "coords_002.dst", etc.?

Second, one issue I have with PARMTEQ is that I cannot keep track of individual particles; particle indices are relabeled at various points during the simulation. Is it any different in Toutatis?

Re: Tracking phase space coordinates during simulation

Posted: Fri 14 Apr 2023 09:27
by RomualdDuperrier
Bonjour!

To export particle distribution along the RFQ, the solution is to set .plt export in .inp file with the command COMPRESSION_FACTOR ncompress. ncompress gives the data resolution in .plt file as follow:

if (ncompress==0) { // float (32 bits)
cc1=125; cc2=100;
}
if (ncompress==1) { // short int (16 bits)
cc1=124; cc2=99;
}
if (ncompress==2) { // char (8 bits)
cc1=123; cc2=98;
}
if (ncompress==3) { // 1/2 char (4 bits)
cc1=122; cc2=97;
}

If ncompress does not match the interval [0;3] no .plt file will be generated. Once you got your .plt file, you can view it with PlotWin (freeware) and Plotwin allows you to save a .dst at any position (actually one portrait at a cell middle). If you want a .dst at a very specific position, use RFQFINISH command. Also you will have to run the code as many time as you have positions to consider because the code will stop after all particles passed through the RFQFINISH position.

For individual particle tracking, yes Toutatis will support you doing this. Once you produced a .plt file, with Plotwin, you can graphically select a group of particles at any position (zoom on the particles of interest, double click and they will be colored, unzoom then). Then you can follow them downstream or upstream until there are lost if it happens.

I hope it helps,

Romuald

Re: Tracking phase space coordinates during simulation

Posted: Wed 26 Apr 2023 16:16
by austin-hoover
Thanks Romuald, I was able to generate a .plt file and view it using PlotWin. Is it possible to include only a subset of the cells in the plt file?

Re: Tracking phase space coordinates during simulation

Posted: Wed 26 Apr 2023 17:50
by RomualdDuperrier
Hi

Toutatis will save one distribution every cell, sorry. In case it would help, you can finish earlier the simulation with the command "RFQFinish z". Toutatis will run until the last particle in the bunch passed through the z coordinate in meter. By doing this, you should get a .plt file with all cells until z.

Best,

Romuald