MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ advance_velocity()

MAYAFLUX_API void MayaFlux::Kinesis::Acoustics::advance_velocity ( std::span< double > velocity,
std::span< const double > pressure,
std::span< const double > velocity_gain )
noexcept

Advance the half step velocities from the pressure.

Parameters
velocityN volume velocities, updated in place
pressureN + 1 pressures at the start of the sample
velocity_gainN gains from DuctGrid

Each velocity falls by its gain times the pressure rise across it.

Definition at line 5 of file StaggeredLine.cpp.

9{
10 if (pressure.empty()) {
11 return;
12 }
13
14 const size_t count = std::min({ velocity.size(), velocity_gain.size(), pressure.size() - 1 });
15 for (size_t l = 0; l < count; ++l) {
16 velocity[l] -= velocity_gain[l] * (pressure[l + 1] - pressure[l]);
17 }
18}
T velocity(const Memory::HistoryBuffer< T > &history, double dt) noexcept
First difference: rate of change of position.

References MayaFlux::Kinesis::velocity().

Here is the call graph for this function: