|
Marine systems simulation
|
#include <EnvironmentFacade.h>
Inheritance diagram for marenv::EnvironmentFacade:
Collaboration diagram for marenv::EnvironmentFacade:Public Member Functions | |
| EnvironmentFacade () | |
| void | SetWaves (std::shared_ptr< wave::WaveField > wave) |
| void | SetWaves (const wave::WaveEnergySpectrum::SpectrumParameters ¶ms, wave::WaveTheory waveTheory, int numWaves, uint32_t seed) |
| void | SetBathymetry (std::shared_ptr< seafloor::BathymetryField > bathymetry) |
| std::shared_ptr< wave::WaveField > | GetWaves () |
| std::shared_ptr< seafloor::BathymetryField > | GetBathymetry () |
| void | AddCurrentField (const std::string &id, std::shared_ptr< current::CurrentField > field) |
| void | RemoveCurrentField (const std::string &id) |
| bool | HasCurrentField (const std::string &id) const |
| std::shared_ptr< current::CurrentField > | GetCurrentField (const std::string &id) const |
| void | AddWakeField (const std::string &id, std::shared_ptr< wake::WakeField > field) |
| void | RemoveWakeField (const std::string &id) |
| bool | HasWakeField (const std::string &id) const |
| std::shared_ptr< wake::WakeField > | GetWakeField (const std::string &id) const |
| std::vector< std::string > | GetWakeFieldIds () const |
| std::vector< std::string > | GetCurrentFieldIds () const |
| Status | GetSubmergence (double time, const double pos[3], double &submergence) override |
| Status | GetSurfaceElevation (double time, const double pos[2], double &elevationOut) override |
| Status | GetSurfaceUnitNormal (double time, const double pos[2], double *unitNormalOut) override |
| Status | GetParticleVelocity (double time, const double pos[3], double *velOut) override |
| Status | GetParticleAcceleration (double time, const double pos[3], double *accOut) override |
| Status | GetDynamicPressure (double time, const double pos[3], double &pressureOut) override |
| Status | GetTotalPressure (double time, const double pos[3], double &pressureOut) override |
| Status | GetSeaDepth (const double pos[2], double &depthOut) override |
| Status | ComputeRayIntersection (const double origin[3], const double direction[3], double &distanceOut, double maxSearchDistance=100, double startSearchDistance=-1, double stepSize=1.0, double convergenceTolerance=0.01) override |
| Status | GetCurrentVelocity (double time, const double pos[3], double *velOut) override |
| Status | GetDensity (double time, const double pos[3], double &density) override |
| Status | PointEnvironmentQuery (double time, const double pos[3], EnvironmentQuery &queryResult) override |
Public Member Functions inherited from marenv::Environment | |
| virtual | ~Environment ()=0 |
| Virtual destructor. | |
| virtual Status | GetSurfaceUnitNormal (double time, const double pos[2], double unitNormalOut[3])=0 |
| virtual Status | GetParticleVelocity (double time, const double pos[3], double velOut[3])=0 |
| virtual Status | GetParticleAcceleration (double time, const double pos[3], double accOut[3])=0 |
| virtual Status | GetCurrentVelocity (double time, const double pos[3], double velOut[3])=0 |
Protected Member Functions | |
| Status | ComputeTotalCurrent (double time, const double pos[3], double vel[3]) const |
| Sums the velocities of all registered current fields into vel[3]. | |
| double | ComputeWakeFactor (double time, const double pos[3], const double currentDirection[3]) const |
| Computes the combined multiplicative wake attenuation factor from all registered wake fields. | |
Protected Member Functions inherited from marenv::Environment | |
| Environment ()=default | |
| The constructor is protected. | |
Protected Attributes | |
| std::shared_ptr< wave::WaveField > | m_waves |
| Wave field model providing wave-induced quantities. | |
| std::unordered_map< std::string, std::shared_ptr< current::CurrentField > > | m_currentFields |
| Registry of current fields indexed by unique identifier; velocities are summed for the total current. | |
| std::shared_ptr< seafloor::BathymetryField > | m_depths |
| Bathymetry field model providing seafloor geometry and properties. | |
| std::unordered_map< std::string, std::shared_ptr< wake::WakeField > > | m_wakeFields |
| Registry of wake fields indexed by unique identifier. | |
Defines an environment.
Some methods are at the moment simple stubs.
|
inline |
Default constructor. Initialises with null/default field implementations:
NullWaveField (no waves), FlatSeafloor (200 m flat bottom). No current fields are registered by default.
| void marenv::EnvironmentFacade::AddCurrentField | ( | const std::string & | id, |
| std::shared_ptr< current::CurrentField > | field | ||
| ) |
Adds a current field with the given identifier. The velocities of all registered current
| [in] | id | Unique identifier for this current field. |
| [in] | field | The current field to add. |
fields are summed to produce the total ambient current.
| std::invalid_argument | if a current field with the given id already exists. |
| void marenv::EnvironmentFacade::AddWakeField | ( | const std::string & | id, |
| std::shared_ptr< wake::WakeField > | field | ||
| ) |
Adds a wake field with the given identifier.
| [in] | id | Unique identifier for this wake field. |
| [in] | field | The wake field to add. |
| std::invalid_argument | if a wake field with the given id already exists. |
|
overridevirtual |
Returns the distance a ray must travel before intercepting the seafloor.
| [in] | origin | Position (x,y,z) of the origin of the ray |
| [in] | direction | The unit direction (x,y,z) of the ray |
| [out] | distanceOut | The distance the beam travelled before reaching the seabed. |
| [in] | maxSearchDistance | The maximum distance from the origin to search for an intersection. |
| [in] | startSearchDistance | The distance from the origin to start searching for an intersection (initial guess). |
| [in] | stepSize | The search step size. |
| [in] | convergenceTolerance | The vertical error tolerance between a computed point on the ray and a point on the seafloor to consider an intersection found. |
Implements marenv::Environment.
| std::shared_ptr< seafloor::BathymetryField > marenv::EnvironmentFacade::GetBathymetry | ( | ) |
Gets the bathymetry to be used.
| std::shared_ptr< current::CurrentField > marenv::EnvironmentFacade::GetCurrentField | ( | const std::string & | id | ) | const |
Returns the current field with the given identifier.
| [in] | id | Identifier of the current field. |
| std::invalid_argument | if the identifier does not exist. |
| std::vector< std::string > marenv::EnvironmentFacade::GetCurrentFieldIds | ( | ) | const |
Returns a list of all registered current field identifiers.
|
override |
Returns the water current velocity at a specific position.
| [in] | time | Current simulation time. |
| [in] | pos | Position (x,y,z) for which the current velocity is desired. |
| [out] | velOut | The current velocity at pos. |
Includes effects of only currents, not waves.
|
overridevirtual |
Returns the water density at a specific position
| [in] | time | Current simulation time. |
| [in] | pos | Position (x,y,z) for which the water current velocity producer is desired. |
| [out] | density | The water density at given position and time. |
Implements marenv::Environment.
|
overridevirtual |
Returns the dynamic pressure at a specific position.
| [in] | time | Current simulation time. |
| [in] | pos | Position (x,y,z) for which the pressure is desired. |
| [out] | pressureOut | The pressure at pos. |
Implements marenv::Environment.
|
override |
Returns the particle acceleration at a specific position.
| [in] | time | Current simulation time. |
| [in] | pos | Position (x,y,z) for which the particle acceleration is desired. |
| [out] | accOut | The particle acceleration at pos. |
Includes effects of both current and waves.
|
override |
Returns the particle velocity at a specific position.
| [in] | time | Current simulation time. |
| [in] | pos | Position (x,y,z) for which the particle velocity is desired. |
| [out] | velOut | The particle velocity at pos. |
Includes effects of both current and waves.
|
overridevirtual |
Returns the sea depth at a specific position.
| [in] | pos | Position (x,y) for which sea depth is desired. |
| [out] | depthOut | The sea depth at pos. |
Implements marenv::Environment.
|
overridevirtual |
Calculates the submergence of a specific position.
| [in] | time | Time |
| [in] | pos | Position |
| [out] | submergence | The submergence of the position |
Implements marenv::Environment.
|
overridevirtual |
Returns the surface elevation at a specific position.
| [in] | time | Current simulation time. |
| [in] | pos | Position (x,y) for which surface elevation is desired. |
| [out] | elevationOut | Surface elevation at pos. |
Implements marenv::Environment.
|
override |
Returns the unit normal vector of the surface at a specific position.
| [in] | time | Current simulation time. |
| [in] | pos | Position (x,y) for which the unit normal surface vector is desired. |
| [out] | unitNormalOut | The unit normal surface vector at pos. |
|
overridevirtual |
Returns the total pressure at a specific position.
| [in] | time | Current simulation time. |
| [in] | pos | Position (x,y,z) for which the pressure is desired. |
| [out] | pressureOut | The pressure at pos. |
Includes both dynamic and static pressure.
Implements marenv::Environment.
| std::shared_ptr< wake::WakeField > marenv::EnvironmentFacade::GetWakeField | ( | const std::string & | id | ) | const |
Returns the wake field with the given identifier.
| [in] | id | Identifier of the wake field. |
| std::invalid_argument | if the identifier does not exist. |
| std::vector< std::string > marenv::EnvironmentFacade::GetWakeFieldIds | ( | ) | const |
Returns a list of all registered wake field identifiers.
| std::shared_ptr< wave::WaveField > marenv::EnvironmentFacade::GetWaves | ( | ) |
Gets the wave to be used.
| bool marenv::EnvironmentFacade::HasCurrentField | ( | const std::string & | id | ) | const |
Returns true if a current field with the given identifier exists.
| [in] | id | Identifier to check. |
| bool marenv::EnvironmentFacade::HasWakeField | ( | const std::string & | id | ) | const |
Returns true if a wake field with the given identifier exists.
| [in] | id | Identifier to check. |
|
overridevirtual |
Calculates multiple properties of the environment in one call.
| [in] | time | Simulation time. |
| [in] | pos | Position. |
| [out] | queryResult | The result of the query. |
Implements marenv::Environment.
| void marenv::EnvironmentFacade::RemoveCurrentField | ( | const std::string & | id | ) |
Removes the current field with the given identifier.
| [in] | id | Identifier of the current field to remove. |
| std::invalid_argument | if no current field with the given id exists. |
| void marenv::EnvironmentFacade::RemoveWakeField | ( | const std::string & | id | ) |
Removes the wake field with the given identifier.
| [in] | id | Identifier of the wake field to remove. |
| std::invalid_argument | if no wake field with the given id exists. |
| void marenv::EnvironmentFacade::SetBathymetry | ( | std::shared_ptr< seafloor::BathymetryField > | bathymetry | ) |
Sets the bathymetry to be used.
| [in] | bathymetry | Bathymetry to be used. |
| void marenv::EnvironmentFacade::SetWaves | ( | const wave::WaveEnergySpectrum::SpectrumParameters & | params, |
| wave::WaveTheory | waveTheory, | ||
| int | numWaves, | ||
| uint32_t | seed | ||
| ) |
Creates the wave model based on spectrum parameters. Automatically selects between scalar and simd implementations for Airy waves.
| [in] | params | The spectrum parameters. |
| [in] | waveTheory | The wave theory to use. |
| [in] | numWaves | The number of waves to create. |
| [in] | seed | The random seed to use. |
| void marenv::EnvironmentFacade::SetWaves | ( | std::shared_ptr< wave::WaveField > | wave | ) |
Sets the wave to be used.
| [in] | wave | Wave to be used. |