Skip to content

abchoudh-amd/coil_design

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coil_design

A standalone magpylib-based toolkit for magnetic-field calculation, visualization, and coil-parameter optimization. It is independent of the surrounding Quasar C++/HIP framework — it shares only the YAML-deck ergonomics and the out.npz key contract of quasar.coil so post-processing transfers.

All quantities are SI: positions in meters, currents in amperes, fields in tesla.

Setup

cd coil_design
uv sync          # creates .venv and installs magpylib>=5, numpy, scipy, matplotlib, pyyaml

Usage

# Compute B at the observation points in a deck; writes out.npz next to it
uv run coil-design run examples/single_loop/input.yaml

# Plot coil geometry and/or a field map (headless: writes a PNG)
uv run coil-design plot examples/helmholtz/input.yaml --save helmholtz.png

# Optimize free coil parameters toward a deck-defined objective
uv run coil-design optimize examples/helmholtz/input.yaml

out.npz keys

  • B_xyz(N, 3) magnetic flux density in tesla.
  • B_magnitude(N,) |B| per observation point.
  • dims — observation shape ([N] for a line, [ny, nx] for a grid).
  • observation_kind"point", "line", or "grid2d".

Deck format

units: SI
conductors:
  - name: loop
    current_A: 1.0
    geometry:
      type: circular_loop          # circular_loop | polyline | helmholtz | solenoid
      center_xyz: [0.0, 0.0, 0.0]
      axis_xyz:   [0.0, 0.0, 1.0]
      radius_m: 0.1
observation:
  type: line                       # point | line | grid2d
  start_xyz: [0.0, 0.0, 0.0]
  end_xyz:   [0.0, 0.0, 0.2]
  n_points: 5
output:
  path: out.npz

See examples/*/README.md for per-case detail and analytical references.

Tests

uv run pytest -q

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages