#approximation #electromagnetics #fma #quasi-steady #biot-savart #filamentized #grad-shafranov

cfsem

Quasi-steady electromagnetics including filamentized approximations, Biot-Savart, and Grad-Shafranov

2 stable releases

1.1.0 Aug 27, 2024
1.0.0 Jul 9, 2024

#341 in Math

MIT/Apache

74KB
1K SLoC

cfsem

Docs - Rust | Docs - Python

Quasi-steady electromagnetics including filamentized approximations, Biot-Savart, and Grad-Shafranov.

To avoid duplication, most tests and example applications are found with the Python bindings.

This library makes use of FMA (fused multiply-add) instructions; as a result, its performance benefits significantly from enabling the +fma flag for x86 targets. See this project's rustc config for an example configuration enabling FMA for x86 targets. aarch64 targets (such as Apple and Raspberry Pi processors) have FMA enabled by default.

Installation

To include this library in a Rust project, add an entry to your Cargo.toml's [dependencies] section:

cfsem = "*"

For Python installation, see the docs for the Python library.

Benchmarking

Benchmarks are configured in Cargo.toml, and can be run via cargo:

cargo bench

Contributing

Contributions consistent with the goals and anti-goals of the package are welcome.

Please make an issue ticket to discuss changes before investing significant time into a branch.

Goals

  • Library-level functions and formulas
  • Comprehensive documentation including literature references, assumptions, and units-of-measure
  • Quantitative unit-testing of formulas
  • Performance (both speed and memory-efficiency)
    • Guide development of performance-sensitive functions with structured benchmarking
  • Cross-platform compatibility
  • Minimization of long-term maintenance overhead (both for the library, and for users of the library)
    • Semantic versioning
    • Automated linting and formatting tools
    • Centralized CI and toolchain configuration in as few files as possible

Anti-Goals

  • Fanciness that increases environment complexity, obfuscates reasoning, or introduces platform restrictions
  • Brittle CI or toolchain processes that drive increased maintenance overhead
  • Application-level functionality (graphical interfaces, simulation frameworks, etc)

License

Licensed under either of

at your option.

Dependencies

~4MB
~82K SLoC