pub enum PhysicsError {
Show 21 variants
NumericalDivergence {
message: String,
},
InvalidInput {
field: String,
reason: String,
},
OutOfBounds {
index: usize,
max: usize,
},
ConvergenceFailed {
iterations: usize,
tolerance: f64,
residual: f64,
},
MeshError {
message: String,
},
MaterialError {
message: String,
},
CollisionError {
message: String,
},
IoError {
message: String,
},
FemElementError {
element_id: usize,
message: String,
},
FemAssemblyError {
message: String,
},
FemBoundaryConditionError {
node_id: usize,
message: String,
},
LbmLatticeError {
message: String,
},
LbmDistributionError {
cell_id: usize,
message: String,
},
LbmStabilityError {
parameter: String,
value: f64,
limit: f64,
},
SphKernelError {
message: String,
},
SphNeighborError {
particle_id: usize,
message: String,
},
SphDensityError {
particle_id: usize,
density: f64,
},
MdForceFieldError {
atom_types: (String, String),
message: String,
},
MdIntegrationError {
step: usize,
message: String,
},
MdNeighborListError {
message: String,
},
WithContext {
source: Box<PhysicsError>,
context: String,
},
}Expand description
Unified error type for the physics engine.
Variants§
NumericalDivergence
Solver diverged.
InvalidInput
Invalid parameter.
OutOfBounds
Index out of bounds.
ConvergenceFailed
Iterative solver failed to converge.
Fields
MeshError
Mesh topology error.
MaterialError
Invalid material state.
CollisionError
Collision detection failure.
IoError
I/O error wrapper.
FemElementError
FEM element error (degenerate element, negative Jacobian, etc.)
FemAssemblyError
FEM assembly error (stiffness matrix assembly failed).
FemBoundaryConditionError
FEM boundary condition error.
LbmLatticeError
LBM lattice configuration error.
LbmDistributionError
LBM distribution function error (negative density, non-physical state).
LbmStabilityError
LBM stability violation (CFL, Mach number exceeded).
Fields
SphKernelError
SPH kernel error (radius too small, invalid kernel type).
SphNeighborError
SPH neighbor search error.
SphDensityError
SPH density computation error (negative density, tensile instability).
MdForceFieldError
MD force field error (missing parameters, invalid potential).
MdIntegrationError
MD integration error (energy drift, temperature blowup).
MdNeighborListError
MD neighbor list error.
WithContext
Error with additional context.
Implementations§
Source§impl PhysicsError
impl PhysicsError
Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Wrap this error with additional context.
Sourcepub fn root_cause(&self) -> &PhysicsError
pub fn root_cause(&self) -> &PhysicsError
Get the root cause error, unwrapping all context layers.
Sourcepub fn context_chain(&self) -> Vec<&str>
pub fn context_chain(&self) -> Vec<&str>
Get the chain of context messages from outermost to innermost.
Sourcepub fn recovery_suggestion(&self) -> &'static str
pub fn recovery_suggestion(&self) -> &'static str
Returns a recovery suggestion for this error.
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Returns the severity level of this error.
Trait Implementations§
Source§impl Clone for PhysicsError
impl Clone for PhysicsError
Source§fn clone(&self) -> PhysicsError
fn clone(&self) -> PhysicsError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PhysicsError
impl Debug for PhysicsError
Source§impl Display for PhysicsError
impl Display for PhysicsError
Source§impl Error for PhysicsError
impl Error for PhysicsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for PhysicsError
impl PartialEq for PhysicsError
Source§fn eq(&self, other: &PhysicsError) -> bool
fn eq(&self, other: &PhysicsError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PhysicsError
Auto Trait Implementations§
impl Freeze for PhysicsError
impl RefUnwindSafe for PhysicsError
impl Send for PhysicsError
impl Sync for PhysicsError
impl Unpin for PhysicsError
impl UnsafeUnpin for PhysicsError
impl UnwindSafe for PhysicsError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.