Marine systems simulation
PotentialShip.h
1#ifndef _CPOTENTIALSHIP_H_
2#define _CPOTENTIALSHIP_H_
3/*
4#include <complex>
5#include <string>
6#include <map>
7
8#include <Eigen/Eigen>
9
10#include "PotentialData/PotentialData.h"
11#include "PotentialData/Wave/FroudeKrylov.h"
12#include "PotentialData//Wave/WaveDrift.h"
13#include "HullData.h"
14
15
16class PotentialShip
17{
18public:
19 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
20
21 enum EFileType
22 {
23 FILE_TYPE_VERES,
24 FILE_TYPE_WAMIT
25 };
26
27 PotentialShip ();
28 ~PotentialShip ();
29
30protected:
31
32 struct CompanionSystem
33 {
34 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
35
36 // Ainf
37 Eigen::Matrix<double, 6, 6> Ainf;
38
39 double Speed;
40
41 // companion system matrices
42 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> A[6][6];
43 Eigen::Matrix<double, Eigen::Dynamic, 1 > B[6][6];
44 Eigen::Matrix<double, 1 , Eigen::Dynamic> C[6][6];
45 Eigen::Matrix<double, Eigen::Dynamic, 1 > D[6][6];
46 };
47
48 Eigen::Matrix<double,1,Eigen::Dynamic> PotentialSpeed;
49 struct CompanionSystem* PotentialForces;
50
51
52 void SetupFromFile ( std::string fname, EFileType type, HullData *Hull);
53
54 bool IdentificationFromCache ();
55 void IdentificaitonToCache ();
56
57 bool IdentificationFromCache2 ();
58 void IdentificaitonToCache2 ();
59
60
61 void SetWaveHeight ( std::vector<double> & Height);
62 void SetWaveFreq ( std::vector<double> & Freq);
63 void SetWavePhase ( std::vector<double> & Phase);
64 void SetWaveDirection ( std::vector<double> & Direction);
65
66
67 void GetFruodeKrylovForce ( double Speed, double Heading, double T, double N, double E, Eigen::Matrix<double, 6,1> &F);
68 void GetAdditionalWaveForce ( double Speed, double Heading, double T, double N, double E, Eigen::Matrix<double, 6,1> &F);
69
70
71 double ShipRotation[3];
72
73 double ShipSpeed;
74
75 PotentialData *PotentialData;
76 FroudeKrylovForce *FroudeKrylov;
77 WaveDriftForce *WaveDrift;
78
79 bool MassIsInitialized;
80 Eigen::Matrix<double,6,6> Mass;
81 Eigen::Matrix<double,6,6> Ainf;
82 Eigen::Matrix<double,6,6> MassAinf;
83
84 // companion system matrices
85 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> A[6][6];
86 Eigen::Matrix<double, Eigen::Dynamic, 1 > B[6][6];
87 Eigen::Matrix<double, 1 , Eigen::Dynamic> C[6][6];
88
89 std::vector<double> WaveHeight;
90 std::vector<double> WaveFreq;
91 std::vector<double> WavePhase;
92 std::vector<double> WaveDirection;
93 std::vector<double> WaveNumber;
94private:
95
96 HullData *Hull;
97
98 void ReadWaterLineData( std::string File);
99 void ReadPotentialCoefficients(std::string File);
100
101
102};
103*/
104#endif