vector_2d_c source_sink_c::get_velocity(const vector_2d_c & pos) const { vector_2d_c diff = pos - location; double vx = diff.x / (diff.get_length_sq()) * sigma / (2 * M_PI); double vy = diff.y / (diff.get_length_sq()) * sigma / (2 * M_PI); return vector_2d_c(vx, vy); }
vector_2d_c flow_accumulate_c::get_velocity(const vector_2d_c & pos) const { add_sheet_v_c add = add_sheet_v_c(pos); return std::accumulate(flows.begin(), flows.end(), vector_2d_c(0, 0), add); }
source_sink_c::source_sink_c() : location(vector_2d_c(0, 0)), sigma(1) { // }