|
|
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) |
| |
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³.
| 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] | origin | Position (x,y,z) of the origin of the ray |
| [in] | direction | The direction (x,y,z) of the ray; it is normalised, and the distance is measured along the unit ray. |
| [out] | distanceOut | The distance the beam travelled before reaching the seabed; -1 without an intersection. |
| [in] | maxSearchDistance | The maximum distance from the origin to search for an intersection. |
| [in] | startSearchDistance | The 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] | stepSize | The 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] | convergenceTolerance | The 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.