|
MoorDyn
|
Class that handles wave and current kinematics. More...
#include <Waves.hpp>


Public Types | |
| enum | coordtypes { GRID_SINGLE = 0 , GRID_LIST = 1 , GRID_LATTICE = 2 } |
| Types of coordinates input on the grid file. More... | |
| using | NodeKinReturnType = std::tuple< const std::vector< real > &, const std::vector< vec3 > &, const std::vector< vec3 > &, const std::vector< real > & > |
Public Member Functions | |
| Waves (moordyn::Log *log) | |
| Constructor. | |
| ~Waves () | |
| Destructor. | |
| std::vector< vec3 > | getWaveKinematicsPoints () |
| Get the positions of all the nodes with wave kinematics. More... | |
| void | setWaveKinematics (std::vector< vec > const &U, std::vector< vec > const &Ud) |
| Set the wave kinematics for all the structural nodes. More... | |
| void | updateWaves () |
| Recalculates any wave and current kinematics for all the nodes. | |
| void | addLine (moordyn::Line *line) |
| Adds a line to the list of structures we calculate water kinematics for. More... | |
| void | addRod (moordyn::Rod *rod) |
| Adds a rod to the list of structures we calculate water kinematics for. More... | |
| void | addBody (moordyn::Body *body) |
| Adds a body to the list of structures we calculate water kinematics for. More... | |
| void | addPoint (moordyn::Point *point) |
| Adds a point to the list of structures we calculate water kinematics for. More... | |
| NodeKinReturnType | getWaveKinLine (size_t lineId) |
| Get the water kinematics for the line with id. More... | |
| NodeKinReturnType | getWaveKinRod (size_t rodId) |
| Get the water kinematics for the rod with given Id. More... | |
| NodeKinReturnType | getWaveKinBody (size_t bodyId) |
| Get the water kinematics for the body with given Id. More... | |
| NodeKinReturnType | getWaveKinPoint (size_t pointId) |
| Get the water kinematics for the point with given Id. More... | |
| real | getWaveHeightPoint (vec2 point) |
| Gets the surface height at a given (x, y) point. More... | |
| void | getWaveKin (const vec3 &pos, real &zeta, vec3 &vel, vec3 &acc, real &pdyn, Seafloor *seafloor=nullptr) |
| Get the wave kinematics at a point at the current time. More... | |
| void | setup (EnvCondRef env, SeafloorRef seafloor, time::Scheme *t, const char *folder="Mooring/") |
| Setup the wave kinematics. More... | |
Public Member Functions inherited from moordyn::LogUser | |
| LogUser (Log *log=NULL) | |
| Constructor. More... | |
| ~LogUser () | |
| Destructor. | |
| void | SetLogger (Log *log) |
| Set the log handler. More... | |
| Log * | GetLogger () const |
| Get the log handler. More... | |
Additional Inherited Members | |
Protected Attributes inherited from moordyn::LogUser | |
| Log * | _log |
| The log handler. | |
Class that handles wave and current kinematics.
This class keep track of all the structures (lines, points, rods, bodies, etc) being simulated. For each of these structures, it stores the water and wave kinematics for each node of the structure. The Waves class is in charge of understanding the wave/current settings and following through with the correct behavior.
Waves and current kinematics can be calculated by subclasses of AbstractWaveKin and AbstractCurrentKin. This makes it simple to add new wave or current kinematics modes, assuming they can adhere to the simple interface. The waves class itself just stores an AbstractWaveKin and AbstractCurrentKin, it has no ability to compute waves or currents on its own.
| void moordyn::Waves::addBody | ( | moordyn::Body * | body | ) |
Adds a body to the list of structures we calculate water kinematics for.
Should be called after Waves::setup
| body |
| void moordyn::Waves::addLine | ( | moordyn::Line * | line | ) |
Adds a line to the list of structures we calculate water kinematics for.
Should be called after Waves::setup
| line |

| void moordyn::Waves::addPoint | ( | moordyn::Point * | point | ) |
Adds a point to the list of structures we calculate water kinematics for.
Should be called after Waves::setup
| point |
| void moordyn::Waves::addRod | ( | moordyn::Rod * | rod | ) |
Adds a rod to the list of structures we calculate water kinematics for.
Should be called after Waves::setup
| rod |

Gets the surface height at a given (x, y) point.
Used mainly for debugging and visualization purposes
| point |

| void moordyn::Waves::getWaveKin | ( | const vec3 & | pos, |
| real & | zeta, | ||
| vec3 & | vel, | ||
| vec3 & | acc, | ||
| real & | pdyn, | ||
| Seafloor * | seafloor = nullptr |
||
| ) |
Get the wave kinematics at a point at the current time.
| pos | Point |
| seafloor | O |
| zeta | |
| vel | |
| acc | |
| pdyn |

| Waves::NodeKinReturnType moordyn::Waves::getWaveKinBody | ( | size_t | bodyId | ) |
Get the water kinematics for the body with given Id.
The vectors should all be of length 1
| bodyId | Id of the body |
| std::vector< vec3 > moordyn::Waves::getWaveKinematicsPoints | ( | ) |
Get the positions of all the nodes with wave kinematics.
Returns a vector of the positions of all the line nodes, points, rod nodes, bodies, etc at the current time.
| Waves::NodeKinReturnType moordyn::Waves::getWaveKinLine | ( | size_t | lineId | ) |
Get the water kinematics for the line with id.
| lineId | Id of the line |
| Waves::NodeKinReturnType moordyn::Waves::getWaveKinPoint | ( | size_t | pointId | ) |
Get the water kinematics for the point with given Id.
The vectors should all be of length 1
| pointId | Id of the points |
| Waves::NodeKinReturnType moordyn::Waves::getWaveKinRod | ( | size_t | rodId | ) |
Get the water kinematics for the rod with given Id.
| rodId | Id of the rod |
| void moordyn::Waves::setup | ( | EnvCondRef | env, |
| SeafloorRef | seafloor, | ||
| time::Scheme * | t, | ||
| const char * | folder = "Mooring/" |
||
| ) |
Setup the wave kinematics.
Always call this function after the construtor
| env | The enviromental options |
| t | The time integration scheme |
| folder | The root folder where the wave data can be found |
| moordyn::input_file_error | If an input file cannot be read, or if a file is ill-formatted |
| moordyn::invalid_value_error | If invalid values are found |
| moordyn::non_implemented_error | If WaveKin=2 |
| moordyn::mem_error | If there were roblems allocating memory |
| moordyn::output_file_error | If data cannot be written in folder |
| void moordyn::Waves::setWaveKinematics | ( | std::vector< vec > const & | U, |
| std::vector< vec > const & | Ud | ||
| ) |
Set the wave kinematics for all the structural nodes.
This expects the order of the points to be the same as what was returned by getWaveKinematicsPoints
| U | Water velocities at the nodes |
| Ud | Water accelerations at the nodes |