FastLED 3.10.8
Loading...
Searching...
No Matches

◆ WaveSimulation1D_Real()

fl::WaveSimulation1D_Real::WaveSimulation1D_Real ( u32 length,
float speed = 0.16f,
int dampening = 6 )

Definition at line 59 of file wave_simulation_real.cpp.hpp.

61 : length(len),
62 grid1(length + 2), // Initialize vector with correct size
63 grid2(length + 2), // Initialize vector with correct size
64 whichGrid(0),
65 // CFL stability bound for the explicit leapfrog 5-point stencil in 1D
66 // is C^2 <= 1. Negative speed has no physical meaning. Clamp at the
67 // boundary to keep the Q15 fixed-point kernel both stable and within
68 // i32 overflow margins (paired with the i64 promote in update()).
69 mCourantSq(wave_detail::float_to_fixed(fl::clamp(courantSq, 0.0f, 1.0f))),
72 // Additional initialization can be added here if needed.
73}
fl::UISlider dampening("Dampening", 6.0f, 0.0f, 10.0f, 0.1f)
i16 float_to_fixed(float f) FL_NO_EXCEPT
i16 compute_damp_decay_q15(int damp) FL_NO_EXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NO_EXCEPT

References fl::clamp(), fl::wave_detail::compute_damp_decay_q15(), dampening(), fl::FL_NO_EXCEPT, fl::wave_detail::float_to_fixed(), grid1, grid2, length, mCourantSq, mDampDecayQ15, mDampenening, and whichGrid.

+ Here is the call graph for this function: