Mesh points

Mesh points (sometimes called nodal points) are not used in the Boundary Element Method to find the electrostatic field (for a detailed description of the BEM method see chapter 1 of the User`s Guide.

Mesh points are however be used by the program for two other purposes.

1. Tracing rays

Mesh points can be used, by choice, for tracing rays (that is, integrating trajectories). In the mesh method the potentials and field components are calculated and stored at mesh points in the vicinity of the ray. This is done during the evolution of the ray. When the program needs a potential or field at a point on the ray it looks for the values at nearby mesh points and interpolates between them. If a mesh point does not yet exist and the program cannot find the required value then the program creates the mesh point, calculates the potential or field components and stores the information. The mesh points that are created in this way form an incomplete array, which is a square array in CPO2D and a cubic array in CPO3D, unless the option for other distributions of mesh points is used.

The potentials are stored in one array of mesh points, and the field components in a separate array. Both arrays have the same spacing and origin. The potentials and/or fields at the mesh points are used at the time of creation of the points (and again later if there are further rays passing through the same region) to calculate the fields needed for tracing the ray. The mesh technique is therefore particularly useful when a large number of neighbouring rays is required.

The spacing of the mesh points is specified by the user. A small mesh spacing will improve the accuracy but will also increase the tracing time.

2. Space-charge calculations

The second use of mesh points is in space-charge calculations, if the cell method is chosen. The space through which the beam passes is notionally divided into an array of square or cubic cells, each of which can hold a space-charge. As a ray passes through a cell it deposits a charge there equal to the product of the current and the time spent traversing the cell.

The space-charge cells are created only where they are needed, in the volume traversed by the rays. The total charges in the cells (each with its weighted centre-of-gravity) are used to calculate space-charge potentials and fields.

The space-charge cells are completely independent of the ray cells (if these are used), and so the mesh spacing of the space-charge cells does not have to be the same as the mesh spacing used for the ray mesh points when rays are traced by the mesh method.

It often (but not always) preferable to use the mesh method of ray tracing for space-charge simulations.

When (very rarely) the message 'number of mesh spaces is too large' appears in an iterative space-charge run with a 32-bit program, this would imply that there are too many space charges caused by too many ray steps, causing an integer to exceed the 32-bit limit of 2^15 - 1 (that is, 32767).