Changing the Bempp options

Bempp uses a global options structure in bempp.api.global_parameters to control various aspects of the library. In addition, several functions and classes have a parameters attribute that can take a custom parameters object. This is useful if one wants to override the global parameters for a certain function. A custom parameters object can be created using the following command.

parameters = bempp.api.common.global_parameters()

In this tutorial, we give a description of all global parameter options.

Global parameters

Assembly parameters

  • bempp.api.global_parameters.assembly.boundary_operator_assembly_type
    This parameter controls whether boundary operators are assembled in dense mode or in hmat mode. The default is hmat to use H-matrix assembly for boundary operators.
  • bempp.api.global_parameters.assembly.potential_operator_assembly_type
    This parameter controls whether potential operators are assembled in dense mode or in hmat mode (default). For exterior potentials, H-matrix assembly is almost always preferable.
  • bempp.api.global_parameters.assembly.enable_singular_integral_caching
    If set to True (default), singular integrals are pre-calculated and cached before the regular integrals are calculated. This usually gives a small speed advantage and should not need to be modified.
  • bempp.api.global_parameters.assembly.enable_interpolation_for_oscillatory_kernels
    If set to True (default), Helmholtz type kernels (including Maxwell) are evaluated using a piecewise Hermite interpolation. This is significantly faster than evaluating the exponentials directly.
  • bempp.api.global_parameters.assembly.interpolation_points_per_wavelength
    This parameter sets the number of interpolation points per wavelength to be used (default 5000).
  • bempp.api.global_parameters.quadrature
    This modifies the quadrature options.

H-matrix parameters

  • bempp.api.global_parameters.hmat.admissibility
    This parameter sets the type of admissibility condition. The default is weak, which declares a block cluster admissible if the column and range cluster bounding boxes do not intersect. The classical H-matrix admissibility condition is obtained by setting this parameter to strong.
  • bempp.api.global_parameters.hmat.coarsening
    If this parameter is set to True (default), this will enable automatic coarsening of H-matrices.
  • bempp.api.global_parameters.hmat.coarsening_accuracy
    This parameter controls the accuracy of the coarsening procedure. The default value is 0, meaning that the accuracy set in the eps parameter is used.
  • bempp.api.global_parameters.hmat.compression_algorithm
    This sets the compression algorithm that is used. The default is aca, which uses a modified adaptive cross approximation with heuristic failure detection. By choosing dense, no compression is performed and all blocks are stored as dense matrices.
  • bempp.api.global_parameters.hmat.eps
    This sets the relative accuracy of the H-matrix compression.
  • bempp.api.global_parameters.hmat.mat_vec_parallel_levels
    The H-matrix vector product is a hierarchic operation. For each node of the tree parallel tasks corresponding to the number of children are created. This parameter sets the level at which a serial algorithm should start to be used in order to limit the number of very small tasks, as can be inefficient (default 5).
  • bempp.api.global_parameters.hmat.max_block_size
    For load-balancing reasons it is useful to restrict the maximum block size, as each block is compressed using a single task and a very large block would occupy a single task for too long. The default is 2048, but should be increased for very large problems.
  • bempp.api.global_parameters.hmat.max_rank
    This parameter is the maximum allowed rank for the compression of a block. The block compression stops at this rank even if the accuracy requirements are not yet achieved. The default is 30.
  • bempp.api.global_parameters.hmat.min_block_size
    This sets the minimum size of a block. The default is 20, meaning that clustering stops if fewer than 20 degrees of freedom are left in a cluster node.