Marine systems simulation
CRFShell.h
1
11
12#ifndef CRFShell_H
13#define CRFShell_H
14
16#include <string>
17#include <Eigen/Eigen>
18
19#include "SimObject.h"
20//#include <CIntegratorOptions.h>
21#include "CEnvironment.h"
22
23#ifdef FH_VISUALIZATION
24#include "sfh/ogre/C3DLine.h"
25#endif
26
27namespace membrane {
28
29/*
30typedef Eigen::Matrix<double,6,6> mat66;
31typedef Eigen::Matrix<double,6,1> vect6;
32typedef Eigen::Matrix<double,3,3> mat33;
33typedef Eigen::Matrix<double,3,6> mat36;
34typedef Eigen::Matrix<double,6,3> mat63;
35typedef Eigen::Matrix<double,3,1> vect3;
36*/
37
38class CRFShell : public SimObject
39{
40public:
41 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
42
43 CRFShell(std::string sSimObjectName, ISimObjectCreator* pCreator);
44 virtual void FinalSetup(const double dT, const double* const adX, ISimObjectCreator* const pCreator);
45 virtual ~CRFShell();
46
47#ifdef FH_VISUALIZATION
49 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
50
52 virtual void RenderUpdate(const double dT, const double* const adX);
53
55 void DrawBody(Ogre::SceneNode* renderNode, Ogre::SceneManager* sceneMgr);
56#endif
57
58 virtual void OdeFcn(const double dT, const double* const adX, double* const adXDot, const bool bIsMajorTimeStep);
59
60 virtual int HHTAlpha(const double dT, const double* const adX, const double TS, const double TI, const double Alpha, const int SubTS);
61 virtual void FEPlot(const double dT, const double* const adX);
62
63protected:
65 ISignalPort* m_pInForce_B;
67 int* m_TopConnectNode;
68 ISignalPort** m_TopInPos;
69 ISignalPort** m_TopInVel;
70 int m_BotConnectNum;
71 int* m_BotConnectNode;
72 ISignalPort** m_BotInForce;
73 ISignalPort* m_BotInForceM;
75
77 virtual const double* VolumeCL(const double dT, const double* const adX);
78 virtual const double* DragCOE(const double dT, const double* const adX);
79 virtual const double* StressMX(const double dT, const double* const adX);
80
81 double* m_TopOutForce;
82 virtual const double* TopOutForce(const double dT, const double* const adX, int iTop);
83 double* m_BotOutPos;
84 double* m_BotOutVel;
85 virtual const double* BotOutPos(const double dT, const double* const adX, int iBot);
86 virtual const double* BotOutVel(const double dT, const double* const adX, int iBot);
87 double m_BotOutPosM[3];
88 double m_BotOutVelM[3];
89 virtual const double* BotOutPosM(const double dT, const double* const adX);
90 virtual const double* BotOutVelM(const double dT, const double* const adX);
91
96
99
102 double m_MeshSize;
103
104 double m_Loc[3];
105 double m_Dim[4];
106 string m_Shape;
107 double m_Filling[2];
108 double m_dPress[10];
109 double m_rPress[2];
110
111 double m_AddM;
112 double* m_B2G;
113 double m_Damp[2];
114 double m_Drag;
115 double m_StrDamp[2];
116
117 double m_Thickness;
118 double m_Density;
119 double m_Youngs;
120 double m_Poissons;
121 double m_Yield;
122 double m_CArea;
123 double m_Volume[8];
124 double m_Mass;
125 double m_MStrain[6];
126 double m_MStress[9];
127
128 double m_Indt;
129
130 Eigen::Matrix<double,3,3> m_D;
131
133 int* m_TI;
134 int* m_TPI;
135 double* m_NodeM;
136 double* m_NodeMR;
137 double* m_NodeB;
138 double* m_NodeB2;
139 double* m_TC;
140 double* m_TPC;
141 double* m_TArea;
142 Eigen::Matrix<double,3,1>* m_N;
143 Eigen::Matrix<double,3,6>* m_B;
144 Eigen::Matrix<double,6,3>* m_Bt;
145 Eigen::Matrix<double,6,6>* m_K;
146 Eigen::Matrix<double,6,6>* m_PK;
147 Eigen::Matrix<double,3,1>* m_Strain;
148 Eigen::Matrix<double,3,1>* m_Stress;
149 double* m_VMS;
150 double* m_VMSB;
151 double* m_RAngle;
152 //Eigen::Matrix<double,6,6>* m_KA; /// Mass matrix of the triangles.
153 Eigen::Matrix<double,3,3>* m_RG2L;
154 Eigen::Matrix<double,3,3>* m_RL2G;
155 Eigen::Matrix<double,3,1>* m_OL;
156 Eigen::Matrix<double,3,3> m_PD;
157 Eigen::Matrix<double,3,6>* m_PB;
158 int m_IC;
159 int m_BC;
160
161 double m_BendR;
162 double m_VolR[3];
163 int m_ItM;
164 std::string m_OutFolder;
165
166 //CIntegratorOptions* m_Integrator; /// Pointer to the integration method
168 double m_RelTol;
169 //double m_TS; /// Integration time step.
170 //double m_PrevTime; ///< Previous time
171 struct time_info {
172 double step_size;
173 double previous_time = 0.0;
174 double current_time = 0.0;
175 double prev_plot_time = 0.0;
176 } m_time_info;
177 double m_Alpha;
178 double m_Beta;
179 double m_Gamma;
180 double* m_NodeP0;
181 double* m_NodeP;
182 double* m_NodeV0;
183 double* m_NodeV;
184 double* m_NodeA0;
185 double* m_NodeA;
186 double* m_NodeF0;
187 double* m_NodeF;
188 double* m_NodeD;
189 double m_TS_s;
190 double* m_NodeP_s;
191 double* m_NodeV_s;
192 double* m_NodeA_s;
193 double* m_NodeF_s;
195
196 double m_EOpenA;
197 double m_Omg[2];
198 double m_OmgDot;
199 double m_Vol;
200 double m_VolDot;
201
202 double m_NetEK[2];
203
205 Eigen::Matrix<double,6,1>* m_FiNlgeom;
206 Eigen::Matrix<double,6,1>* m_FoNlgeom;
207
208#ifdef FH_VISUALIZATION
209 string m_Material;
210 vector<Ogre::SceneNode*> m_RenderNodes;
211 Ogre::SceneManager* m_SceneMgr;
212 vector<Ogre::ManualObject*> m_Manual;
213
214 int m_RenderType;
215 C3DLine* m_3DLine;
216 double m_Color[4];
217 bool m_RenderStress;
218#endif
219
220};
221
222};
223#endif
Definition: CEnvironment.h:10
Definition: CRFShell.h:39
double m_Poissons
Elastic modulus of the membrane elements [N/m^2].
Definition: CRFShell.h:120
double * m_NodeB2
Node damping matrix.
Definition: CRFShell.h:138
double m_Yield
Poisson's ratio of the membrane elements [#].
Definition: CRFShell.h:121
int * m_TI
Boolean. True if bending stiffness is considered.
Definition: CRFShell.h:133
double * m_NodeB
Node mass matrix (relative).
Definition: CRFShell.h:137
double m_Damp[2]
Buoyancy-gravity [N].
Definition: CRFShell.h:113
Eigen::Matrix< double, 3, 1 > * m_Stress
Strain matrix of the triangles.
Definition: CRFShell.h:148
double m_MStrain[6]
Mass of the structure [kg].
Definition: CRFShell.h:125
double m_Youngs
Density of the membrane elements [kg/m^3].
Definition: CRFShell.h:119
double m_AddM
Restoring pressure.
Definition: CRFShell.h:111
double * m_NodeMR
Node mass matrix.
Definition: CRFShell.h:136
double m_VolR[3]
Bending restriction. minus: no; plus: restricted to m_BendR*m_Yield;.
Definition: CRFShell.h:162
int * m_TPI
Index of the triangle nodes in Node matrix.
Definition: CRFShell.h:134
double m_CArea
Yield strength of the membrane elements [N/m^2].
Definition: CRFShell.h:122
double * m_NodeA_s
Node velocity matrix (substep).
Definition: CRFShell.h:192
double * m_NodeV0
Node position matrix (i+1).
Definition: CRFShell.h:182
Eigen::Matrix< double, 3, 3 > m_D
Initial time step.
Definition: CRFShell.h:130
double * m_NodeA0
Node velocity matrix (i+1).
Definition: CRFShell.h:184
double * m_VMSB
von Mises stress of the triangles.
Definition: CRFShell.h:150
Eigen::Matrix< double, 3, 1 > * m_Strain
Bending stiffness matrix of the triangles.
Definition: CRFShell.h:147
double m_Vol
Time derivative of outflow vertical velocity.
Definition: CRFShell.h:199
double m_BendR
Boundary condition. 0: free or simply supported; 1: clamped.
Definition: CRFShell.h:161
bool m_Bending
Material matrix.
Definition: CRFShell.h:132
double * m_NodeF_s
Node acceleration matrix (substep).
Definition: CRFShell.h:193
double m_EOpenA
Plot time step.
Definition: CRFShell.h:196
int m_Iteration
Output folder.
Definition: CRFShell.h:167
Eigen::Matrix< double, 3, 6 > * m_PB
Material matrix (bending).
Definition: CRFShell.h:157
Eigen::Matrix< double, 6, 3 > * m_Bt
Shape matrix of the triangles.
Definition: CRFShell.h:144
double m_VolDot
Volume state.
Definition: CRFShell.h:200
Eigen::Matrix< double, 3, 1 > * m_OL
Rotation matrix of the triangles (original).
Definition: CRFShell.h:155
double m_Mass
Volume of a closed structure [m^3].
Definition: CRFShell.h:124
double m_Drag
Damping coefficient [#].
Definition: CRFShell.h:114
double * m_TC
Node damping matrix (quadratic).
Definition: CRFShell.h:139
double * m_NodeF0
Node acceleration matrix (i+1).
Definition: CRFShell.h:186
Eigen::Matrix< double, 6, 6 > * m_K
Transpose Shape matrix of the triangles.
Definition: CRFShell.h:145
virtual const double * VolumeCL(const double dT, const double *const adX)
Index of the bottom node.
double m_StrDamp[2]
Drag coefficient [#].
Definition: CRFShell.h:115
double * m_RAngle
von Mises stress of the triangles (bending).
Definition: CRFShell.h:151
double m_TS_s
Node incremental displacement matrix.
Definition: CRFShell.h:189
double m_Gamma
Beta parameter in the HHT-alpha time integration method.
Definition: CRFShell.h:179
Eigen::Matrix< double, 6, 1 > * m_FiNlgeom
Time step to update geometric nonlinearity.
Definition: CRFShell.h:205
double m_MStress[9]
Maximum and mean strain.
Definition: CRFShell.h:126
double * m_NodeP0
Gamma parameter in the HHT-alpha time integration method.
Definition: CRFShell.h:180
double * m_TArea
Initial local locations of the surrounding nodes (wl,wm,wn).
Definition: CRFShell.h:141
double m_NetEK[2]
Time derivative of volume state.
Definition: CRFShell.h:202
double m_Thickness
Structural damping coefficients [1/(rad/s)]. Frequency dependent.
Definition: CRFShell.h:117
double * m_TPC
Initial local locations of the triangle nodes.
Definition: CRFShell.h:140
Eigen::Matrix< double, 3, 1 > * m_N
Initial area of the element.
Definition: CRFShell.h:142
double * m_B2G
Added Mass coefficient [#].
Definition: CRFShell.h:112
double * m_NodeD
Node force matrix (i+1).
Definition: CRFShell.h:188
double m_OmgDot
Outflow vertical velocity.
Definition: CRFShell.h:198
double m_Omg[2]
Efficient openning area.
Definition: CRFShell.h:197
double * m_NodeF
Node force matrix (i).
Definition: CRFShell.h:187
int m_IStatePos
States.
Definition: CRFShell.h:93
double m_RelTol
Maximum number of iteration.
Definition: CRFShell.h:168
int m_TPlot
Node force matrix (substep).
Definition: CRFShell.h:194
int m_IC
Stress matrix of the triangles (bending).
Definition: CRFShell.h:158
int m_Triangles
Number of nodes [#].
Definition: CRFShell.h:101
double * m_NodeA
Node acceleration matrix (i).
Definition: CRFShell.h:185
int m_TNlgeom
Equivilent net stiffness.
Definition: CRFShell.h:204
int m_IStateVel
Index of the global position in the state vector.
Definition: CRFShell.h:94
Eigen::Matrix< double, 3, 3 > * m_RL2G
Rotation matrix of the triangles (original).
Definition: CRFShell.h:154
int m_BotNode
A pointer to the input force (bottom).
Definition: CRFShell.h:74
int m_BC
Initial condition. 0: no; 1: yes.
Definition: CRFShell.h:159
double m_Volume[8]
Cross area of a closed structure [m^2].
Definition: CRFShell.h:123
double m_Dim[4]
NED location [m].
Definition: CRFShell.h:105
std::string m_OutFolder
Maximum iterations.
Definition: CRFShell.h:164
Eigen::Matrix< double, 3, 6 > * m_B
Normal matrix of the triangles.
Definition: CRFShell.h:143
double m_Alpha
Integration time step.
Definition: CRFShell.h:177
Eigen::Matrix< double, 6, 6 > * m_PK
Membrane stiffness matrix of the triangles.
Definition: CRFShell.h:146
int m_Nodes
Pointer to DeepSeaGravityWaves -> CEnvironment.
Definition: CRFShell.h:100
CEnvironment * m_Environment
Index of the volume in the state vector.
Definition: CRFShell.h:98
ISignalPort * m_pInForce_B
Input ports.
Definition: CRFShell.h:65
double * m_VMS
Stress matrix of the triangles.
Definition: CRFShell.h:149
int m_ItM
Volume restriction. minus: no; plus: reduced iteration when m_Vol<m_VolR*m_Volume[0];.
Definition: CRFShell.h:163
double m_dPress[10]
Filling percentage.
Definition: CRFShell.h:108
double * m_NodeM
Index of the triangles and nodes in the patch surrounding a triangle (0/1,b,c,d,l,...
Definition: CRFShell.h:135
double * m_NodeV_s
Node position matrix (substep).
Definition: CRFShell.h:191
double m_MeshSize
Number of triangles [#].
Definition: CRFShell.h:102
int m_TopConnectNum
A pointer to the input force (bottom).
Definition: CRFShell.h:66
double m_Filling[2]
Shape.
Definition: CRFShell.h:107
double * m_NodeP
Node position matrix (i).
Definition: CRFShell.h:181
Eigen::Matrix< double, 6, 1 > * m_FoNlgeom
Initial in-plane forces.
Definition: CRFShell.h:206
Eigen::Matrix< double, 3, 3 > * m_RG2L
Radius angle of the triangles.
Definition: CRFShell.h:153
double * m_NodeV
Node velocity matrix (i).
Definition: CRFShell.h:183
int m_IStateVol
Index of the global velocity in the state vector.
Definition: CRFShell.h:95
double m_rPress[2]
Drainage pressure.
Definition: CRFShell.h:109
double m_Density
Thickness of the membrane elements [m].
Definition: CRFShell.h:118
string m_Shape
NED dimension [m].
Definition: CRFShell.h:106
double m_Indt
Maximum and mean stress.
Definition: CRFShell.h:128
double m_Beta
Alpha parameter in the HHT-alpha time integration method.
Definition: CRFShell.h:178
Eigen::Matrix< double, 3, 3 > m_PD
Location of the triangles (original).
Definition: CRFShell.h:156
double m_Loc[3]
Mesh size [m].
Definition: CRFShell.h:104
double * m_NodeP_s
Integration substep.
Definition: CRFShell.h:190
Includes.
Definition: CConstantStrainTriangle.h:22
Relative tolerance to stop iteration.
Definition: CRFShell.h:171
double previous_time
Time at previous step.
Definition: CRFShell.h:173
double prev_plot_time
Time at previous plot.
Definition: CRFShell.h:175
double step_size
Integration time step.
Definition: CRFShell.h:172
double current_time
Time at current step.
Definition: CRFShell.h:174