pub struct FusionKernel { /* private fields */ }Expand description
The Grad-Shafranov equilibrium solver.
Implementations§
Source§impl FusionKernel
impl FusionKernel
Sourcepub fn from_file(path: &str) -> FusionResult<Self>
pub fn from_file(path: &str) -> FusionResult<Self>
Create a new kernel from a JSON config file.
Sourcepub fn solve_equilibrium(&mut self) -> FusionResult<EquilibriumResult>
pub fn solve_equilibrium(&mut self) -> FusionResult<EquilibriumResult>
Main equilibrium solver. Port of solve_equilibrium().
Algorithm:
- Compute vacuum field from coils
- Seed Gaussian current distribution
- Initial Jacobi solve
- Picard iteration loop: a. Find O-point (axis) and X-point b. Update nonlinear source term c. Jacobi elliptic solve d. Apply vacuum boundary conditions e. Relax: Ψ = (1-α)Ψ_old + α Ψ_new f. Check convergence
Sourcepub fn set_solver_method(&mut self, method: SolverMethod)
pub fn set_solver_method(&mut self, method: SolverMethod)
Set the inner linear solver method.
Sourcepub fn solver_method(&self) -> SolverMethod
pub fn solver_method(&self) -> SolverMethod
Get the current inner linear solver method.
Sourcepub fn set_external_profiles(
&mut self,
params_p: ProfileParams,
params_ff: ProfileParams,
)
pub fn set_external_profiles( &mut self, params_p: ProfileParams, params_ff: ProfileParams, )
Enable externally specified mTanh profiles for source update.
Sourcepub fn clear_external_profiles(&mut self)
pub fn clear_external_profiles(&mut self)
Disable external profile mode and revert to default nonlinear source update.
Sourcepub fn set_particle_current_feedback(
&mut self,
particle_j_phi: Array2<f64>,
coupling: f64,
) -> FusionResult<()>
pub fn set_particle_current_feedback( &mut self, particle_j_phi: Array2<f64>, coupling: f64, ) -> FusionResult<()>
Inject a static particle-current map blended into fluid J_phi each Picard step.
Sourcepub fn clear_particle_current_feedback(&mut self)
pub fn clear_particle_current_feedback(&mut self)
Disable particle-current feedback for subsequent solves.
Sourcepub fn set_particle_feedback_from_population(
&mut self,
particles: &[ChargedParticle],
coupling: f64,
runaway_threshold_mev: f64,
) -> FusionResult<ParticlePopulationSummary>
pub fn set_particle_feedback_from_population( &mut self, particles: &[ChargedParticle], coupling: f64, runaway_threshold_mev: f64, ) -> FusionResult<ParticlePopulationSummary>
Build particle feedback map from macro-particle population and enable coupling.
Sourcepub fn solve_equilibrium_with_profiles(
&mut self,
params_p: ProfileParams,
params_ff: ProfileParams,
) -> FusionResult<EquilibriumResult>
pub fn solve_equilibrium_with_profiles( &mut self, params_p: ProfileParams, params_ff: ProfileParams, ) -> FusionResult<EquilibriumResult>
Convenience wrapper to solve with temporary external profile parameters.
Sourcepub fn sample_psi_at(&self, r: f64, z: f64) -> FusionResult<f64>
pub fn sample_psi_at(&self, r: f64, z: f64) -> FusionResult<f64>
Sample solved flux at nearest grid point to (R, Z).
Auto Trait Implementations§
impl Freeze for FusionKernel
impl RefUnwindSafe for FusionKernel
impl Send for FusionKernel
impl Sync for FusionKernel
impl Unpin for FusionKernel
impl UnwindSafe for FusionKernel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more