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
|
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) |
|
Creates a magnetic field by applying the BiotSavart law to the contained coil filaments |
|
Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Creates a coil from numpy array of shape [3, nPoints] |
|
Visualizes the contents in a graph structure. |
|
Loads an instance of this class from a previously written archive file. |
|
Prints a tree version of this object. |
|
Resolves all coils contained in the coil description Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Saves the object into an archive file (including all referenced data) |
|
Prints the contents as block-structured YAML |
|
Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
Attributes
|
Underlying Cap'n'proto struct (usually a builder 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, inline=False)
Creates a coil from numpy array of shape [3, nPoints]
- Parameters:
coilsData: A [3, nPoints] shape array of XYZ coil coordinates
inline: If True, the coil data will be embedded directly in the source structure. Other wise (default), they will be indirectly referenced. Use this for very small coils only.
- 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[…]