Skip to content

PointDipoleField: point dipoles with the moments as dofs - #153

Open
rogeriojorge wants to merge 26 commits into
feat/field-classesfrom
feat/point-dipole-field
Open

rogeriojorge wants to merge 26 commits into
feat/field-classesfrom
feat/point-dipole-field

Conversation

@rogeriojorge

Copy link
Copy Markdown
Member

Stacked on the field-classes PR.

B(x) = mu0/(4 pi) sum_j [3 (m_j . r_j) r_j / |r_j|^5 - m_j / |r_j|^3] for dipoles at fixed positions. The moments are the dofs, so coils + dipoles traces and differentiates like any field.

It is named apart from the permanent-magnet DipoleField of #32, which optimizes scalar strengths of fixed orientations through an interaction matrix. The two can coexist.

Tests check the on-axis formula, zero curl and divergence, the gradient in the moments, and field lines in coils plus dipoles.

rogeriojorge and others added 4 commits October 5, 2026 15:37
The step that crosses the LCFS ends outside the |B| and profile tables,
where the spline extrapolation can return a meaningless |B|. Its end
point was kept as the held state and its energy error entered
energy_error. Saved states now hold the last interior state; the
exterior end point and its energy error are reported separately in
terminal_states and terminal_energy_error (NaN unless lost). Loss and
failure classification is unchanged.

Fixes #115
…as dofs

B(x) = mu0 / (4 pi) sum_j [3 (m_j . r_j) r_j / |r_j|^5 - m_j / |r_j|^3] for
dipoles at fixed positions; the moments are the optimization dofs, so the
field adds to coils (coils + dipoles) and differentiates with respect to the
moments. Named apart from the permanent-magnet DipoleField of #32, which
optimizes scalar strengths of fixed orientations through an interaction
matrix. The pytree unflattens without __init__, since transforms put
non-array leaves in its slots.
rogeriojorge and others added 22 commits October 7, 2026 18:07
…int-dipole-field

# Conflicts:
#	tests/test_fields.py
Keep Boozer splines continuous and avoid duplicate m=0 storage
Boozer tracer: keep exterior terminal step out of interior diagnostics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant