MoorDyn
Line.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022, Matt Hall
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  *
14  * 3. Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 
35 #pragma once
36 
37 #include "Misc.hpp"
38 #include "Instance.hpp"
39 #include "Seafloor.hpp"
40 #include "Util/CFL.hpp"
41 #include "leanvtk/leanvtk.hpp"
42 #include <utility>
43 
44 using namespace std;
45 
46 namespace moordyn {
47 
48 class Waves;
49 typedef std::shared_ptr<Waves> WavesRef;
50 
68 class DECLDIR Line final
69  : public Instance
70  , public NatFreqCFL
71 {
72  public:
77  Line(moordyn::Log* log, size_t lineId);
78 
81  ~Line();
82 
83  private:
85  typedef enum
86  {
88  ELASTIC_CONSTANT = 1,
90  ELASTIC_VISCO_CTE = 2,
92  ELASTIC_VISCO_MEAN = 3,
94  ELASTIC_SYROPE = 4,
95  } elastic_model;
96 
98  typedef enum
99  {
101  SYROPE_LINEAR_WC = 1,
103  SYROPE_QUADRATIC_WC = 2,
105  SYROPE_EXP_WC = 3,
106  } syrope_wc_formula;
107 
113  real getNonlinearEA(real l_stretched, real l_unstretched) const;
114 
119  real getNonlinearBA(real ld_stretched, real l_unstretched) const;
120 
124  real getNonlinearEI(real curv) const;
125 
133  inline real getWaterDepth(real x, real y)
134  {
135  return seafloor ? seafloor->getDepthAt(x, y) : -env->WtrDpth;
136  }
137 
141  inline real avgWaterDepth()
142  {
143  return seafloor ? seafloor->getAverageDepth() : -env->WtrDpth;
144  }
145 
149  inline void setWorkingCurve(real Tmax);
150 
151  // ENVIRONMENTAL STUFF
153  EnvCondRef env;
155  moordyn::WavesRef waves;
157  moordyn::SeafloorRef seafloor;
158 
160  unsigned int N;
162  moordyn::real UnstrLen;
164  moordyn::real UnstrLen0;
166  moordyn::real UnstrLend;
168  moordyn::real d;
170  moordyn::real rho;
172  elastic_model ElasticMod;
174  moordyn::real EA;
177  moordyn::real EA_D;
180  moordyn::real alphaMBL;
183  moordyn::real vbeta;
188  moordyn::real EA_2;
190  std::vector<moordyn::real> dl_1;
192  std::vector<moordyn::real> ld_1;
194  moordyn::real EI;
203  moordyn::real BA;
206  moordyn::real BA_D;
209  moordyn::real Can;
212  moordyn::real Cat;
215  moordyn::real Cdn;
218  moordyn::real Cdt;
221  moordyn::real Cl;
224  moordyn::real dF;
227  moordyn::real cF;
228 
230  moordyn::real BAin;
232  moordyn::real A;
234  unsigned int nEApoints;
236  std::vector<moordyn::real> stiffXs;
238  std::vector<moordyn::real> stiffYs;
241  std::vector<moordyn::real> stiffZs;
243  unsigned int nEIpoints;
245  std::vector<moordyn::real> bstiffXs;
247  std::vector<moordyn::real> bstiffYs;
249  unsigned int nBApoints;
251  std::vector<moordyn::real> dampXs;
253  std::vector<moordyn::real> dampYs;
254 
256  std::vector<moordyn::real> stiffxs_;
258  std::vector<moordyn::real> stiffys_;
260  std::vector<moordyn::real> stiffzs_;
261 
262  // Externally provided data
267  bool isPb;
269  std::vector<moordyn::real> pin;
270 
271  // kinematics
273  std::vector<vec> r;
275  std::vector<vec> rd;
277  std::vector<vec> q;
279  std::vector<vec> pvec;
281  std::vector<vec> qs;
283  std::vector<moordyn::real> l;
285  std::vector<moordyn::real> lstr;
287  std::vector<moordyn::real> ldstr;
289  std::vector<moordyn::real> Kurv;
290 
292  std::vector<mat> M;
293  // line segment volumes
294  std::vector<moordyn::real> V;
295 
296  // Syrope variables
298  syrope_wc_formula syropeWCForm;
300  moordyn::real k1;
302  moordyn::real k2;
304  std::vector<moordyn::real> Tmax;
306  std::vector<moordyn::real> Tmean;
308  const unsigned int nEApointsWC = 30;
309 
310  // forces
312  std::vector<vec> T;
314  std::vector<vec> Td;
316  std::vector<vec> Bs;
318  std::vector<vec> Pb;
320  std::vector<vec> W;
322  std::vector<vec> Dp;
324  std::vector<vec> Dq;
326  std::vector<vec> Ap;
328  std::vector<vec> Aq;
330  std::vector<vec> B;
332  std::vector<vec> Lf;
334  std::vector<vec> Fnet;
335 
336  // wave things
338  std::vector<moordyn::real> F;
339 
340  // time
342  moordyn::real t;
344  moordyn::real dtm0;
345 
346  // VIV stuff
347  // /// VIV amplitude updated every zero crossing of crossflow velcoity
348  // std::vector<moordyn::real> Amp;
350  const unsigned int n_m = 500;
352  real phi_yd;
354  std::vector<moordyn::real> phi;
356  std::vector<moordyn::real> phi_dot;
357 
358  // back indexing one dtm for VIV
360  moordyn::real t_old = 0.0;
361  // /// running amplitude total, from previous zero crossing of yd
362  // std::vector<moordyn::real> A_int_old;
364  std::vector<moordyn::real> yd_rms_old;
366  std::vector<moordyn::real> ydd_rms_old;
368  std::vector<vec> rdd_old;
369 
370  // end conditions
373  typedef enum
374  {
376  PINNED = 0,
378  CANTILEVERED = 1,
379  // Some aliases
380  POINT = PINNED,
381  ROD = CANTILEVERED,
382  } endTypes;
383 
386  endTypes endTypeA;
389  endTypes endTypeB;
391  vec endMomentA;
393  vec endMomentB;
394 
395  // file stuff
397  ofstream* outfile;
399  string channels;
400 
406  std::vector<std::vector<moordyn::real>> zetaTS;
408  std::vector<std::vector<moordyn::real>> FTS;
410  std::vector<std::vector<vec>> UTS;
412  std::vector<std::vector<vec>> UdTS;
414  unsigned int ntWater;
416  moordyn::real dtWater;
417 
422  public:
424  int number;
427  size_t lineId;
428 
430  bool IC_gen = false;
431 
442  void setup(int number,
443  LineProps* props,
444  real l,
445  unsigned int n,
446  EnvCondRef env_in,
447  shared_ptr<ofstream> outfile,
448  string channels,
449  real dtM0);
450 
456  inline void setWaves(moordyn::WavesRef waves_in,
457  moordyn::SeafloorRef seafloor_in)
458  {
459  waves = waves_in;
460  seafloor = seafloor_in;
461  }
462 
471  void initialize();
472 
478  inline void initialize(InstanceStateVarView state)
479  {
480  // ------ Initialize the line ------
481  initialize();
482 
483  // ------ Assign the intialized values to the state (bascially
484  // Line::setState but flipped) ------ Error check for number of columns
485  // (if VIV and Visco need row.size() = 8, if VIV xor Visco need
486  // row.size() = 7, if not VIV need row.size() = 6)
487  if ((state.row(0).size() != 8 && Cl > 0 && ElasticMod != ELASTIC_CONSTANT) ||
488  (state.row(0).size() != 7 && ((Cl > 0) ^ (ElasticMod != ELASTIC_CONSTANT))) ||
489  (state.row(0).size() != 6 && Cl == 0 && ElasticMod == ELASTIC_CONSTANT)) {
490  LOGERR << "Invalid state.row size for Line " << number << endl;
491  throw moordyn::mem_error("Invalid state.row size");
492  }
493 
494  // Error check for number of rows (if visco need N rows, if normal need
495  // N-1 rows)
496  if ((state.rows() != N && ElasticMod != ELASTIC_CONSTANT) ||
497  (state.rows() != N - 1 && ElasticMod == ELASTIC_CONSTANT)) {
498  LOGERR << "Invalid number of rows in state matrix for Line "
499  << number << endl;
500  throw moordyn::mem_error("Invalid number of rows in state matrix");
501  }
502 
503  // If using the viscoelastic model, iterate N rows, else iterate N-1
504  // rows.
505  for (unsigned int i = 0; i < (ElasticMod != ELASTIC_CONSTANT ? N : N - 1); i++) {
506  // node number is i+1
507  // segment number is i
508  state.row(i).head<3>() = r[i + 1];
509  state.row(i).segment<3>(3) = rd[i + 1];
510 
511  if (ElasticMod != ELASTIC_CONSTANT)
512  state.row(i).tail<1>()[0] =
513  dl_1[i]; // [0] needed becasue tail<1> returns a one element
514  // vector. Viscoelastic state is always the last
515  // element in the row
516 
517  if (Cl > 0) {
518  if (ElasticMod != ELASTIC_CONSTANT)
519  state.row(i).tail<2>()[0] =
520  phi[i + 1]; // if both VIV and viscoelastic second to
521  // last element in the row
522  else
523  state.row(i).tail<1>()[0] =
524  phi[i + 1]; // else last element in the row
525  }
526  }
527  }
535  inline void setInitialTmax(moordyn::real Tmax0) { Tmax.assign(N, Tmax0); }
536 
540  inline void setInitialTmean(moordyn::real Tmean0)
541  {
542  Tmean.assign(N, Tmean0);
543  }
544 
548  inline elastic_model getElasticModel() const { return ElasticMod; }
549 
555  inline unsigned int getN() const { return N; }
556 
560  inline moordyn::real getUnstretchedLength() const { return UnstrLen; }
561 
571  inline void setUnstretchedLength(const moordyn::real len)
572  {
573  UnstrLen = len;
574  for (unsigned int i = 0; i < N; i++) {
575  l[i] = UnstrLen / double(N);
576  V[i] = l[i] * A;
577  }
578  }
579 
585  {
586  UnstrLend = v;
587  }
588 
597  inline void updateUnstretchedLength(const moordyn::real dt = 0.0)
598  {
599  if (!UnstrLend)
600  return;
601  if (!dt) {
602  UnstrLen0 = UnstrLen;
603  return;
604  }
605  setUnstretchedLength(UnstrLen0 + dt * UnstrLend);
606  }
607 
613  inline bool isConstantEA() const { return nEApoints > 0; }
614 
621  inline moordyn::real getConstantEA() const { return EA; }
622 
629  inline void setConstantEA(moordyn::real EA_in)
630  {
631  if (ElasticMod != ELASTIC_CONSTANT) {
632  LOGERR << "Cannot set constant EA for viscoelastic model" << endl;
633  throw moordyn::invalid_value_error(
634  "Cannot set constant EA for viscoelastic model");
635  } else {
636  EA = EA_in;
637  }
638  }
639 
646  inline const vec& getNodePos(unsigned int i) const
647  {
648  if (i > N) {
649  LOGERR << "Asking node " << i << " of line " << number
650  << ", which only has " << N + 1 << " nodes" << std::endl;
651  throw moordyn::invalid_value_error("Invalid node index");
652  }
653  if (isnan(r[i].sum())) {
654  stringstream s;
655  s << "NaN detected" << endl
656  << "Line " << number << " node positions:" << endl;
657  for (unsigned int j = 0; j <= N; j++)
658  s << j << " : " << r[j] << ";" << endl;
659  throw moordyn::nan_error(s.str().c_str());
660  }
661  return r[i];
662  }
663 
670  inline const vec& getNodeVel(unsigned int i) const
671  {
672  if (i > N) {
673  LOGERR << "Asking node " << i << " of line " << number
674  << ", which only has " << N + 1 << " nodes" << std::endl;
675  throw moordyn::invalid_value_error("Invalid node index");
676  }
677  if (isnan(rd[i].sum())) {
678  stringstream s;
679  s << "NaN detected" << endl
680  << "Line " << number << " node velocities:" << endl;
681  for (unsigned int j = 0; j <= N; j++)
682  s << j << " : " << rd[j] << ";" << endl;
683  throw moordyn::nan_error(s.str().c_str());
684  }
685  return rd[i];
686  }
687 
704  inline const vec& getNodeForce(unsigned int i) const
705  {
706  if (i > N) {
707  LOGERR << "Asking node " << i << " of line " << number
708  << ", which only has " << N + 1 << " nodes" << std::endl;
709  throw moordyn::invalid_value_error("Invalid node index");
710  }
711  return Fnet[i];
712  };
713 
726  inline const vec getNodeTen(unsigned int i) const
727  {
728  if (i > N) {
729  LOGERR << "Asking node " << i << " of line " << number
730  << ", which only has " << N + 1 << " nodes" << std::endl;
731  throw moordyn::invalid_value_error("Invalid node index");
732  }
733  if (i == 0) // bottom node, return ten and damping of bottom section
734  return T[0] + Td[0];
735  else if (i == N) // top node, return ten and damping of top section
736  return T[N - 1] + Td[N - 1];
737  // internal node, take average of tension in adjacent segments.
738  return (0.5 * (T[i] + T[i - 1] + Td[i] + Td[i - 1]));
739  };
740 
751  inline const vec& getNodeBendStiff(unsigned int i) const
752  {
753  if (i > N) {
754  LOGERR << "Asking node " << i << " of line " << number
755  << ", which only has " << N + 1 << " nodes" << std::endl;
756  throw moordyn::invalid_value_error("Invalid node index");
757  }
758  return Bs[i];
759  };
760 
767  inline const vec& getNodeWeight(unsigned int i) const
768  {
769  if (i > N) {
770  LOGERR << "Asking node " << i << " of line " << number
771  << ", which only has " << N + 1 << " nodes" << std::endl;
772  throw moordyn::invalid_value_error("Invalid node index");
773  }
774  return W[i];
775  };
776 
783  inline const vec getNodeDrag(unsigned int i) const
784  {
785  if (i > N) {
786  LOGERR << "Asking node " << i << " of line " << number
787  << ", which only has " << N + 1 << " nodes" << std::endl;
788  throw moordyn::invalid_value_error("Invalid node index");
789  }
790  return Dp[i] + Dq[i];
791  };
792 
799  inline const vec getNodeFroudeKrilov(unsigned int i) const
800  {
801  if (i > N) {
802  LOGERR << "Asking node " << i << " of line " << number
803  << ", which only has " << N + 1 << " nodes" << std::endl;
804  throw moordyn::invalid_value_error("Invalid node index");
805  }
806  return Ap[i] + Aq[i];
807  };
808 
817  inline const vec getNodeSeabedForce(unsigned int i) const
818  {
819  if (i > N) {
820  LOGERR << "Asking node " << i << " of line " << number
821  << ", which only has " << N + 1 << " nodes" << std::endl;
822  throw moordyn::invalid_value_error("Invalid node index");
823  }
824  return B[i] + Bs[i];
825  };
826 
836  inline const real& getNodeCurv(unsigned int i) const
837  {
838  if (i > N) {
839  LOGERR << "Asking node " << i << " of line " << number
840  << ", which only has " << N + 1 << " nodes" << std::endl;
841  throw moordyn::invalid_value_error("Invalid node index");
842  }
843  return Kurv[i];
844  }
845 
852  inline const mat& getNodeM(unsigned int i) const
853  {
854  if (i > N) {
855  LOGERR << "Asking node " << i << " of line " << number
856  << ", which only has " << N + 1 << " nodes" << std::endl;
857  throw moordyn::invalid_value_error("Invalid node index");
858  }
859  return M[i];
860  }
861 
865  inline std::vector<vec> getNodeCoordinates() const { return r; }
866 
874  inline void getFASTtens(float* FairHTen,
875  float* FairVTen,
876  float* AnchHTen,
877  float* AnchVTen) const
878  {
879  *FairHTen = (float)(Fnet[N](Eigen::seqN(0, 2)).norm());
880  *FairVTen = (float)(Fnet[N][2] + M[N](0, 0) * (-env->g));
881  *AnchHTen = (float)(Fnet[0](Eigen::seqN(0, 2)).norm());
882  *AnchVTen = (float)(Fnet[0][2] + M[0](0, 0) * (-env->g));
883  }
884 
893  inline void getEndStuff(vec& Fnet_out,
894  vec& Moment_out,
895  mat& M_out,
896  EndPoints end_point) const
897  {
898  switch (end_point) {
899  case ENDPOINT_TOP:
900  Fnet_out = Fnet[N];
901  Moment_out = endMomentB;
902  M_out = M[N];
903  break;
904  case ENDPOINT_BOTTOM:
905  Fnet_out = Fnet[0];
906  Moment_out = endMomentA;
907  M_out = M[0];
908  break;
909  default:
910  LOGERR << "Invalid end point qualifier: " << end_point << endl;
911  throw moordyn::invalid_value_error("Invalid end point");
912  }
913  }
914 
921  real GetLineOutput(OutChanProps outChan);
922 
939  void storeWaterKin(real dt,
940  std::vector<std::vector<moordyn::real>> zeta,
941  std::vector<std::vector<moordyn::real>> f,
942  std::vector<std::vector<vec>> u,
943  std::vector<std::vector<vec>> ud);
944 
955  real calcSubSeg(unsigned int firstNodeIdx,
956  unsigned int secondNodeIdx,
957  real surfaceHeight);
958 
962  inline std::pair<real, real> getDrag() const { return make_pair(Cdn, Cdt); }
963 
968  inline void setDrag(real cdn, real cdt)
969  {
970  Cdn = cdn;
971  Cdt = cdt;
972  }
973 
977  inline void scaleDrag(real scaler)
978  {
979  Cdn = Cdn * scaler;
980  Cdt = Cdt * scaler;
981  }
982 
992  inline void enablePb() { isPb = true; }
993 
996  inline void disablePb() { isPb = false; }
997 
1001  inline bool enabledPb() const { return isPb; }
1002 
1012  void setPin(std::vector<real> p);
1013 
1017  inline void setTime(real time) { t = time; }
1018 
1026  void setState(const InstanceStateVarView r);
1027 
1035  void setEndKinematics(vec r, vec rd, EndPoints end_point);
1036 
1047  void setEndOrientation(vec q, EndPoints end_point, EndPoints rod_end_point);
1048 
1063  vec getEndSegmentMoment(EndPoints end_point, EndPoints rod_end_point) const;
1064 
1069  void getStateDeriv(InstanceStateVarView drdt);
1070 
1071  // void initiateStep(vector<double> &rFairIn, vector<double> &rdFairIn,
1072  // double time);
1073 
1074  void Output(real);
1075 
1082  inline const size_t stateN() const
1083  {
1084  if (ElasticMod != ELASTIC_CONSTANT)
1085  return getN(); // N rows for viscoelastic case
1086  else
1087  return getN() - 1; // N-1 rows for other cases
1088  }
1089 
1100  inline const size_t stateDims() const
1101  {
1102  if (Cl > 0 && ElasticMod != ELASTIC_CONSTANT)
1103  return 8; // 3 for position, 3 for velocity, 1 for VIV phase, 1 for
1104  // viscoelasticity
1105  else if ((Cl > 0) ^ (ElasticMod != ELASTIC_CONSTANT))
1106  return 7; // 3 for position, 3 for velocity, 1 for VIV phase or
1107  // viscoelasticity
1108  else
1109  return 6;
1110  }
1111 
1121  std::vector<uint64_t> Serialize(void);
1122 
1129  uint64_t* Deserialize(const uint64_t* data);
1130 
1135  void saveVTK(const char* filename);
1136 
1142  const leanvtk::VTPWriter* getVTK() const { return &vtk; }
1143 private:
1145  leanvtk::VTPWriter vtk;
1146 };
1147 
1148 } // ::moordyn
#define LOGERR
Log an error.
Definition: Log.hpp:69
#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
void setInitialTmax(moordyn::real Tmax0)
Set the initial Tmax values.
Definition: Line.hpp:535
const vec getNodeFroudeKrilov(unsigned int i) const
Get the Froude-Krilov force acting on the node.
Definition: Line.hpp:799
const vec & getNodeForce(unsigned int i) const
Get the net force on a node.
Definition: Line.hpp:704
bool isConstantEA() const
Get whether the line is governed by a non-linear stiffness or a constant one.
Definition: Line.hpp:613
bool enabledPb() const
Check if pressure bending forces are considered.
Definition: Line.hpp:1001
void setUnstretchedLengthVel(const moordyn::real v)
Set the unstretched length rate of change of the line.
Definition: Line.hpp:584
void enablePb()
Enable the pressure bending forces (disabled by default)
Definition: Line.hpp:992
std::vector< vec > getNodeCoordinates() const
Get the array of coordinates of all nodes along the line.
Definition: Line.hpp:865
void getEndStuff(vec &Fnet_out, vec &Moment_out, mat &M_out, EndPoints end_point) const
Get the force, moment and mass at the line endpoint.
Definition: Line.hpp:893
const leanvtk::VTPWriter * getVTK() const
Get the VTK writer.
Definition: Line.hpp:1142
void setInitialTmean(moordyn::real Tmean0)
Set the initial mean tension values.
Definition: Line.hpp:540
const vec & getNodeVel(unsigned int i) const
Get the velocity of a node.
Definition: Line.hpp:670
void scaleDrag(real scaler)
Scale the drag coefficients.
Definition: Line.hpp:977
const vec & getNodePos(unsigned int i) const
Get the position of a node.
Definition: Line.hpp:646
void setWaves(moordyn::WavesRef waves_in, moordyn::SeafloorRef seafloor_in)
Set the environmental data.
Definition: Line.hpp:456
const real & getNodeCurv(unsigned int i) const
Get the line curvature at a node position.
Definition: Line.hpp:836
const vec & getNodeWeight(unsigned int i) const
Get the weight and bouyancy force acting on the node.
Definition: Line.hpp:767
size_t lineId
Definition: Line.hpp:427
std::pair< real, real > getDrag() const
Get the drag coefficients.
Definition: Line.hpp:962
const mat & getNodeM(unsigned int i) const
Get the mass and added mass matrix.
Definition: Line.hpp:852
void getFASTtens(float *FairHTen, float *FairVTen, float *AnchHTen, float *AnchVTen) const
Get the tensions at the fairlead and anchor in a FASTv7 friendly way.
Definition: Line.hpp:874
const vec & getNodeBendStiff(unsigned int i) const
Get the tension on a node, including the internal line damping.
Definition: Line.hpp:751
void setUnstretchedLength(const moordyn::real len)
Set the unstretched length of the line.
Definition: Line.hpp:571
moordyn::real getUnstretchedLength() const
Get the unstretched length of the line.
Definition: Line.hpp:560
void updateUnstretchedLength(const moordyn::real dt=0.0)
Update the unstretched length of the line, according to the velocity.
Definition: Line.hpp:597
void setTime(real time)
Set the line simulation time.
Definition: Line.hpp:1017
void setConstantEA(moordyn::real EA_in)
Set the constant stiffness of the line.
Definition: Line.hpp:629
void initialize(InstanceStateVarView state)
Sets the initial line state.
Definition: Line.hpp:478
const vec getNodeTen(unsigned int i) const
Get the tension on a node, including the internal line damping.
Definition: Line.hpp:726
const size_t stateN() const
Get the number of state variables required by this instance.
Definition: Line.hpp:1082
void disablePb()
Disable the pressure bending forces (disabled by default)
Definition: Line.hpp:996
int number
Line ID.
Definition: Line.hpp:424
unsigned int getN() const
Number of segments.
Definition: Line.hpp:555
const vec getNodeSeabedForce(unsigned int i) const
Get the sea bed reaction force acting on the node.
Definition: Line.hpp:817
void setDrag(real cdn, real cdt)
Set the drag coefficients.
Definition: Line.hpp:968
const size_t stateDims() const
Get the dimension of the state variable.
Definition: Line.hpp:1100
moordyn::real getConstantEA() const
Get the constant stiffness of the line.
Definition: Line.hpp:621
const vec getNodeDrag(unsigned int i) const
Get the drag force acting on the node.
Definition: Line.hpp:783
elastic_model getElasticModel() const
Get the elastic model used by the line.
Definition: Line.hpp:548
A Logging utility.
Definition: Log.hpp:149
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
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:1146
Definition: Misc.hpp:1292