MoorDyn
Seafloor.hpp
Go to the documentation of this file.
1 
37 #pragma once
38 
39 #include "Misc.hpp"
40 #include "Log.hpp"
41 #include <vector>
42 #include <map>
43 
44 namespace moordyn {
45 
52 {
53  public:
54  Seafloor(moordyn::Log* log);
55  ~Seafloor();
56 
66  void setup(EnvCondRef env, const string& filepath);
67 
76  real getDepthAt(real x, real y);
77 
81  real getAverageDepth() { return averageDepth; }
82 
86  real getMinimumDepth() { return minDepth; }
87 
88  private:
90  unsigned int nx;
92  unsigned int ny;
93 
95  std::vector<real> px;
97  std::vector<real> py;
98 
100  std::vector<std::vector<real>> depthGrid;
101 
103  real averageDepth;
105  real minDepth;
106 };
107 
109 typedef std::shared_ptr<Seafloor> SeafloorRef;
110 }
A Logging utility.
Definition: Log.hpp:149
A helper for the entities to use the logger.
Definition: Log.hpp:223
Bathymetry description for MoorDyn.
Definition: Seafloor.hpp:52
real getDepthAt(real x, real y)
Get the depth at a particular x/y coordinate.
Definition: Seafloor.cpp:133
void setup(EnvCondRef env, const string &filepath)
Setup the seafloor.
Definition: Seafloor.cpp:28
real getAverageDepth()
The average of the depth at all the grid points.
Definition: Seafloor.hpp:81
real getMinimumDepth()
The depth of the seafloor at the shallowest point Potentially useful for optimizing collision against...
Definition: Seafloor.hpp:86
MoorDyn2 C++ API namespace.
Definition: Body.cpp:27
double real
Real numbers wrapper. It is either double or float.
Definition: Misc.hpp:118
std::shared_ptr< Seafloor > SeafloorRef
Shared pointer.
Definition: Seafloor.hpp:109