|
MoorDyn
|
A point for a line endpoint. More...
#include <Point.hpp>


Classes | |
| struct | _attachment |
| Attached lines to the point. More... | |
Public Types | |
| enum | types { COUPLED = -1 , FREE = 0 , FIXED = 1 , VESSEL = COUPLED , FAIRLEAD = COUPLED , POINT = FREE , ANCHOR = FIXED } |
| Types of points. More... | |
| typedef struct moordyn::Point::_attachment | attachment |
| Attached lines to the point. | |
Public Member Functions | |
| Point (moordyn::Log *log, size_t id) | |
| Constructor. More... | |
| ~Point () | |
| Destructor. | |
| void | setTime (real time) |
| Set the line simulation time. More... | |
| void | setup (int number_in, types type_in, vec r0_in, double M_in, double V_in, vec F_in, double CdA_in, double Ca_in, EnvCondRef env_in) |
| Setup the point. More... | |
| void | addLine (moordyn::Line *theLine, EndPoints end_point) |
| Attach a line endpoint to this point. More... | |
| EndPoints | removeLine (Line *line) |
| Detach a line. More... | |
| std::vector< attachment > | getLines () const |
| Get the list of attachments. More... | |
| std::pair< vec, vec > | initialize () |
| Initialize the FREE point state. More... | |
| void | initialize (InstanceStateVarView r) |
| Initialize a free instance. More... | |
| const vec & | getPosition () const |
| Get the point position. More... | |
| const vec & | getVelocity () const |
| Get the point velocity. More... | |
| void | getState (vec &r_out, vec &rd_out) |
| Get the point state. More... | |
| std::pair< vec, vec > | getState () |
| Get the point state. More... | |
| void | getFnet (vec &Fnet_out) const |
| Get the force on the point. More... | |
| const vec & | getFnet () const |
| Get the force on the point. More... | |
| void | getM (mat &M_out) const |
| Get the mass matrix. More... | |
| const mat & | getM () const |
| Get the mass matrix. More... | |
| real | GetPointOutput (OutChanProps outChan) |
| Get the output. More... | |
| void | setWaves (moordyn::WavesRef waves_in, moordyn::SeafloorRef seafloor_in) |
| Set the environmental data. More... | |
| void | scaleDrag (real scaler) |
| Multiply the drag by a factor. More... | |
| void | initiateStep (vec rFairIn, vec rdFairIn) |
| Initialize the time step integration. More... | |
| void | updateFairlead (real time) |
| Take the kinematics from the fairlead information. More... | |
| void | setKinematics (vec r_in, vec rd_in) |
| Take the kinematics from the fairlead information. More... | |
Public Member Functions inherited from moordyn::Instance | |
| Instance (moordyn::Log *log) | |
| Costructor. More... | |
| virtual | ~Instance ()=default |
| Destructor. | |
| const size_t | id () const |
| Get the unique identifier of this instance. More... | |
Public Member Functions inherited from moordyn::io::IO | |
| IO (moordyn::Log *log) | |
| Costructor. More... | |
| virtual | ~IO ()=default |
| Destructor. | |
| void | Save (const std::string filepath) |
| Save the entity into a file. More... | |
| void | Load (const std::string filepath) |
| Loads the entity from a file. 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... | |
Static Public Member Functions | |
| static string | TypeName (types t) |
| Return a string with the name of a type. More... | |
Public Attributes | |
| size_t | pointId |
| Point ID. | |
| int | number |
| Point number. | |
| types | type |
| Point type. | |
| void | setState (vec pos, vec vel) |
| Set the state variables. More... | |
| void | setState (const InstanceStateVarView r) |
| Set the point state. More... | |
| void | getStateDeriv (InstanceStateVarView drdt) |
| Calculate the forces and state derivatives of the point. More... | |
| void | getNetForceAndMass (vec6 &Fnet_out, mat6 &M_out, vec rBody=vec::Zero(), vec6 vBody=vec6::Zero()) |
| Calculate the force and mass contributions of the point on the parent body. More... | |
| moordyn::error_id | doRHS () |
| Calculates the forces and mass on the point, including from attached lines. More... | |
| const size_t | stateN () const |
| Get the number of state variables required by this instance. More... | |
| const size_t | stateDims () const |
| Get the dimension of the state variable. More... | |
| std::vector< uint64_t > | Serialize (void) |
| Produce the packed data to be saved. More... | |
| uint64_t * | Deserialize (const uint64_t *data) |
| Unpack the data to restore the Serialized information. More... | |
| void | saveVTK (const char *filename) |
| Save the point on a VTK (.vtp) file. More... | |
| const leanvtk::VTPWriter * | getVTK () const |
| Get the VTK writer. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from moordyn::io::IO | |
| ofstream | MakeFile (const std::string filepath) const |
| Create an output file and write the MoorDyn magic header. More... | |
| std::tuple< uint64_t, uint64_t * > | LoadFile (const std::string filepath) const |
| Open an input file and load the data. More... | |
| uint64_t | Serialize (const uint64_t &i) |
| Pack an unsigned integer to make it writable. More... | |
| uint64_t | Serialize (const int64_t &i) |
| Pack an integer to make it writable. More... | |
| uint64_t | Serialize (const real &f) |
| Pack a float to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const vec &m) |
| Pack a 3D vector to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const vec6 &m) |
| Pack a 6D vector to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const mat &m) |
| Pack a 3x3 matrix to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const mat6 &m) |
| Pack a 6x6 matrix to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const quaternion &m) |
| Pack a quaternion to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const XYZQuat &m) |
| Pack an XYZQuat to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const std::vector< real > &l) |
| Pack a list of floating point numbers to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const std::vector< vec > &l) |
| Pack a list of 3D vectors to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const std::vector< vec6 > &l) |
| Pack a list of 6D vectors to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const std::vector< mat > &l) |
| Pack a list of 3x3 matrices to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const std::vector< mat6 > &l) |
| Pack a list of 6x6 matrices to make it writable. More... | |
| std::vector< uint64_t > | Serialize (const Eigen::Matrix< real, Eigen::Dynamic, Eigen::Dynamic > &l) |
| Pack an arbitrarily large matrix. More... | |
| template<typename T > | |
| std::vector< uint64_t > | Serialize (const std::vector< std::vector< T >> &l) |
| Pack a list of lists to make it writable This function might act recursively. More... | |
| uint64_t * | Deserialize (const uint64_t *in, uint64_t &out) |
| Unpack a loaded unsigned integer. More... | |
| uint64_t * | Deserialize (const uint64_t *in, int64_t &out) |
| Unpack a loaded integer. More... | |
| uint64_t * | Deserialize (const uint64_t *in, real &out) |
| Unpack a loaded floating point number. More... | |
| uint64_t * | Deserialize (const uint64_t *in, vec &out) |
| Unpack a loaded 3D vector. More... | |
| uint64_t * | Deserialize (const uint64_t *in, vec6 &out) |
| Unpack a loaded 6D vector. More... | |
| uint64_t * | Deserialize (const uint64_t *in, mat &out) |
| Unpack a loaded 3x3 matrix. More... | |
| uint64_t * | Deserialize (const uint64_t *in, mat6 &out) |
| Unpack a loaded 6x6 matrix. More... | |
| uint64_t * | Deserialize (const uint64_t *in, quaternion &out) |
| Unpack a loaded quaternion. More... | |
| uint64_t * | Deserialize (const uint64_t *in, XYZQuat &out) |
| Unpack a loaded XYZQuat. More... | |
| uint64_t * | Deserialize (const uint64_t *in, std::vector< real > &out) |
| Unpack a loaded list of floating point numbers. More... | |
| uint64_t * | Deserialize (const uint64_t *in, std::vector< vec > &out) |
| Unpack a loaded list of 3D vectors. More... | |
| uint64_t * | Deserialize (const uint64_t *in, std::vector< vec6 > &out) |
| Unpack a loaded list of 6D vectors. More... | |
| uint64_t * | Deserialize (const uint64_t *in, std::vector< mat > &out) |
| Unpack a loaded list of 3x3 matrices. More... | |
| uint64_t * | Deserialize (const uint64_t *in, std::vector< mat6 > &out) |
| Unpack a loaded list of 6x6 matrices. More... | |
| uint64_t * | Deserialize (const uint64_t *in, Eigen::Matrix< real, Eigen::Dynamic, Eigen::Dynamic > &out) |
| Unpack an arbitrarily large matrix. More... | |
| template<typename T > | |
| uint64_t * | Deserialize (const uint64_t *in, std::vector< std::vector< T >> &out) |
| Unpack a loaded list of lists. More... | |
Protected Attributes inherited from moordyn::LogUser | |
| Log * | _log |
| The log handler. | |
A point for a line endpoint.
Each line must have 2 points at each endpoint, which are used to define how those points are moving. There are 3 basic types of points:
Types of points.
| Enumerator | |
|---|---|
| COUPLED | Is coupled, i.e. is controlled by the user. |
| FREE | Is free to move, controlled by MoorDyn. |
| FIXED | Is fixed, either to a location or to another moving entity. |
| moordyn::Point::Point | ( | moordyn::Log * | log, |
| size_t | id | ||
| ) |
Constructor.
| log | Logging handler |
| id | Unique identifier of this instance |
| void moordyn::Point::addLine | ( | moordyn::Line * | theLine, |
| EndPoints | end_point | ||
| ) |
Attach a line endpoint to this point.
| theLine | The line to be attached |
| end_point | The line endpoint |

|
virtual |
Unpack the data to restore the Serialized information.
This is the inverse of Serialize(void)
| data | The packed data |
Implements moordyn::io::IO.

| moordyn::error_id moordyn::Point::doRHS | ( | ) |
Calculates the forces and mass on the point, including from attached lines.

|
inline |
Get the force on the point.
|
inline |
Get the force on the point.
| Fnet_out | The output force [x,y,z] |
|
inline |
Get the list of attachments.
|
inline |
Get the mass matrix.
|
inline |
Get the mass matrix.
| M_out | The output mass matrix |
| void moordyn::Point::getNetForceAndMass | ( | vec6 & | Fnet_out, |
| mat6 & | M_out, | ||
| vec | rBody = vec::Zero(), |
||
| vec6 | vBody = vec6::Zero() |
||
| ) |
Calculate the force and mass contributions of the point on the parent body.
| Fnet_out | Output Force about body ref point |
| M_out | Output Mass matrix about body ref point |
| rBody | The body position |
| vBody | The body velocity |

| real moordyn::Point::GetPointOutput | ( | OutChanProps | outChan | ) |
Get the output.
| outChan | The query |
|
inline |
Get the point position.
Get the point state.
Get the point state.
| r_out | The output position [x,y,z] |
| rd_out | The output velocity [x,y,z] |
|
virtual |
Calculate the forces and state derivatives of the point.
| drdt | The states derivatives, i.e. the velocity and the acceleration |
| moordyn::invalid_value_error | If it is not a FREE point |
Implements moordyn::Instance.

|
inline |
Get the point velocity.
|
inline |
Get the VTK writer.
This function is useful for writing multiblock .vtm files
Initialize the FREE point state.
| r | The output state variable |
| moordyn::invalid_value_error | If it is not a FREE point |
|
inlinevirtual |
Initialize a free instance.
| r | The output state variable |
| moordyn::invalid_value_error | If the instance does not have free states. e.g. a coupled body controlled from outside |
Implements moordyn::Instance.
Initialize the time step integration.
Called at the beginning of each coupling step to update the boundary conditions (fairlead kinematics) for the proceeding line time steps
| rFairIn | Fairlead position |
| rdFairIn | Fairlead velocity |
| moordyn::invalid_value_error | If it is not a COUPLED point |

Detach a line.
| line | The line |
| moordyn::invalid_value_error | If there is no an attached line with the provided lineID |
| void moordyn::Point::saveVTK | ( | const char * | filename | ) |
Save the point on a VTK (.vtp) file.
| filename | The output file name |
| output_file_error | If the file cannot be saved |
|
inline |
Multiply the drag by a factor.
function for boosting drag coefficients during IC generation
| scaler | Drag factor |
|
virtual |
Produce the packed data to be saved.
The produced data can be used afterwards to restore the saved information afterwards calling Deserialize(void).
Thus, this function is not processing the information that is extracted from the definition file
Implements moordyn::io::IO.

Take the kinematics from the fairlead information.
sets Point states and ends of attached lines ONLY if this Point is attached to a body, i.e. type = FIXED (otherwise shouldn't be called)
| r_in | Position |
| rd_in | Velocity |
| moordyn::invalid_value_error | If it is not a FIXED point |

|
inlinevirtual |
Set the point state.
sets Pointstate and ends of attached lines ONLY if this Point is free, i.e. type = FREE (otherwise shouldn't be called)
| r | The point state instance |
| moordyn::invalid_value_error | If it is not a FREE point |
Implements moordyn::Instance.
Set the state variables.
sets Point position and velocity and ends of attached lines ONLY if this Point is free, i.e. type = FREE (otherwise shouldn't be called)
| pos | Position |
| vel | Velocity |
| moordyn::invalid_value_error | If it is not a FREE point |

|
inline |
Set the line simulation time.
| time | Simulation time |
| void moordyn::Point::setup | ( | int | number_in, |
| types | type_in, | ||
| vec | r0_in, | ||
| double | M_in, | ||
| double | V_in, | ||
| vec | F_in, | ||
| double | CdA_in, | ||
| double | Ca_in, | ||
| EnvCondRef | env_in | ||
| ) |
Setup the point.
Always call this function after the constructor
| number_in | The point identifier. The identifiers starts at 1, not at 0. |
| type_in | One of COUPLED, FREE or FIXED |
| r0_in | The initial position |
| M_in | The mass |
| V_in | The volume |
| F_in | The initial force on the node |
| CdA_in | Product of drag coefficient and projected area |
| Ca_in | Added mass coefficient used along with V to calculate added mass on node |
| env_in | Global struct that holds environmental settings |


|
inline |
|
inlinevirtual |
Get the dimension of the state variable.
Reimplemented from moordyn::Instance.
|
inlinevirtual |
Get the number of state variables required by this instance.
Reimplemented from moordyn::Instance.
|
inlinestatic |
Return a string with the name of a type.
This tool is useful mainly for debugging

| void moordyn::Point::updateFairlead | ( | real | time | ) |
Take the kinematics from the fairlead information.
Sets Point states and ends of attached lines ONLY if this Point is driven externally, i.e. type = COUPLED (otherwise shouldn't be called)
| time | Local time within the time step (from 0 to dt) |
| moordyn::invalid_value_error | If it is not a COUPLED point |
