Skip to main content
Version: Next (release 26)

Parameter file tuning

User_Functions​

In this block it is possible to include user defined functions for use during the simulation, e.g. a special voltage function. The syntax is the following:

type function_name(variable_name=type) = {
return calculated_value;
};

The type of the function as well as the variables can be "integer" or "float", the names of both are arbitrary but have to start with a letter. The number of variables is not limited and the calculated value can include common mathematical functions. An example of such a user function is the modulo function:

float myModulo(dividend=float, divisor=float) = {
integer quotient = dividend / divisor;
return dividend - quotient * divisor;
};

The use of this user function in the voltage function of an electrode would be e.g.:

vf = "-VP*myModulo(TIME, PAR.PERIOD)+DC_BIAS";

Profiling data and load balancing​

The file profile.txt contains information about the computational load of each quad and can be used for load balancing, i.e. the optimized distribution of the quads on the available CPUs. The load balancing is done automatically during restart, if the number of quads is higher than the number of requested CPUs. The load itself is measured at the end or during shutdown of each simulation and the number of timecycles used for this measurement can be set with the NTESTCYCLES value in the parameter file.

Additionally to the overall load used for the automatic load balancing, the individual loads for different stages during simulation are measured, this includes:

  • the collision of particles,
  • the movement of particles,
  • the transfer of particles to neighbour quads and
  • the calculation of the electric field.

This information can for example be used for fine-tuning of the quad arrangement. If the particle transfer takes a significant amount of time then reducing the overall number of quads might be beneficial. To get a better insight into the computational load not only by staring at the raw numbers, a small script visualize_load is provided. It is called from the directory where the parameter file is located and has the folder name of the simulation case as only parameter. The result is the file load_visualization.pos which can be viewed with GMSH.