simnibs.simulation.tms_many_simulations

simnibs.simulation.tms_many_simulations(mesh, cond, fn_coil, matsimnibs_list, didt_list, fn_hdf5, dataset, roi=None, field='E', post_pro=None, solver_options=None, n_workers=1)

Function for running a large amount of TMS simulations

Parameters
  • mesh (simnibs.msh.mesh_io.Msh) – Mesh structure

  • cond (simnibs.msh.mesh_io.ElementData) – Conductivity field

  • fn_coil (string) – Name of coil file

  • matsimnibs_list (list) – List of “matsimnibs” matrices, one per position

  • didt_list (list) – List of dIdt values, one per position

  • fn_hdf5 (str) – Name of hdf5 where simulations will be saved

  • dataset (str) – Name of dataset where data is to be saved

  • roi (list or None (optional)) – Regions of interest where the fields is to be saved. If set to None, will save the electric field in all tissues. Default: None

  • field (str) – Which field/s to save, any combination of E, D, J, v. E.g. ‘EDJ’. Default: ‘E’. Note: When post-processing is used the field can only be either ‘E’ or ‘J’

  • post_pro (list of callables (optional)) – List of callables f_post = post_pro(f), where f is the requested field (or multiple field as a tuple of the ordering E,D,J,v) in the ROI and f_post is an Nx3 ndarray. The postprocessing result will be saved instead of the field/s.

  • solver_options (str (optional)) – Options to be used by the solver. Default: Hypre solver

  • n_workers (int) – Number of workers to use