The 'User-defined cathode' version

This version (which is available only in special versions of the programs -contact CPO Ltd) of the 2D and 3D space-charge programs allows the User to define the emission properties of new and unconventional cathodes.

The User can for example define a thermionic temperature that depends on position, or new forms of Schottky or cold-field emitters, such as liquid-metal ion sources.

As in the regular versions, the cathode is subdivided into segments and one ray starts from the centre of each segment. At the start of each ray the program sends information to the User‑supplied routine on the positions of the cathode segments and on the strengths and directions of the electric fields at their surfaces.  The routine then returns information on the emitted current densities.  The rays are traced in the usual way, automatically taking care of any space‑charge.

The user-defined cathodes fall into two classes.

Type 1: Those that have a significant space-charge region in front of the cathode, as in thermionic cathodes. Here the user can for example define a temperature that depends on position.

Type 2: Those for which the space-charge in front of the cathode is an insignificant, as in field emission sources. Here the user can deal for example with new forms of emitter, such as insulators.


Iteration would usually be used for type 1 (thermionic) cathodes. The program will automatically deal with the space charge in the vicinity of the cathode in the same way that it deals with this space charge for conventional thermionic cathodes (see publication number 60 on the simulation of thermionic cathodes.).



The user-supplied routine must be called cathode2.cpp or cathode3.cpp (for CPO2DS and CPO3DS respectively).


The user-supplied routine has to be compiled and built into a dll (direct-linked-library) file before it can be called by the main program. See detailed instructions for building the cathode dll for further advice.


CPO Ltd will offer some advice and help in constructing new user-defined routines.


The CPO program package includes examples of cathode2.cpp and cathode3.cpp. They are called cat2copy.cpp and cat3copy.cpp and are read-only files. These examples deal with conventional thermionic and field-emission cathodes. These routines can of course be edited by users to make unconventional cathodes.


The user-supplied routine is called for every segment of the cathode defined by the user.


The input parameters provided by the CPO program are:


cathode_type, has_been_read,

rc, zc, rp, zp, area_c,

curvature_min, curvature_max (for type 1 only),

potential_difference or field (for types 1 and 2 respectively),

charge number, atomic mass number (for type 1 only),

iteration number,

maximum current density or work function (for types 1 and 2 respectively)


cathode_type, has_been_read,

xc, yc, zc, xp, yp, zp, area_c,

‘radius of curvature’ (for type 1 only),

potential_difference or field (for types 1 and 2 respectively),

charge number, atomic mass number (for type 1 only),

iteration number,

maximum current density or work function (for types 1 and 2 respectively)


Here c and p indicate respectively the centre of the cathode segment and the starting point of the trajectory.

The cathode curvatures for CPO2DS are 1/(radius of curvature), either about the z axis or in the r-z plane.

The 'radius of curvature' for CPO3DS is defined as follows:

(1) for a cylindrical electrode it is the radius of the cylinder,

(2) for a conical electrode it is the local radius of the cone,

(3) for a sphere it is half the radius of the sphere.


The output parameters that are sent back to the CPO program are:

current; dummy or mean energy for field emission (for types 1 and 2 respectively); r,z or x,y,z velocity components. If the external program returns zero velocity components then they are ignored by the main program.


Required parameters and ‘factor for starting distance’

For convenience the databuilder asks for the same parameters that are required for the program-supplied cathodes, but these parameters do not have to be used by the user-supplied routine. An exception to this is that for type 2 cathodes the databuilder asks for a ‘factor for starting distance’. This is used to calculate the separation between the starting point (xp,yp,zp) of a ray and the middle (xc,yc,zc) of the cathode segment that it comes from. This separation is the ‘factor’ times the ‘width’ of the segment, where for 2D the ‘width’ is the length of a segment while for 3D the ‘width’ is the maximum distance between the middle of a segment and any corner. The value of the field that is sent to the external routine is calculated at the starting point (xp,yp,zp) defined in this way.


The user-supplied routine can be edited to read control data from an external file that is named in the routine (in the given examples the names are cathode2.dat and cathode3.dat).


The user-defined routine can also output information to a file that is named in the routine.


Further detailed information is given in the example routines cat2copy.cpp and cat3copy.cpp.