pub struct ThermalModifier {
pub config: ThermalConfig,
pub temperature: ScalarField3D,
pub melt_accumulator: ScalarField3D,
pub heat_sources: Vec<HeatSource>,
pub enabled: bool,
}Expand description
Thermal simulation that modifies SDF based on temperature
Supports melting (surface recession + gravity droop), thermal expansion, and freeze growth.
Fields§
§config: ThermalConfigConfiguration
temperature: ScalarField3DTemperature field
melt_accumulator: ScalarField3DAccumulated melt deformation (positive = material removed)
heat_sources: Vec<HeatSource>Active heat sources
enabled: boolWhether modifier is enabled
Implementations§
Source§impl ThermalModifier
impl ThermalModifier
Sourcepub fn new(
config: ThermalConfig,
resolution: usize,
min: (f32, f32, f32),
max: (f32, f32, f32),
) -> Self
pub fn new( config: ThermalConfig, resolution: usize, min: (f32, f32, f32), max: (f32, f32, f32), ) -> Self
Create a new thermal modifier
Sourcepub fn add_heat_point(
&mut self,
x: f32,
y: f32,
z: f32,
power: f32,
radius: f32,
)
pub fn add_heat_point( &mut self, x: f32, y: f32, z: f32, power: f32, radius: f32, )
Add a point heat source
Source§impl ThermalModifier
impl ThermalModifier
Sourcepub const PARTICIPANT_KIND: ParticipantKind
pub const PARTICIPANT_KIND: ParticipantKind
Snapshot tag of this type as a world participant: "THRM", the four
ASCII bytes read big endian. Never changes.
Trait Implementations§
Source§impl CoupledScalar for ThermalModifier
The temperature field is shared through a deterministic Fix128 channel.
impl CoupledScalar for ThermalModifier
The temperature field is shared through a deterministic Fix128 channel.
ThermalModifier and crate::phase_change::PhaseChangeModifier each own
a temperature field and nothing relates them — PhysicsModifier::update
receives only dt, so neither can read the other’s. Going through
CoupledField gives the pair one agreed field; see
crate::coupled_field::reconcile_mean.
This does not change what update does: coupling happens only when the
caller reconciles, so an existing chain behaves exactly as before.
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 ThermalModifier
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 ThermalModifier
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 total melt (sum of the melt cells).
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 ThermalModifier
impl PhysicsModifier for ThermalModifier
Auto Trait Implementations§
impl Freeze for ThermalModifier
impl RefUnwindSafe for ThermalModifier
impl Send for ThermalModifier
impl Sync for ThermalModifier
impl Unpin for ThermalModifier
impl UnsafeUnpin for ThermalModifier
impl UnwindSafe for ThermalModifier
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