13#ifndef CMultiIceFloe_H
14#define CMultiIceFloe_H
20#include "CEnvironment.h"
21#include <CIntegratorOptions.h>
22#include <CPrintDuringExec.h>
23#include "Subroutines.h"
33 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
35 CMultiIceFloe(std::string sSimObjectName, ISimObjectCreator* pCreator);
36 virtual void FinalSetup(
const double dT,
const double*
const adX, ISimObjectCreator*
const pCreator);
39#ifdef FH_VISUALIZATION
41 virtual void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
44 virtual void RenderUpdate(
const double dT,
const double*
const adX);
47 void DrawBody(Ogre::SceneNode* renderNode, Ogre::SceneManager* sceneMgr,
const int& pi);
51 virtual void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot,
const bool bIsMajorTimeStep);
52 virtual void PreOdeFcn(
const double dT,
const double *
const adX, IStateUpdater* updater);
54 virtual void ContactDetection(
const double dT,
const double*
const adX);
60 virtual vec6 GetInternalForces(
const int& pi,
const vec6& dX,
const vec3& r,
const quat& ql2g,
const quat& qg2l,
double time,
const double*
const states);
63 virtual mat6 GetInertiaMatrix(
const int& pi,
const vec3& r,
const quat& q,
const double dT,
const double*
const adX);
66 virtual vec13 GetSecondDerivative(
const int& pi,
const vec3& r,
const quat& ql2g,
const quat& qg2l,
const vec3& v,
const vec3& w,
const vec6& externalForces,
const double time,
const double*
const states);
69 static vec6 GetCoriolisForce(
const vec6& dX,
const mat6& Inertia);
71 virtual vec3 CalRollPitchYaw(
const quat& ql2g);
73 virtual vec6 CalcHydroforces(
const int& pi,
const vec6& dX,
const vec3& r,
const quat& ql2g,
const quat& qg2l,
double time,
const double*
const states);
74 virtual vec6 CalcHydroforcesPolyplate(
const int& pi,
const vec6& dX,
const vec3& r,
const quat& ql2g,
const quat& qg2l,
double time,
const double*
const states);
76 virtual vec6 CalContactForce(
const int& pi,
const vec3& r,
const quat& ql2g,
const quat& qg2l,
const double dT,
const double*
const adX);
79 virtual vec6 CalConnectForce(
const vec3& r,
const vec6& dX,
const quat& ql2g,
const quat& qg2l,
const double dT,
const double*
const adX);
87 virtual const double* Test(
const double dT,
const double*
const adX);
88 virtual const double* ContactForce(
const double dT,
const double*
const adX);
89 virtual const double* FloeState(
const double dT,
const double*
const adX);
90 virtual const double* ConnectForce(
const double dT,
const double*
const adX);
92 double numIcePresent[2];
93 const double * icePresenceTest(
const double T,
const double*
const X);
94 const double * iceCriticalTest(
const double T,
const double*
const X);
95 ISignalPort * m_inIcePresenceRegion;
96 ISignalPort * m_inIcePresenceCritical;
141 double current_time = 0.0;
142 double previous_time = 0.0;
143 double step_size = 0.0;
166 virtual const double*
ConnectPos(
const double dT,
const double*
const adX,
int iConnect);
167 virtual const double* ConnectVel(
const double dT,
const double*
const adX,
int iConnect);
168 ISignalPort ** m_ConnectForce;
170 double m_StructConnectForce[8];
178 ISignalPort* m_pInStructVel;
179 ISignalPort* m_pInStructOmega;
180 ISignalPort* m_pInStructQuat;
182 double m_StructPos[3];
183 double m_StructVel[3];
184 double m_StructOmega[3];
185 double m_StructQuat[4];
187 virtual const double* StructForceNED(
const double dT,
const double*
const adX);
188 virtual const double* StructTorqueNED(
const double dT,
const double*
const adX);
197 Eigen::Matrix<double,8,8>* m_SSpaceA;
198 Eigen::Matrix<double,8,1>* m_SSpaceB;
199 Eigen::Matrix<double,1,8>* m_SSpaceC;
200 Eigen::Matrix<double,1,1>* m_SSpaceD;
201 double* m_SSpaceSDot;
203 virtual vec6 CalStateSpace(
const int& pi,
const double dT,
const double*
const adX,
const vec6& VS);
229#ifdef FH_VISUALIZATION
231 Ogre::SceneNode** m_RenderNodes;
232 Ogre::SceneManager* m_SceneMgr;
233 vector<Ogre::ManualObject*> m_Manual;
235 double m_CameraPos[3];
236 virtual const double* CameraPosition(
const double dT,
const double*
const adX);
Definition: CEnvironment.h:10
Definition: Subroutines.h:144
Definition: CMultiIceFloe.h:31
int m_ModeNum
Index of the additional states for state-space implementation in the state vector.
Definition: CMultiIceFloe.h:194
double m_Mui[2]
Ice compressive strength.
Definition: CMultiIceFloe.h:157
double m_ElasticM
Integration step info.
Definition: CMultiIceFloe.h:148
int m_numFloe
Dimension of ice field.
Definition: CMultiIceFloe.h:106
int m_ConnectNum
Tangential contact force at previous time step.
Definition: CMultiIceFloe.h:161
vec3 * m_ContactMoment
Global contact force.
Definition: CMultiIceFloe.h:134
vec3 ** m_PB2_P
PB position 1 at previous time step (relative to PA)
Definition: CMultiIceFloe.h:221
vec3 ** m_PB0_P
Normal of the common plane at previous time step (relative to PA)
Definition: CMultiIceFloe.h:219
double m_K
Poisson's ratio of ice.
Definition: CMultiIceFloe.h:150
virtual void OdeFcn(const double dT, const double *const adX, double *const adXDot, const bool bIsMajorTimeStep)
Calculates the state derivatives.
PolyplateSpec m_PolyPlate[MaxNumFL]
Particle class for contact detection.
Definition: CMultiIceFloe.h:118
double m_DampingR
Coefficient of restitution.
Definition: CMultiIceFloe.h:152
vec3 ** m_xyzFloeV
Local coordinates of ice floe vertices.
Definition: CMultiIceFloe.h:108
int m_conStruct
Output global connect force acting on the structure.
Definition: CMultiIceFloe.h:174
int m_ConnectPA
Number of connections.
Definition: CMultiIceFloe.h:162
int m_ContactMesh
User-defined tolerance for common plane calculation.
Definition: CMultiIceFloe.h:209
double m_ComAreaN[2]
0: no BC; 1: ice floes confined at the boundaries perpendicular to the drift direction
Definition: CMultiIceFloe.h:212
double m_CurrentVel[3]
Computational area North.
Definition: CMultiIceFloe.h:213
double m_sDensity
Density of ice.
Definition: CMultiIceFloe.h:123
double m_StructContactForce[8]
Global contact moment.
Definition: CMultiIceFloe.h:135
double m_Kte
Normal contact stiffness.
Definition: CMultiIceFloe.h:154
double m_PoissonR
Elastic modulus of ice.
Definition: CMultiIceFloe.h:149
double m_CR
Contact stiffness.
Definition: CMultiIceFloe.h:151
vec3 ** m_PB1_P
PB position 0 at previous time step (relative to PA)
Definition: CMultiIceFloe.h:220
double m_risStruct[3]
Location of the structure.
Definition: CMultiIceFloe.h:112
double m_wDragCoeff[2]
Density of structure.
Definition: CMultiIceFloe.h:125
int m_ACP
Current velocity.
Definition: CMultiIceFloe.h:215
Particle m_Particle[MaxNumFL]
Damping matrix.
Definition: CMultiIceFloe.h:117
int m_IStateOmega
Index of the global velocity in the state vector.
Definition: CMultiIceFloe.h:102
double m_iField[4]
Index of the global angular velocity in the state vector.
Definition: CMultiIceFloe.h:105
int m_BoundaryCondition
Use meshes (faces) to calculate contact area, 0: no mesh; 1: mesh.
Definition: CMultiIceFloe.h:210
double m_locStruct[3]
Number of structures.
Definition: CMultiIceFloe.h:111
double m_Kne
Damping ratio.
Definition: CMultiIceFloe.h:153
virtual const double * ConnectPos(const double dT, const double *const adX, int iConnect)
List of velocities (u,v,w) of the connections.
double * m_ConnectLoc
Index of the object to connect.
Definition: CMultiIceFloe.h:163
AABB * m_AABB
Polyplate structure.
Definition: CMultiIceFloe.h:120
double m_FloeState[19]
Index of ice floe for output.
Definition: CMultiIceFloe.h:138
int m_iFloePos
Output global contact force acting on the structure.
Definition: CMultiIceFloe.h:137
CEnvironment * m_Environment
Ice concentration.
Definition: CMultiIceFloe.h:131
double m_iSpeed[3]
Water drag coefficient.
Definition: CMultiIceFloe.h:127
double m_CStrength
Normal viscous damping coefficient.
Definition: CMultiIceFloe.h:156
ISignalPort * m_pInStructPos
Rendering of structures, 0: no; 1: triangle; 2: line.
Definition: CMultiIceFloe.h:177
mat6 * m_DampMatrix
Added mass matrix.
Definition: CMultiIceFloe.h:115
vec3 ** m_FloeV
Number of ice floes.
Definition: CMultiIceFloe.h:107
double m_Knv
Tangential contact stiffness.
Definition: CMultiIceFloe.h:155
double m_iDensity
Particle AABB tree.
Definition: CMultiIceFloe.h:122
CPrintDuringExec * m_Printer
PB position 2 at previous time step (relative to PA)
Definition: CMultiIceFloe.h:224
mat6 * m_AddedMass
Restriction of structure.
Definition: CMultiIceFloe.h:114
vec3 ** m_Ftp
Floe surface friction.
Definition: CMultiIceFloe.h:158
vec3 ** m_PN_P
Location of the common plane at previous time step (relative to PA)
Definition: CMultiIceFloe.h:218
vec3 ** m_P0_P
1: Common plane saved at previous time step; 0: no
Definition: CMultiIceFloe.h:217
int m_conRender
0: no interconnecting structure; 1: interconnecting structure
Definition: CMultiIceFloe.h:175
double m_iConcentration
Initial ice drift speed.
Definition: CMultiIceFloe.h:129
int ** m_CP_P
1: use approximation of common plane; 0: no
Definition: CMultiIceFloe.h:216
vec3 * m_ContactForce
Pointer to DeepSeaGravityWaves -> CEnvironment.
Definition: CMultiIceFloe.h:133
double * m_ConnectVel
List of positions (x,y,z) of the connections.
Definition: CMultiIceFloe.h:165
int m_IStateQuater
Index of the global position in the state vector.
Definition: CMultiIceFloe.h:100
double * m_ConnectPos
List of local locations of the connections.
Definition: CMultiIceFloe.h:164
int m_IStateVel
Index of the quaternions in the state vector.
Definition: CMultiIceFloe.h:101
int m_numStruct
Coordinates of ice floe vertices.
Definition: CMultiIceFloe.h:110
Definition: Subroutines.h:277
Floe states.
Definition: CMultiIceFloe.h:140
bool variable_steps
True if variable step size is used.
Definition: CMultiIceFloe.h:144
Definition: Subroutines.h:93