fusionsc.magnetics.CoilFilament

class fusionsc.magnetics.CoilFilament(val=None, msgSize=1024, byReference=False)

Set of coils that can be associated with a current to compute magnetic fields.

Methods

__init__([val, msgSize, byReference])

Creates a new instance by either: - Allocating a new message of size msgSize (if val is None) - Storing a reference to the target (if byReference is set) - Copying the message from the given target (accepts Cap'n'proto messages, YAML strings, lists, dicts, and NumPy arrays)

biotSavart([width, stepSize, current, windingNo])

Creates a magnetic field by applying the BiotSavart law to the contained coil filaments

cache(filename)

Note Has asynchronous variant '.asnc(...)' that returns Promise[...]

fromArray(coilData)

Creates a coil from numpy array of shape [3, nPoints]

graph(**kwargs)

Visualizes the contents in a graph structure.

load()

Loads an instance of this class from a previously written archive file.

ptree()

Prints a tree version of this object.

resolve()

Resolves all coils contained in the coil description Note Has asynchronous variant '.asnc(...)' that returns Promise[...]

save(filename)

Saves the object into an archive file (including all referenced data)

toYaml([flow])

Prints the contents as block-structured YAML

upload()

Note Has asynchronous variant '.asnc(...)' that returns Promise[...]

Attributes

data

Underlying Cap'n'proto struct (usually a builder type).

type

Methods

CoilFilament.__init__(val=None, msgSize=1024, byReference=False)

Creates a new instance by either: - Allocating a new message of size msgSize (if val is None) - Storing a reference to the target (if byReference is set) - Copying the message from the given target (accepts Cap’n’proto messages,

YAML strings, lists, dicts, and NumPy arrays)

CoilFilament.biotSavart(width: float = 0.01, stepSize: float = 0.01, current: float = 1, windingNo: int = 1)

Creates a magnetic field by applying the BiotSavart law to the contained coil filaments

CoilFilament.cache(filename) Any

Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]

static CoilFilament.fromArray(coilData)

Creates a coil from numpy array of shape [3, nPoints]

CoilFilament.graph(**kwargs)

Visualizes the contents in a graph structure. Requires graphviz

CoilFilament.load() Any

Loads an instance of this class from a previously written archive file.

Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]

CoilFilament.ptree()

Prints a tree version of this object. Requires the printree library.

CoilFilament.resolve() Any

Resolves all coils contained in the coil description Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]

CoilFilament.save(filename) Any

Saves the object into an archive file (including all referenced data)

Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]

CoilFilament.toYaml(flow=False)

Prints the contents as block-structured YAML

CoilFilament.upload() Any

Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]