bluemira.magnetostatics.baseclass ================================= .. py:module:: bluemira.magnetostatics.baseclass .. autoapi-nested-parse:: Base classes for use in magnetostatics. Classes ------- .. autoapisummary:: bluemira.magnetostatics.baseclass.CurrentSource bluemira.magnetostatics.baseclass.CrossSectionCurrentSource bluemira.magnetostatics.baseclass.SourceGroup Module Contents --------------- .. py:class:: CurrentSource Bases: :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: bluemira.magnetostatics.baseclass.CurrentSource :parts: 1 :private-bases: Abstract base class for a current source. .. py:attribute:: current :type: float .. py:method:: set_current(current: float) Set the current inside each of the circuits. :param current: The current of each circuit [A] .. py:method:: field(x: float | numpy.typing.NDArray[numpy.float64], y: float | numpy.typing.NDArray[numpy.float64], z: float | numpy.typing.NDArray[numpy.float64]) -> numpy.typing.NDArray[numpy.float64] :abstractmethod: Calculate the magnetic field at a set of coordinates. :param x: The x coordinate(s) of the points at which to calculate the field :param y: The y coordinate(s) of the points at which to calculate the field :param z: The z coordinate(s) of the points at which to calculate the field :returns: The magnetic field vector {Bx, By, Bz} in [T] .. py:method:: plot(ax: matplotlib.pyplot.Axes | None, **kwargs) :abstractmethod: Plot the CurrentSource. :param ax: The matplotlib axes to plot on .. py:method:: rotate(angle: float, axis: numpy.ndarray | str) :abstractmethod: Rotate the CurrentSource about an axis. :param angle: The rotation degree [rad] :param axis: The axis of rotation .. py:method:: copy() Get a deepcopy of the CurrentSource. :returns: Deepcopy of current source. .. py:class:: CrossSectionCurrentSource Bases: :py:obj:`CurrentSource` .. autoapi-inheritance-diagram:: bluemira.magnetostatics.baseclass.CrossSectionCurrentSource :parts: 1 :private-bases: Abstract class for a current source with a cross-section .. py:attribute:: _origin :type: numpy.array .. py:attribute:: _dcm :type: numpy.array .. py:attribute:: _points :type: numpy.array .. py:attribute:: _rho :type: float .. py:attribute:: _area :type: float .. py:method:: set_current(current: float) Set the current inside the source, adjusting current density. :param current: The current of the source [A] .. py:method:: rotate(angle: float, axis: numpy.ndarray | str) Rotate the CurrentSource about an axis. :param angle: The rotation degree [degree] :param axis: The axis of rotation .. py:method:: _local_to_global(points: numpy.typing.NDArray[numpy.float64]) -> numpy.typing.NDArray[numpy.float64] Convert local x', y', z' point coordinates to global x, y, z point coordinates. :returns: Converted array of points. .. py:method:: _global_to_local(points: numpy.typing.NDArray[numpy.float64]) -> numpy.typing.NDArray[numpy.float64] Convert global x, y, z point coordinates to local x', y', z' point coordinates. :returns: Local coordinates .. py:method:: plot(ax: matplotlib.pyplot.Axes | None = None, *, show_coord_sys: bool = False) Plot the CurrentSource. :param ax: The matplotlib axes to plot on :type ax: Union[None, Axes] :param show_coord_sys: Whether or not to plot the coordinate systems :type show_coord_sys: bool .. py:class:: SourceGroup(sources: list[CurrentSource]) Bases: :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: bluemira.magnetostatics.baseclass.SourceGroup :parts: 1 :private-bases: Abstract base class for multiple current sources. .. py:attribute:: sources :type: list[CurrentSource] .. py:attribute:: _points :type: numpy.array .. py:method:: set_current(current: float) Set the current inside each of the circuits. :param current: The current of each circuit [A] .. py:method:: field(x: float | numpy.typing.NDArray[numpy.float64], y: float | numpy.typing.NDArray[numpy.float64], z: float | numpy.typing.NDArray[numpy.float64]) -> numpy.typing.NDArray[numpy.float64] Calculate the magnetic field at a point. :param x: The x coordinate(s) of the points at which to calculate the field :param y: The y coordinate(s) of the points at which to calculate the field :param z: The z coordinate(s) of the points at which to calculate the field :returns: The magnetic field vector {Bx, By, Bz} in [T] .. py:method:: rotate(angle: float, axis: numpy.ndarray | str) Rotate the CurrentSource about an axis. :param angle: The rotation degree [rad] :param axis: The axis of rotation .. py:method:: plot(ax: matplotlib.pyplot.Axes | None = None, *, show_coord_sys: bool = False) Plot the MultiCurrentSource. :param ax: The matplotlib axes to plot on :param show_coord_sys: Whether or not to plot the coordinate systems .. py:method:: copy() Get a deepcopy of the SourceGroup. :returns: Deepcopy of the SourceGroup.