pub struct PhaseChangeModifier {
pub config: PhaseChangeConfig,
pub temperature: ScalarField3D,
pub phase: ScalarField3D,
pub latent_heat: ScalarField3D,
pub sdf_offset: ScalarField3D,
pub enabled: bool,
}Expand description
Phase-change SDF modifier with solid/liquid/gas transitions
Fields§
§config: PhaseChangeConfigConfiguration
temperature: ScalarField3DTemperature field
phase: ScalarField3DPhase state per cell (stored as f32: 0=Solid, 1=Liquid, 2=Gas)
latent_heat: ScalarField3DLatent heat buffer (energy absorbed/released during phase transition)
sdf_offset: ScalarField3DAccumulated SDF offset (positive = material removed)
enabled: boolWhether modifier is enabled
Implementations§
Source§impl PhaseChangeModifier
impl PhaseChangeModifier
Source§impl PhaseChangeModifier
impl PhaseChangeModifier
Sourcepub const PARTICIPANT_KIND: ParticipantKind
pub const PARTICIPANT_KIND: ParticipantKind
Snapshot tag of this type as a world participant: "PHAS", the four
ASCII bytes read big endian. Never changes.
Trait Implementations§
Source§impl CoupledScalar for PhaseChangeModifier
The temperature field is shared through a deterministic Fix128 channel.
impl CoupledScalar for PhaseChangeModifier
The temperature field is shared through a deterministic Fix128 channel.
The counterpart of the impl on crate::thermal::ThermalModifier: the two
modifiers hold independent copies of the same physical quantity, and
crate::coupled_field::reconcile_mean is what makes a point have one
temperature instead of two.
Source§fn coupled_name(&self) -> &'static str
fn coupled_name(&self) -> &'static str
"temperature", …).Source§fn coupled_channel(&self) -> Result<CoupledField, CoupledFieldError>
fn coupled_channel(&self) -> Result<CoupledField, CoupledFieldError>
Source§fn publish(&self, out: &mut CoupledField) -> Result<(), CoupledFieldError>
fn publish(&self, out: &mut CoupledField) -> Result<(), CoupledFieldError>
out. Read moreSource§fn adopt(&mut self, src: &CoupledField) -> Result<(), CoupledFieldError>
fn adopt(&mut self, src: &CoupledField) -> Result<(), CoupledFieldError>
Source§fn check_adopt(&self, src: &CoupledField) -> Result<(), CoupledFieldError>
fn check_adopt(&self, src: &CoupledField) -> Result<(), CoupledFieldError>
Source§impl Participant for PhaseChangeModifier
One update(h) per world substep (h converted with
Fix128::to_f32); see the module documentation of
crate::sim_modifier for the payload and what is not coupled yet.
impl Participant for PhaseChangeModifier
One update(h) per world substep (h converted with
Fix128::to_f32); see the module documentation of
crate::sim_modifier for the payload and what is not coupled yet.
Observations: channel 0 the highest cell temperature (absent for a grid without cells), channel 1 the number of cells that are not solid (stored phase ≥ 0.5), channel 2 the total SDF offset.
Source§fn kind(&self) -> ParticipantKind
fn kind(&self) -> ParticipantKind
Source§fn substep(
&mut self,
_ctx: &mut SubstepCtx<'_>,
h: Fix128,
) -> Result<(), ParticipantFault>
fn substep( &mut self, _ctx: &mut SubstepCtx<'_>, h: Fix128, ) -> Result<(), ParticipantFault>
h (ctx.h()). Read bodies
from ctx, stage forces on them through ctx. Read moreSource§fn observe(&self, out: &mut ObservationSink)
fn observe(&self, out: &mut ObservationSink)
Observed::Undecided while a fault is recorded.Source§fn write_state(&self, out: &mut Vec<u8>)
fn write_state(&self, out: &mut Vec<u8>)
out.Source§fn check_state(&self, bytes: &[u8]) -> Result<(), StateError>
fn check_state(&self, bytes: &[u8]) -> Result<(), StateError>
Source§fn read_state(&mut self, bytes: &[u8])
fn read_state(&mut self, bytes: &[u8])
bytes. Only called with a payload
Self::check_state accepted.Source§fn step_rule(&self) -> StepRule
fn step_rule(&self) -> StepRule
Source§fn ports(&self) -> &[Port]
fn ports(&self) -> &[Port]
execution_order); they must not change while the participant is
registered.Source§impl PhysicsModifier for PhaseChangeModifier
impl PhysicsModifier for PhaseChangeModifier
Auto Trait Implementations§
impl Freeze for PhaseChangeModifier
impl RefUnwindSafe for PhaseChangeModifier
impl Send for PhaseChangeModifier
impl Sync for PhaseChangeModifier
impl Unpin for PhaseChangeModifier
impl UnsafeUnpin for PhaseChangeModifier
impl UnwindSafe for PhaseChangeModifier
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> 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> ⓘ
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> ⓘ
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