FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Dynamics.h
1#pragma once
2
8#include "Random.h"
9
10#include <array>
11#include <fhsim_environment/AggregationField.h>
12#include <fhsim_environment/AggregationSpec.h>
13#include <string>
14#include <vector>
15
16namespace environment::field::aggregation
17{
18
23struct Member
24{
25 Aggregation shape;
26 VerticalReference reference = VerticalReference::Surface;
27 double height = 0.0;
28 std::array<double, 3> velocity {0.0, 0.0, 0.0};
29};
30
39double Reflect(double x, double low, double high, bool& flipped);
40
47std::vector<Member> Generate(const AggregationSpec& spec, Random& random, const DepthFunction& depth);
48
50void DrawVelocities(std::vector<Member>& members, const AggregationSpec& spec, Random& random);
51
61bool Step(std::vector<Member>& members, const AggregationSpec& spec, Random& random, const DepthFunction& depth);
62
67std::vector<Member> ReadState(const std::string& path);
68
70void PlaceOnSeabed(std::vector<Member>& members, const DepthFunction& depth);
71
73void WriteState(const std::string& path, const std::vector<Member>& members);
74
75} // namespace environment::field::aggregation
std::array< double, 3 > velocity
{north, east, down} [m/s].
Definition Dynamics.h:28
double height
Height above the seabed [m], positive up. Used for the seabed reference.
Definition Dynamics.h:27