|
|
static double | Weight (double t, double start, double time) |
| | Smoothstep weight of the new snapshot at t; 1 without blending (time <= 0 or NaN). BlendWeight().
|
| |
|
static Sum | Evaluate (const State &state, double t, const double pos[3]) |
| | The sums of the snapshots of state at pos and t, weighted by the blend.
|
| |
| template<class Sampler > |
| static Sum | Evaluate (const State &state, double t, const double pos[3], const Sampler &sample) |
| |
|
static bool | Blends (const State &state, double t) |
| | Whether the state blends at t or later: the weight of t is below 1, so it still changes (owner ruling R136).
|
| |
| static SamplesType | Samples (const State &state, double t, const double pos[3]) |
| |
|
template<class Sampler > |
| static SamplesType | Samples (const State &state, double t, const double pos[3], const Sampler &sample) |
| | Samples() with each snapshot sampled by sample(snapshot, t, pos, value), as Evaluate(state, t, pos, sample) (ENV-0107).
|
| |
| static bool | MayReach (const State &state, const WakeQueryRegion ®ion) |
| |
template<class S, class Value = WakeSample, class SumType = WakeBlendSum, class SamplesType = WakeBlendSamples>
requires BlendSnapshot<S, Value>
class marenv::wake::WakeBlend< S, Value, SumType, SamplesType >
A published wake that hands over smoothly from the previous one (CONTEXT.md, Wake blend).
State is an immutable node: the snapshot blended to, the state it blends from (null means no wake) and the blend start and time. Weights depend on t only: the new snapshot has the C1 smoothstep weight s = 3 tau^2 - 2 tau^3, tau = (t - start) / time, and the state blended from has 1 - s, so a multistep integrator sees a C1 right-hand side. A blend time of 0 gives weight 1 for every t.
Evaluate() returns the raw sums sum(share d) and sum(share d u_s) of the snapshots that contributed. The caller normalises them, because a wake decides for itself what a zero deficit reports as the source velocity.
Thread safety: Publish() swaps a new immutable State in through std::atomic<std::shared_ptr<const State>>, the pattern of marenv::wave::LinearWaveTheory, so a query evaluates the old or the new state, never a mix. Keep to one writer: Publish() reads the state in use to decide what the new state blends from, then stores the new one, so two concurrent writers could drop one of the two. Load() takes no mutex; the libstdc++ spin bit of the atomic shared pointer is the known caveat (see WakeField::Sample).
Publish() is the publish policy of lead ruling R22, the one policy of SourceSetWake and GriddedWake (MENV-0060): a new blend may not start while the previous one runs, so a state blends from the previous snapshot alone and no chain forms; with blend time 0 nothing is kept to blend from.
The blend is linear in the snapshot's value, so the same hand-over serves a jet field (PropellerJet, doc/wake.md ยง 4.2): Value is the snapshot's sample (WakeSample, JetSample), SumType the weighted sum of samples (WakeBlendSum, JetBlendSum: inside, Add(share, Value), Add(share, SumType)) and SamplesType the held samples of SampleParts() (WakeBlendSamples, JetBlendSamples: currentInside, current, previous, start, time).