magneticalc.Field.Field

# ``magneticalc`.`Field`.`Field``

class documentation

`class Field(Validatable):`

Constructor: `Field()`

View In Hierarchy

Field class.

Static Method | `get_arrows` | Returns the field arrow parameters needed by `VisPyCanvas`.
Method | `__init__` | Initializes a field.
Method | `get_units` | Gets field units.
Method | `recalculate` | Recalculates field vectors.
Method | `set` | Sets the parameters.
Instance Variable | `type` | Undocumented
Property | `total_calculations` | Gets total number of calculations.
Property | `total_skipped_calculations` | Gets total number of skipped calculations.
Property | `vectors` | Gets field vectors. (The selected field type determined which field was calculated.)
Property | `vectors_count` | Number of field vectors
Instance Variable | `_distance_limit` | Undocumented
Instance Variable | `_length_scale` | Undocumented
Instance Variable | `_total_calculations` | Undocumented
Instance Variable | `_total_skipped_calculations` | Undocumented
Instance Variable | `_vectors` | Undocumented

Inherited from `Validatable`:

Method | `valid.setter` | No summary
Property | `valid` | True if valid, False if invalid
Instance Variable | `_valid` | Undocumented

@staticmethod
@ConditionalDecorator(get_jit_enabled(), jit, nopython=True, parallel=True)
def get_arrows(sampling_volume_points: `np.ndarray`, field_vectors: `np.ndarray`, line_pairs: `np.ndarray`, head_points: `np.ndarray`, arrow_scale: `float`, magnitude_limit: `float`) -> `tuple[np.ndarray, np.ndarray]`:

Returns the field arrow parameters needed by `VisPyCanvas`.

Parameters
sampling_volume_points: `np.ndarray` | Sampling volume points
field_vectors: `np.ndarray` | Field vectors
line_pairs: `np.ndarray` | Arrow line pairs (ordered list of arrow start/stop 3D points)
head_points: `np.ndarray` | Arrow head points (ordered list of arrow stop 3D points)
arrow_scale: `float` | Arrow scale
magnitude_limit: `float` | Magnitude limit (mitigating divisions by zero)

Returns
`tuple[np.ndarray, np.ndarray]` | Line pairs, head points

def __init__(self):
overrides `magneticalc.Validatable.Validatable.__init__`

Initializes a field.

def get_units(self, show_gauss=False) -> `tuple[str, float]`:

Gets field units.

Parameters
show_gauss | Enable to show Gauss instead of Tesla

Returns
`tuple[str, float]` | Field units, field factor

@validator
def recalculate(self, wire: `Wire`, sampling_volume: `SamplingVolume`, progress_callback: `Callable`, num_cores: `int`, backend_type: `int`) -> `bool`:

Recalculates field vectors.

Parameters
wire: `Wire` | Wire
sampling_volume: `SamplingVolume` | Sampling volume
progress_callback: `Callable` | Progress callback
num_cores: `int` | Number of cores to use for multiprocessing
backend_type: `int` | Backend type

Returns
`bool` | True if successful, False if interrupted (CUDA backend currently not interruptable)

def set(self, type: `int`, distance_limit: `float`, length_scale: `float`):

Sets the parameters.

Parameters
type: `int` | Field type
distance_limit: `float` | Distance limit (mitigating divisions by zero)
length_scale: `float` | Length scale (m)

type =

Undocumented

@property
@require_valid
total_calculations: `int` =

Gets total number of calculations.

@property
@require_valid
total_skipped_calculations: `int` =

Gets total number of skipped calculations.

@property
@require_valid
vectors: `np.ndarray` =

Gets field vectors. (The selected field type determined which field was calculated.)

@property
@require_valid
vectors_count: `int` =

Number of field vectors

_distance_limit =

Undocumented

_length_scale =

Undocumented

_total_calculations: `int` =

Undocumented

_total_skipped_calculations: `int` =

Undocumented

_vectors: `np.ndarray` =

Undocumented