Marine systems simulation
DynamicDeepSeaGravityWaves.h
1
134#pragma once
135
136#include "DeepSeaGravityWaves.h"
137
138//#include <vector>
139//using std::vector;
140//using std::copy;
141
142
144 string waveEnergySpecter;
145 double LongCrestedPower;
146 bool isLongCrested;
147 double meanWavePeriod;
148 double significantWaveHeight;
149 double nDimOmegaLowLim;
150 double nDimOmegaUppLim;
151 double mainWaveDirectionRad;
152 int randomSeed;
153};
154
155
157{
158public:
159
160 DynamicDeepSeaGravityWaves(string simObjectName, ISimObjectCreator* creator);
161 //~DynamicDeepSeaGravityWaves(void);
162
163 //void OdeFcn(const double dT, const double* const adX, double* const adXDot, const bool bIsMajorTimeStep) { std::cout << "working"; };
164
165
166 //Pre ode-function pass for handling discontinuous/discrete states - in this case, there are no states but environmental parameters.
167 void PreOdeFcn(const double T, const double *const X, IStateUpdater* updater);
168
169#ifdef FH_VISUALIZATION
170 void RenderUpdate(const double T, const double* const X);
171#endif
172
173
174private:
175
176 // Updates m_WaveTheory according to new parameters (replaces m_WaveTheory)
177 void updateWaveSpectrum();
178
179
180 // vectors keeping "old" values for current modelling
181 vector<double> m_current_velocity;
182 vector<double> m_current_direction;
183 vector<double> m_depth_layers;
184
185 // wave parameters that can be updated in "real time" if m_updateWaveField is TRUE
186 WaveInputInfo_Spectrum m_waveInfo_Spectrum;
187
188 double m_cutoff;
189 int m_NumWavesWithoutPadding;
190 double m_updateStartTime;
191 bool m_printUpdatedParameters;
192 bool m_waveUpdateIsNeeded;
193
194 // input ports for updating Current parameters
195 ISignalPort* m_In_current_velocity;
196 ISignalPort* m_In_current_direction;
197
198 // input ports for updating wave spectrum (if spectrum is defined)
199 ISignalPort* m_In_significantWaveHeight;
200 ISignalPort* m_In_mainWaveDirectionRad;
201 ISignalPort* m_In_meanWavePeriod;
202
203 // input ports for updating wave components (if components are defined)
204 ISignalPort* m_In_waveFrequency;
205 ISignalPort* m_In_waveAmplitude;
206 ISignalPort* m_In_waveDirection;
207 ISignalPort* m_In_phaseAngle;
208
209#ifdef FH_VISUALIZATION
210 // updates visualization if new wave parameters are set
211 void updateWaveRenderParams();
212#endif
213
214};
Definition: DeepSeaGravityWaves.h:172
Definition: DynamicDeepSeaGravityWaves.h:157
Definition: DynamicDeepSeaGravityWaves.h:143