|
| | TunableWaveField (const Spectrum &spectrum, marenv::wave::WaveTheory theory, int numWaves, std::uint32_t seed, double depth=marenv::wave::kDeepWater, const marenv::wave::WaveCutoffs &cutoffs={}) |
| |
|
double | Hs () const |
| | Significant wave height [m].
|
| |
|
double | MeanPeriod () const |
| | Mean period [s].
|
| |
|
double | MainDirectionDeg () const |
| | Main direction as Waves.MainDirectionDeg: where the sea comes from, from north towards east [deg].
|
| |
|
void | SetSeaState (double hs, double meanPeriod, double mainDirectionDeg) |
| | A new sea state; the change fades in over CrossFade() seconds from the next query.
|
| |
|
const std::shared_ptr< marenv::wave::WaveField > & | Model () const |
| | The marenv model of the current sea state.
|
| |
| std::string | SpectrumName () const override |
| |
| std::string | WaveTheoryName () const override |
| |
| marenv::Status | ComputeSurfaceElevation (double time, const double pos[2], double &elevationOut) override |
| |
| marenv::Status | ComputeDynamicPressure (double time, const double pos[3], double &pressureOut) override |
| |
| marenv::Status | ComputeTotalPressure (double time, const double pos[3], double &pressureOut) override |
| |
| marenv::Status | ComputeSurfaceUnitNormal (double time, const double pos[2], double unitNormalOut[3]) override |
| |
| marenv::Status | ComputeParticleVelocity (double time, const double pos[3], double velOut[3]) override |
| |
| marenv::Status | ComputeParticleAcceleration (double time, const double pos[3], double accOut[3]) override |
| |
| marenv::Status | ComputePointQuery (double time, const double pos[3], double &surface_elevation, double surface_unit_normal[3], double particle_velocity[3], double particle_acceleration[3], double &pressure) override |
| |
| InsecureDatapointers | GetWaveComponents () const override |
| |
| marenv::wave::WaveComponentData | GetWaveComponentsCopy () const override |
| |
| marenv::wave::WaveComponentData | GetWaveComponentsCopy (double time, size_t maxComponents=0) const override |
| |
| double | MaxWaveElevation () const override |
| |
| virtual | ~WaveField ()=default |
| |
Spectrum waves whose significant height, mean period and main direction may change while the simulation runs (Waves.Hs, Waves.MeanPeriod, Waves.MainDirectionDeg as tunable parameters, core ADR 0025; ADR 0009 D26).
It forwards every query to a marenv wave model built from the spectrum. SetSeaState builds a new model with the same seed; for CrossFade() seconds after the first query that follows, the queries return the old and the new field blended (exact for linear waves: the fields superpose), and the component copies (for the sea surface) both sets with their amplitudes scaled, so neither the floating bodies nor the picture jump. The wrappers of this library (ShelteredWaveField, TidalWaveField) go around it; they and every user keep the same pointer.
Getter for a copy of wave component specifications at a given time.
- Parameters
-
| [in] | time | Simulation time used to evaluate the interpolation factor. |
| [in] | maxComponents | Maximum number of components to return (0 = all). |
- Returns
- A structure with wave component data.
During a transition this may return the merged components from both source and destination fields with amplitudes scaled by the interpolation factor. The default implementation ignores time: it takes the components of the time-independent overload and returns them sorted by descending amplitude (a signed zetaA, with std::sort or std::partial_sort, so components of equal amplitude come in an unspecified order). When limited, the components with the largest amplitudes are kept.
Reimplemented from marenv::wave::WaveField.
| double environment::TunableWaveField::MaxWaveElevation |
( |
| ) |
const |
|
overridevirtual |
Returns an upper bound of |elevation| at every position and time (owner ruling R66).
- Returns
- B >= |eta(t, x, y)| for the wave components published by the field, which never changes them. A point at depth z > B + h (NED, z down), with h the half-size of a body around it, is submerged whatever the waves, so its wave elevation need not be evaluated.
The linear theories (AiryWavesScalar, AiryWavesSimd, GerstnerWaves) return the sum of the component amplitudes |zeta_A|, with a relative margin of 1e-10 for rounding; the Gerstner surface is the same sum at the Lagrangian point. NullWaveField returns 0. The default, for a wave field that cannot tell (an imported or gridded surface), is +infinity, which never skips an evaluation. Cheap: one pass over the components.
0 means no waves: no elevation, particle velocity or particle acceleration anywhere, so a caller may skip evaluating them (MENV-0064). A wave field that returns 0 must give zero for all three.
Reimplemented from marenv::wave::WaveField.