coilpy.magnet#

class coilpy.magnet.Magnet(vertices=[[]], mvec=[0, 0, 1], Br=1.4)[source]#

Bases: object

Cube magnet class used for subdividing magnets

divide()[source]#

Divide the prism into eight dipoles.

Returns:

Dipole objects

Return type:

coilpy.Dipole

sub_cubes()[source]#

Subdivide a prism into 8 cubes.

Returns:

A list of 8 Magnets

Return type:

list

coilpy.magnet.corner2magnet(corner_file, moment_file, Br=1.4, reset=False)[source]#

Corner file to Magnet objects

Parameters:
  • corner_file (str) – *_corner.csv file.

  • moment_file (str) – *_moments.csv file

  • Br (float, optional) – Magnetic remanence. Defaults to 1.4.

  • reset (bool, optional) – If reset the magnetic remanence based on Br. Defaults to False.

Returns:

A list of 8 Magnet objects

Return type:

list