Skip to content

Add dipole magnetic vector potential calcs#24

Merged
jlogan-cfs merged 18 commits intoreleasefrom
md/add-vector-potential-dipole-methods
Oct 29, 2025
Merged

Add dipole magnetic vector potential calcs#24
jlogan-cfs merged 18 commits intoreleasefrom
md/add-vector-potential-dipole-methods

Conversation

@mdavids-cfs
Copy link
Copy Markdown
Collaborator

@mdavids-cfs mdavids-cfs commented Oct 28, 2025

  • Add dipole magnetic vector potential calcs (rust)
  • Unit tests in rust
  • Unit tests in python

@jlogan-cfs jlogan-cfs force-pushed the md/add-vector-potential-dipole-methods branch from 29ab2e8 to 8051f9f Compare October 29, 2025 13:45
@jlogan-cfs
Copy link
Copy Markdown
Collaborator

jlogan-cfs commented Oct 29, 2025

3.0.0 2025-10-29

Added

  • Rust
    • Add methods for vector potential of a dipole in physics::point_source and python.rs bindings
    • Add physics::volumetric module with methods for fields inside a uniformly magnetized sphere
    • Add math::{clip_nan, switch_float} functions for branchless-in-assembly float selection operations
  • Python
    • Add vector_potential_dipole function
    • Add optional sphere radius input for dipole flux density

Changed

  • Rust
    • !Require sphere radius input for dipole flux density
    • Update dependencies
    • Use more codegen units and don't do LTO for debug builds
    • Use more mul_add in flux_circular_filament
    • Use multiplication instead of pow in dipole calcs
  • Python
    • !Enable more instruction sets for x86 processors
    • Replace flatten() with ravel() everywhere to reduce copies

Copy link
Copy Markdown
Collaborator Author

@mdavids-cfs mdavids-cfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

import cfsem

from . import test_funcs as _test
from test import test_funcs as _test
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I changed
from . import test_funcs as _test
to
from test import test_funcs as _test

while I was testing it, so I could run some tests in the debugger

let rmag = r2.sqrt(); // [m]
let rhat = (r.0 / rmag, r.1 / rmag, r.2 / rmag); // [dimensionless]
let r3 = rmag * rmag * rmag; // [m^3]
let r3 = r2 * rmag; // [m^3]
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wizardry!

@jlogan-cfs jlogan-cfs merged commit 9d05322 into release Oct 29, 2025
6 checks passed
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.

2 participants