desc.coils.MixedCoilSet.save_mgrid

MixedCoilSet.save_mgrid(path, Rmin, Rmax, Zmin, Zmax, nR=101, nZ=101, nphi=90, NFP=None, save_vector_potential=True, chunk_size=None, source_grid=None)Source

Save the magnetic field to an mgrid NetCDF file in “raw” format.

Parameters:
  • path (str) – File path of mgrid file to write.

  • Rmin (float) – Minimum R coordinate (meters).

  • Rmax (float) – Maximum R coordinate (meters).

  • Zmin (float) – Minimum Z coordinate (meters).

  • Zmax (float) – Maximum Z coordinate (meters).

  • nR (int, optional) – Number of grid points in the R coordinate (default = 101).

  • nZ (int, optional) – Number of grid points in the Z coordinate (default = 101).

  • nphi (int, optional) – Number of grid points in the toroidal angle (default = 90).

  • NFP (int, optional) – Number of toroidal field periods. If not provided, will default to 1 or the field’s NFP, if it has that attribute.

  • save_vector_potential (bool, optional) – Whether to save the magnetic vector potential to the mgrid file, in addition to the magnetic field. Defaults to True.

  • chunk_size (int or None) – Size to split computation into chunks of evaluation points. If no chunking should be done or the chunk size is the full input then supply None. Default is None.

  • source_grid (Grid) – What grid to use to discretize the source magnetic field. Will be passed into the source_grid argument of compute_magnetic_field and compute_magnetic_vector_potential. If None, defaults to whatever the default is for the given magnetic field, specified in the docstring for that magnetic field.

Returns:

None