phyz-coupling 0.1.0

Multi-scale coupling between different physics solvers for phyz
Documentation
  • Coverage
  • 95.52%
    64 out of 67 items documented1 out of 32 items with examples
  • Size
  • Source code size: 42.65 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.49 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 56s Average build duration of successful builds.
  • all releases: 56s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • ecto/phyz
    18 3 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ecto

Multi-scale coupling for different physics solvers.

Couples different solvers (QM→MM, EM→rigid, particle→rigid) via:

  • Handshake regions: overlapping spatial domains for force exchange
  • Subcycling: run fast solvers at higher frequency
  • Force transfer: direct coupling, flux transfer, or potential barriers

Example

use phyz_coupling::{Coupling, ForceTransfer, BoundingBox, SolverType};
use phyz_math::Vec3;

// Define overlap region between electromagnetic and rigid body solvers
let coupling = Coupling {
    solver_a: SolverType::Electromagnetic,
    solver_b: SolverType::RigidBody,
    overlap_region: BoundingBox {
        min: Vec3::new(-1.0, -1.0, -1.0),
        max: Vec3::new(1.0, 1.0, 1.0),
    },
    force_transfer: ForceTransfer::Direct { damping: 0.1 },
};

// Compute Lorentz force on charged body
let force = phyz_coupling::lorentz_force(
    1e-6,  // charge (C)
    Vec3::new(0.0, 0.0, 0.0),
    Vec3::new(1.0, 0.0, 0.0),  // velocity
    &Vec3::new(0.0, 0.0, 1e3), // E field
    &Vec3::new(0.0, 1.0, 0.0), // B field
);