Example: Plugin Architecture
Crate: kwavers
Run: cargo run -p kwavers --example plugin_example
Source: crates/kwavers/examples/plugin_example.rs
Overview
Demonstrates the extensible plugin architecture for composing custom physics into a kwavers simulation without modifying core crates.
Patterns shown
- Implement a custom physics plugin — implement the
PhysicsPlugintrait - Register with
PluginManager— zero-overhead plugin composition - Adapt existing components — wrap a
Solveras a plugin withSolverPlugin
Why plugins
The plugin pattern separates the simulation orchestration (when to call what) from physics implementations (what each module computes), following the Dependency Inversion Principle.
Part Reference
Part IV — Simulation Orchestration: The Capability Catalog