40 #include "Util/CFL.hpp"
41 #include "leanvtk/leanvtk.hpp"
50 typedef std::shared_ptr<Waves>
WavesRef;
99 std::vector<attachment> attached;
214 void setup(
int number_in,
241 inline std::vector<attachment>
getLines()
const {
return attached; }
248 std::pair<vec, vec> initialize();
252 const auto [pos, vel] = initialize();
253 r.row(0).head<3>() = pos;
254 r.row(0).tail<3>() = vel;
283 inline std::pair<vec, vec>
getState() {
return std::make_pair(r, rd); }
288 inline void getFnet(
vec& Fnet_out)
const { Fnet_out = Fnet; }
298 inline void getM(
mat& M_out)
const { M_out = M; }
319 seafloor = seafloor_in;
337 void initiateStep(
vec rFairIn,
vec rdFairIn);
346 void updateFairlead(
real time);
356 void setKinematics(
vec r_in,
vec rd_in);
367 void setState(
vec pos,
vec vel);
379 setState(r.row(0).head<3>(),
399 void getNetForceAndMass(
vec6& Fnet_out,
401 vec rBody = vec::Zero(),
402 vec6 vBody = vec6::Zero());
414 inline const size_t stateN()
const {
return 1; }
432 std::vector<uint64_t> Serialize(
void);
440 uint64_t* Deserialize(
const uint64_t* data);
446 void saveVTK(
const char* filename);
453 const leanvtk::VTPWriter*
getVTK()
const {
return &vtk; }
457 leanvtk::VTPWriter vtk;
464 inline vec getCentripetalForce(
vec r,
vec w)
const
466 return -M * (w.cross(w.cross(this->r - r)));
#define DECLDIR
Prefix to export C functions on the compiled library.
Definition: MoorDynAPI.h:68
A generic instance.
Definition: Instance.hpp:55
A mooring line.
Definition: Line.hpp:71
A Logging utility.
Definition: Log.hpp:149
A point for a line endpoint.
Definition: Point.hpp:69
void initialize(InstanceStateVarView r)
Initialize a free instance.
Definition: Point.hpp:250
static string TypeName(types t)
Return a string with the name of a type.
Definition: Point.hpp:173
void setTime(real time)
Set the line simulation time.
Definition: Point.hpp:197
size_t pointId
Point ID.
Definition: Point.hpp:187
const size_t stateDims() const
Get the dimension of the state variable.
Definition: Point.hpp:421
const vec & getVelocity() const
Get the point velocity.
Definition: Point.hpp:268
const mat & getM() const
Get the mass matrix.
Definition: Point.hpp:303
void getFnet(vec &Fnet_out) const
Get the force on the point.
Definition: Point.hpp:288
const vec & getPosition() const
Get the point position.
Definition: Point.hpp:263
std::vector< attachment > getLines() const
Get the list of attachments.
Definition: Point.hpp:241
const vec & getFnet() const
Get the force on the point.
Definition: Point.hpp:293
void setWaves(moordyn::WavesRef waves_in, moordyn::SeafloorRef seafloor_in)
Set the environmental data.
Definition: Point.hpp:315
void getState(vec &r_out, vec &rd_out)
Get the point state.
Definition: Point.hpp:274
int number
Point number.
Definition: Point.hpp:190
std::pair< vec, vec > getState()
Get the point state.
Definition: Point.hpp:283
void setState(const InstanceStateVarView r)
Set the point state.
Definition: Point.hpp:377
void scaleDrag(real scaler)
Multiply the drag by a factor.
Definition: Point.hpp:327
types
Types of points.
Definition: Point.hpp:155
const leanvtk::VTPWriter * getVTK() const
Get the VTK writer.
Definition: Point.hpp:453
const size_t stateN() const
Get the number of state variables required by this instance.
Definition: Point.hpp:414
void getM(mat &M_out) const
Get the mass matrix.
Definition: Point.hpp:298
types type
Point type.
Definition: Point.hpp:192
int error_id
Error identifier.
Definition: Misc.hpp:594
MoorDyn2 C++ API namespace.
Definition: Body.cpp:27
vec3 vec
vec3 renaming
Definition: Misc.hpp:130
std::shared_ptr< Waves > WavesRef
Definition: Body.hpp:53
Eigen::Block< InstanceStateVar, Eigen::Dynamic > InstanceStateVarView
View of the State variables for a particular instance.
Definition: Misc.hpp:167
Eigen::Vector6d vec6
6-D vector of real numbers
Definition: Misc.hpp:126
Eigen::Matrix6d mat6
6x6 matrix of real numbers
Definition: Misc.hpp:138
EndPoints
End point qualifiers.
Definition: Misc.hpp:570
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
mat3 mat
mat3 renaming
Definition: Misc.hpp:142
Definition: Misc.hpp:1292
Attached lines to the point.
Definition: Point.hpp:83
EndPoints end_point
The attachment end point.
Definition: Point.hpp:87
Line * line
The attached line.
Definition: Point.hpp:85