Marine systems simulation
Loading...
Searching...
No Matches
marenv::Environment Class Referenceabstract

#include <Environment.h>

+ Inheritance diagram for marenv::Environment:
+ Collaboration diagram for marenv::Environment:

Classes

struct  EnvironmentQuery
 Struct for containing the data for a environment query. More...
 

Public Member Functions

virtual ~Environment ()=0
 Virtual destructor.
 
virtual Status GetSubmergence (double time, const double pos[3], double &submergence)=0
 
virtual Status GetSurfaceElevation (double time, const double pos[2], double &elevationOut)=0
 
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 GetDynamicPressure (double time, const double pos[3], double &pressureOut)=0
 
virtual Status GetTotalPressure (double time, const double pos[3], double &pressureOut)=0
 
virtual Status GetSeaDepth (const double pos[2], double &depthOut)=0
 
virtual Status ComputeRayIntersection (const double origin[3], const double direction[3], double &distanceOut, double maxSearchDistance=100, double startSearchDistance=-1.0, double stepSize=1.0, double convergenceTolerance=0.01)=0
 
virtual Status GetCurrentVelocity (double time, const double pos[3], double velOut[3])=0
 
virtual Status GetDensity (double time, const double pos[3], double &density)=0
 
virtual Status PointEnvironmentQuery (double time, const double pos[3], EnvironmentQuery &queryResult)=0
 

Protected Member Functions

 Environment ()=default
 The constructor is protected.
 

Detailed Description

Defines the public interface of an environment .

The role of an environment is to answer all requests for information about the simulated environment. It is supposed to be implemented by classes implementing all methods, typically by being composed by several other classes which implements different aspects of the environment. Such aspects are typically waves, currents, sea floor, wind and effects from e.g. ships in motion.

Member Function Documentation

◆ ComputeRayIntersection()

virtual Status marenv::Environment::ComputeRayIntersection ( const double  origin[3],
const double  direction[3],
double &  distanceOut,
double  maxSearchDistance = 100,
double  startSearchDistance = -1.0,
double  stepSize = 1.0,
double  convergenceTolerance = 0.01 
)
pure virtual

Returns the distance a ray must travel before intercepting the seafloor.

Parameters
[in]originPosition (x,y,z) of the origin of the ray
[in]directionThe unit direction (x,y,z) of the ray
[out]distanceOutThe distance the beam travelled before reaching the seabed.
[in]maxSearchDistanceThe maximum distance from the origin to search for an intersection.
[in]startSearchDistanceThe distance from the origin to start searching for an intersection (initial guess).
[in]stepSizeThe search step size.
[in]convergenceToleranceThe vertical error tolerance between a computed point on the ray and a point on the seafloor to consider an intersection found.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Implemented in marenv::EnvironmentFacade.

◆ GetCurrentVelocity()

virtual Status marenv::Environment::GetCurrentVelocity ( double  time,
const double  pos[3],
double  velOut[3] 
)
pure virtual

Returns the water current velocity at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y,z) for which the current velocity is desired.
[out]velOutThe current velocity at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Includes effects of only currents, not waves.

◆ GetDensity()

virtual Status marenv::Environment::GetDensity ( double  time,
const double  pos[3],
double &  density 
)
pure virtual

Returns the water density at a specific position

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y,z) for which the water current velocity producer is desired.
[out]densityThe water density at given position and time.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Implemented in marenv::EnvironmentFacade.

◆ GetDynamicPressure()

virtual Status marenv::Environment::GetDynamicPressure ( double  time,
const double  pos[3],
double &  pressureOut 
)
pure virtual

Returns the dynamic pressure at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y,z) for which the pressure is desired.
[out]pressureOutThe pressure at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Implemented in marenv::EnvironmentFacade.

◆ GetParticleAcceleration()

virtual Status marenv::Environment::GetParticleAcceleration ( double  time,
const double  pos[3],
double  accOut[3] 
)
pure virtual

Returns the particle acceleration at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y,z) for which the particle acceleration is desired.
[out]accOutThe particle acceleration at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Includes effects of both current and waves.

◆ GetParticleVelocity()

virtual Status marenv::Environment::GetParticleVelocity ( double  time,
const double  pos[3],
double  velOut[3] 
)
pure virtual

Returns the particle velocity at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y,z) for which the particle velocity is desired.
[out]velOutThe particle velocity at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Includes effects of both current and waves.

◆ GetSeaDepth()

virtual Status marenv::Environment::GetSeaDepth ( const double  pos[2],
double &  depthOut 
)
pure virtual

Returns the sea depth at a specific position.

Parameters
[in]posPosition (x,y) for which sea depth is desired.
[out]depthOutThe sea depth at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Implemented in marenv::EnvironmentFacade.

◆ GetSubmergence()

virtual Status marenv::Environment::GetSubmergence ( double  time,
const double  pos[3],
double &  submergence 
)
pure virtual

Calculates the submergence of a specific position.

Parameters
[in]timeTime
[in]posPosition
[out]submergenceThe submergence of the position
Returns
marenv::Status::OK on success. See marenv::Status for other values

Implemented in marenv::EnvironmentFacade.

◆ GetSurfaceElevation()

virtual Status marenv::Environment::GetSurfaceElevation ( double  time,
const double  pos[2],
double &  elevationOut 
)
pure virtual

Returns the surface elevation at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y) for which surface elevation is desired.
[out]elevationOutSurface elevation at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Implemented in marenv::EnvironmentFacade.

◆ GetSurfaceUnitNormal()

virtual Status marenv::Environment::GetSurfaceUnitNormal ( double  time,
const double  pos[2],
double  unitNormalOut[3] 
)
pure virtual

Returns the unit normal vector of the surface at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y) for which the unit normal surface vector is desired.
[out]unitNormalOutThe unit normal surface vector at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

◆ GetTotalPressure()

virtual Status marenv::Environment::GetTotalPressure ( double  time,
const double  pos[3],
double &  pressureOut 
)
pure virtual

Returns the total pressure at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y,z) for which the pressure is desired.
[out]pressureOutThe pressure at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Includes both dynamic and static pressure.

Implemented in marenv::EnvironmentFacade.

◆ PointEnvironmentQuery()

virtual Status marenv::Environment::PointEnvironmentQuery ( double  time,
const double  pos[3],
EnvironmentQuery queryResult 
)
pure virtual

Calculates multiple properties of the environment in one call.

Parameters
[in]timeSimulation time.
[in]posPosition.
[out]queryResultThe result of the query.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Implemented in marenv::EnvironmentFacade.


The documentation for this class was generated from the following file: