use crate::numerical::matrix::Matrix;
use crate::physics::physics_sim::gpe_superfluidity::GpeParameters;
use crate::physics::physics_sim::gpe_superfluidity::{
self,
};
#[unsafe(no_mangle)]
pub extern "C" fn rssn_physics_sim_gpe_run_ground_state_finder(
nx: usize,
ny: usize,
lx: f64,
ly: f64,
d_tau: f64,
time_steps: usize,
g: f64,
trap_strength: f64,
) -> *mut Matrix<f64> {
let params = GpeParameters {
nx,
ny,
lx,
ly,
d_tau,
time_steps,
g,
trap_strength,
};
match gpe_superfluidity::run_gpe_ground_state_finder(¶ms) {
| Ok(res) => {
let rows = res.nrows();
let cols = res.ncols();
Box::into_raw(Box::new(Matrix::new(
rows,
cols,
res.into_raw_vec_and_offset().0,
)))
},
| Err(_) => std::ptr::null_mut(),
}
}