Importing electrostatic potentials and fields.


This option can be useful for modelling complicated or long systems. It is accessed from the bottom of the sheet: /databuilder/segments/advanced options/.


The system can be split into 2 (or more) parts, preferably separated by field-free regions. The first part of the system is then modelled independently and the field in the region of the beam is saved for re-use. The second part of the system can then be modelled with some or all of the first part omitted, but with the previously calculated fields imported. If the 2 parts are not separated by a field free region then it might be necessary to add a transparent sheet between the regions, as described in the note on two-stage solutions.



Examples are given in xmpl2d50 and xmpl3d84.


Another (older) method is described in the note on two-stage solutions.


Information about the 'importing potentials and fields' option:


The most important information is that CPO uses the imported data to calculate the potentials and fields at points that are inside the region covered by the data grid, but it uses the surface charges for all other points, INCLUDING POINTS THAT ARE NEAR TO ANY MISSING GRID POINTS if the grid is incomplete. CPO DOES NOT GIVE ANY WARNING MESSAGES when this happens.


IN GENERAL, THIS OPTION SHOULD NOT BE USED WHEN SPACE-CHARGE IS PRESENT, because the imported field is not changed during space-charge iterations.


Other information:


For CPO2D the user-supplied data must have the form

spacingr spacingz

r1 z1 V1 er1 ez1

r2 z2 V2 er2 ez2

r3 z3 V3 er3 ez3


or the form

spacingr spacingz

r1 z1 V1

r2 z2 V2

r3 z3 V3



The analogous forms are used for CPO3D.

CPO will determine which form has been used.


The values on each line must be separated by spaces.


The data lines can be in any order.


The maximum number of data lines is 100*maxseg (that is, 200K for 2K segments).

There must be a blank line at the end of the data.


The 'spacings' line can be the first line of the data file. If it is not the first line it must be preceeded by a line that starts with 'Spacings' or 'spacings'. This line is added automatically when CPO is used to provide a grid (using the option 'potentials and fields along a line or grid', which does not include the effects of space-charge).


Bilinear interpolation is used to calculate potentials and fields at points between grid points.

When the second form is used and when fields are required (as they are in ray tracing) then CPO uses the potentials to calculate the fields, by differentiation and bilinear interpolation. The fields obtained in this way are less accurate than those obtained when the first form is used.

When the 'mesh' method of ray tracing is used the spacings of the mesh do not have to be the same as the spacings of the imported data grid.


The 'zero total charge' option is switched off when potentials are imported.

Some other restrictions will appear in informative error messages if they are exceeded.