FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
PropulsorWakeField.h
1#pragma once
3
4#include <marenv/current/CurrentField.h>
5
6#include <functional>
7#include <utility>
8
9namespace Ship
10{
11
23template<class State>
25{
26public:
28 using Jet = std::function<marenv::Status(const State& state, double time, const double position[3], double currentVelocity[3])>;
29
30 explicit PropulsorWakeField(Jet jet) : m_jet(std::move(jet)) { }
31
33 void Update(const State& state) { m_state = state; }
34
35 marenv::Status GetCurrent(double time, const double position[3], double currentVelocity[3]) override
36 {
37 return m_jet(m_state, time, position, currentVelocity);
38 }
39
40private:
41 State m_state{};
42 Jet m_jet;
43};
44
45} // namespace Ship
Definition PropulsorWakeField.h:25
void Update(const State &state)
Replaces the state copy; call it only between steps (AcceptedStep).
Definition PropulsorWakeField.h:33
marenv::Status GetCurrent(double time, const double position[3], double currentVelocity[3]) override
Definition PropulsorWakeField.h:35
std::function< marenv::Status(const State &state, double time, const double position[3], double currentVelocity[3])> Jet
The jet formula: the current at position and time from the copied state.
Definition PropulsorWakeField.h:28
Defines the interface for an relaying information about ocean currents.
Definition CurrentField.h:13
Status
Definition marenv.h:44
Simple waypoint object.
Definition CableAttach.h:58