#[derive(Debug, Clone, Copy)]
pub struct Particle {
pub position: [f64; 2],
pub charge: f64,
}
#[derive(Debug, Clone)]
pub struct FmmConfig {
pub max_level: usize,
pub n_crit: usize,
pub p_order: usize,
}
impl Default for FmmConfig {
fn default() -> Self {
Self {
max_level: 6,
n_crit: 8,
p_order: 6,
}
}
}
#[derive(Debug, Clone)]
pub struct FmmCell {
pub center: [f64; 2],
pub half_size: f64,
pub multipole: Vec<f64>,
pub local: Vec<f64>,
}
impl FmmCell {
pub fn new(center: [f64; 2], half_size: f64, p_order: usize) -> Self {
Self {
center,
half_size,
multipole: vec![0.0; 2 * p_order],
local: vec![0.0; 2 * p_order],
}
}
}
#[derive(Debug, Clone)]
pub struct FmmResult {
pub potentials: Vec<f64>,
pub forces: Vec<[f64; 2]>,
}