FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
marenv::seafloor::BathymetryField Class Referenceabstract

#include <BathymetryField.h>

+ Inheritance diagram for marenv::seafloor::BathymetryField:
+ Collaboration diagram for marenv::seafloor::BathymetryField:

Public Member Functions

virtual ~BathymetryField ()=default
 Virtual destructor.
 
virtual Status GetDepth (const double pos[2], double &depthOut)=0
 
virtual Status ComputeSurfaceUnitNormal (const double pos[2], double unitNormalOut[3])=0
 
virtual Status GetSeabedSigma (const double pos[3], double &sigmaOut)=0
 
virtual Status GetSeabedTau (const double pos[3], double &tauOut)=0
 
virtual Status GetSeabedRho (const double pos[3], double &rhoOut)=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)
 

Protected Member Functions

 BathymetryField ()=default
 Constructor is empty.
 

Static Protected Member Functions

static bool IsValidRay (const double origin[3], double directionNorm, double maxSearchDistance)
 True for an origin with finite coordinates, and a direction norm and a maximum search distance that ComputeRayIntersection accepts: positive and finite.
 
static double ValidTolerance (double convergenceTolerance)
 The convergence tolerance ComputeRayIntersection uses: convergenceTolerance, raised to 1e-12 if smaller or NaN.
 

Detailed Description

The interface for an representing seafloor depths and material properties

As a basis for calculation seafloor forces, the following seafloor properties are defined:

  • Sigma (σ): Represents stress (force per unit area). It is a key parameter in understanding a material's strength, and is measured in Pascals (Pa).
  • Tau (τ): Represents shear stress or relaxation time. In the context of viscoelastic materials, relaxation time is a characteristic parameter that quantifies how fast a material responds to external forces.
  • Rho (ρ): Represents density (mass per unit volume), measured in kg/m³.

Member Function Documentation

◆ ComputeRayIntersection()

virtual Status marenv::seafloor::BathymetryField::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 
)
virtual

Returns the distance a ray must travel before intercepting the seafloor: the first crossing along the ray.

An origin at the seafloor or inside it (less than convergenceTolerance above it) is a hit at distance 0 (owner ruling R133, MENV-0063), so the first crossing always runs from the water into the seafloor.

The default implementation marches from the origin in steps of at most stepSize until the vertical distance to the seafloor (GetDepth) is positive or below convergenceTolerance, and bisects the last step until that vertical distance is below the tolerance (owner ruling R132, MENV-0062); after 64 halvings it returns the end of the interval in the water. The march nodes lie on a grid of stepSize anchored at the start distance. A seabed feature that the ray enters and leaves within one step can be missed. The search evaluates the depth about (distance to the hit) / stepSize times.

A flat seabed is hit exactly at the flat-seabed estimate, to the bit, when the start is negative, the estimate lies within maxSearchDistance, the origin is at least convergenceTolerance above the seabed, and stepSize |u_z| >= convergenceTolerance (u the unit direction); with a smaller step an earlier node is already within the tolerance and is returned.

Parameters
[in]originPosition (x,y,z) of the origin of the ray
[in]directionThe direction (x,y,z) of the ray; it is normalised, and the distance is measured along the unit ray.
[out]distanceOutThe distance the beam travelled before reaching the seabed; -1 without an intersection.
[in]maxSearchDistanceThe maximum distance from the origin to search for an intersection.
[in]startSearchDistanceThe distance that anchors the march grid. If less than zero, the crossing with a flat seabed at the depth below the origin. It does not move the result away from the first crossing.
[in]stepSizeThe search step size; one that is not at least 1e-6 (NaN included) is raised to 1e-6, and one above maxSearchDistance is cut to it.
[in]convergenceToleranceThe vertical error tolerance between a computed point on the ray and a point on the seafloor to consider an intersection found; one that is not at least 1e-12 (NaN included) is raised to 1e-12.
Returns
marenv::Status::OK on success; marenv::Status::NOT_APPLICABLE_NOT_SET, with distance -1, when the ray does not cross the seafloor within maxSearchDistance (owner ruling R134; IsUsable() rejects it); marenv::Status::ERROR_NOT_SET, with distance -1, for a non-finite origin, a zero or non-finite direction, a maxSearchDistance that is not positive and finite, or a GetDepth status that is not usable (IsUsable()) at a point of the search.

Reimplemented in marenv::seafloor::FlatSeafloor.

◆ ComputeSurfaceUnitNormal()

virtual Status marenv::seafloor::BathymetryField::ComputeSurfaceUnitNormal ( const double  pos[2],
double  unitNormalOut[3] 
)
pure virtual

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

Parameters
[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.flag

Implemented in environmentmodels::NetCdfSeafloorBathymetry, environmentmodels::ParametricBathymetry, marenv::seafloor::BathymetryWaves, and marenv::seafloor::FlatSeafloor.

◆ GetDepth()

virtual Status marenv::seafloor::BathymetryField::GetDepth ( const double  pos[2],
double &  depthOut 
)
pure virtual

Returns the seafloor depth at a specific position.

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

Implemented in environmentmodels::NetCdfSeafloorBathymetry, environmentmodels::ParametricBathymetry, marenv::seafloor::BathymetryWaves, and marenv::seafloor::FlatSeafloor.

◆ GetSeabedRho()

virtual Status marenv::seafloor::BathymetryField::GetSeabedRho ( const double  pos[3],
double &  rhoOut 
)
pure virtual

Returns seabed density (ρ) in kg/m³.

Parameters
[in]posThe position in question.
[out]rhoOutDensity in the specified position.
Returns
marenv::Status::OK on success. See marenv::Status for other values.flag

Implemented in environmentmodels::NetCdfSeafloorBathymetry, environmentmodels::ParametricBathymetry, marenv::seafloor::BathymetryWaves, and marenv::seafloor::FlatSeafloor.

◆ GetSeabedSigma()

virtual Status marenv::seafloor::BathymetryField::GetSeabedSigma ( const double  pos[3],
double &  sigmaOut 
)
pure virtual

Returns seabed σ in Pascals (Pa).

Parameters
[in]posThe position in question.
[out]sigmaOutSigma in the specified position.
Returns
marenv::Status::OK on success. See marenv::Status for other values.flag

Implemented in environmentmodels::NetCdfSeafloorBathymetry, environmentmodels::ParametricBathymetry, marenv::seafloor::BathymetryWaves, and marenv::seafloor::FlatSeafloor.

◆ GetSeabedTau()

virtual Status marenv::seafloor::BathymetryField::GetSeabedTau ( const double  pos[3],
double &  tauOut 
)
pure virtual

Returns seabed shear stress τ.

Parameters
[in]posThe position in question.
[out]tauOutShear stress in the specified position.
Returns
marenv::Status::OK on success. See marenv::Status for other values.flag

Implemented in environmentmodels::NetCdfSeafloorBathymetry, environmentmodels::ParametricBathymetry, marenv::seafloor::BathymetryWaves, and marenv::seafloor::FlatSeafloor.


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