Crate lodestone_core

Source
Expand description

lodestone_core

Lodestone_core is a library to calculate the magnetic fields of arbitrary polygons and polyheda in 2D and 3D.

//! This test library and binary implements routines for calculating magnetic fields, written in Rust. A more complete Python version can be found on Github, or PyPi

§User friendly magnetic field calculations

This library consists of methods for calculating magnetic fields due to simple objects in 2D and 3D.

§Calculation Method

§Exact Analytical Methods

§Iterative Method for Cylindrical Sources

Modules§

magnets
The magnets module contains the 2D magnet objects and their methods for calculating magnetic fields
parse
Routines for reading simulation input files, writing result files, and command line argument configuration
points
Generic traits for all point objects i.e. Points (2D, 3D, cartesian, polar, cylindrical, spherical), structs of heap allocated vectors, stack allocated arrays
utils
The utils module contains utilities to generate points structs, convert between different coordinates, and quaternion routines for rotation

Enums§

MagnetError
Error Enum for possible errors

Constants§

ERR_CUTOFF
Floating point cutoff for relative error 1e-12
FP_CUTOFF
Floating point cutoff for vector alignment 1e-6
I_2PI
1/(2*PI)
I_4PI
1/(2*PI)
M2_PI
2*PI
M4_PI
4*PI
NAN
Not a number - float64 variant
PI
PI
PI_2
PI/2
PI_3
PI/3
PI_4
PI/4
PI_6
PI/6
STACK_MAX
Maximum number of elements allowed in an array inside a PointArray struct. 10,000.