|
FhSim
3.1.0
Marine systems simulation
|
#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 | GetSoilState (const double pos[3], SoilState &soilOut)=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. | |
The interface for an representing seafloor depths and material properties
As a basis for calculation seafloor forces, the following seafloor properties are defined:
|
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.
| [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. |
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.
|
pure virtual |
Returns the unit normal vector of the seafloor at a specific position.
| [in] | pos | Position (x,y) for which the unit normal surface vector is desired. |
| [out] | unitNormalOut | The unit normal surface vector at pos. |
Implemented in environmentmodels::NetCdfSeafloorBathymetry, environmentmodels::ParametricBathymetry, marenv::seafloor::BathymetryWaves, and marenv::seafloor::FlatSeafloor.
|
pure virtual |
Returns the seafloor depth at a specific position.
| [in] | pos | Position (x,y) for which depth is desired. |
| [out] | depthOut | Depth at pos. |
Implemented in environmentmodels::NetCdfSeafloorBathymetry, environmentmodels::ParametricBathymetry, marenv::seafloor::BathymetryWaves, and marenv::seafloor::FlatSeafloor.
|
pure virtual |
Returns the soil parameters at the horizontal position of pos.
Not gated by the seabed: the caller knows the penetration z = pos[2] - depth and passes it to SoilState::ShearStrength. The soil has no depth in it.
| [in] | pos | The position in question (x, y are used). |
| [out] | soilOut | The soil parameters at pos. |
Implemented in environmentmodels::NetCdfSeafloorBathymetry, environmentmodels::ParametricBathymetry, marenv::seafloor::BathymetryWaves, and marenv::seafloor::FlatSeafloor.