FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
environmentmodels::ParametricBathymetry Class Reference

#include <ParametricBathymetry.h>

+ Inheritance diagram for environmentmodels::ParametricBathymetry:
+ Collaboration diagram for environmentmodels::ParametricBathymetry:

Public Member Functions

 ParametricBathymetry (parametric::Spec spec)
 
marenv::Status GetDepth (const double pos[2], double &depthOut) override
 
marenv::Status ComputeSurfaceUnitNormal (const double pos[2], double unitNormalOut[3]) override
 
marenv::Status GetSeabedSigma (const double pos[3], double &sigmaOut) override
 
marenv::Status GetSeabedTau (const double pos[3], double &tauOut) override
 
marenv::Status GetSeabedRho (const double pos[3], double &rhoOut) override
 
marenv::Status ComputeRayIntersection (const double origin[3], const double direction[3], double &distanceOut, double maxSearchDistance=100.0, double startSearchDistance=-1.0, double stepSize=1.0, double convergenceTolerance=0.01) override
 
double DepthAt (double x, double y) const
 
- Public Member Functions inherited from marenv::seafloor::BathymetryField
virtual ~BathymetryField ()=default
 Virtual destructor.
 

Static Public Member Functions

static std::shared_ptr< ParametricBathymetryFromJsonString (const std::string &jsonText)
 
static std::shared_ptr< ParametricBathymetryFromFile (const std::string &path)
 

Additional Inherited Members

- Protected Member Functions inherited from marenv::seafloor::BathymetryField
 BathymetryField ()=default
 Constructor is empty.
 

Detailed Description

Configurable, parameterised seabed bathymetry.

Evaluates a seabed depth field from a declarative specification of an along-track profile sequence (track) and/or general composition layers of primitive shapes with spatial validity intervals and blend operators. Intended for control-tracking reference bathymetries (constant depth, transversal incline, valley, peak, and blends thereof), but general enough for arbitrary parametric seabeds.

The depth field GetDepth is evaluated analytically; the surface normal is obtained by central finite differences, matching the convention used by the other seafloor implementations (n = (-dz/dx, -dz/dy, 1), normalised, z down). Seabed material properties are spatially constant.

Frame: SNAME (x = North, y = East, z = Down; depth positive downward).

Constructor & Destructor Documentation

◆ ParametricBathymetry()

environmentmodels::ParametricBathymetry::ParametricBathymetry ( parametric::Spec  spec)
explicit

Construct from a fully-populated specification.

Parameters
[in]specParametric seabed specification.

Member Function Documentation

◆ ComputeRayIntersection()

marenv::Status environmentmodels::ParametricBathymetry::ComputeRayIntersection ( const double  origin[3],
const double  direction[3],
double &  distanceOut,
double  maxSearchDistance = 100.0,
double  startSearchDistance = -1.0,
double  stepSize = 1.0,
double  convergenceTolerance = 0.01 
)
overridevirtual

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). If less then zero, the algorithm will coarsely estimate the crossing assuming a flat seabed and search from there.
[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.

Implements marenv::seafloor::BathymetryField.

◆ ComputeSurfaceUnitNormal()

marenv::Status environmentmodels::ParametricBathymetry::ComputeSurfaceUnitNormal ( const double  pos[2],
double  unitNormalOut[3] 
)
overridevirtual

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

Implements marenv::seafloor::BathymetryField.

◆ DepthAt()

double environmentmodels::ParametricBathymetry::DepthAt ( double  x,
double  y 
) const

Direct depth query used internally and by tests.

Parameters
[in]xNorth coordinate [m].
[in]yEast coordinate [m].
Returns
Seabed depth [m] (positive downward).

◆ FromFile()

static std::shared_ptr< ParametricBathymetry > environmentmodels::ParametricBathymetry::FromFile ( const std::string &  path)
static

Build from a JSON configuration file.

Parameters
[in]pathPath to the JSON document.
Returns
Shared instance.
Exceptions
std::runtime_errorif the file cannot be read or is invalid.

◆ FromJsonString()

static std::shared_ptr< ParametricBathymetry > environmentmodels::ParametricBathymetry::FromJsonString ( const std::string &  jsonText)
static

Build from a JSON configuration string.

Parameters
[in]jsonTextJSON document describing the seabed.
Returns
Shared instance.
Exceptions
std::runtime_erroron invalid or malformed configuration.

◆ GetDepth()

marenv::Status environmentmodels::ParametricBathymetry::GetDepth ( const double  pos[2],
double &  depthOut 
)
overridevirtual

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

Implements marenv::seafloor::BathymetryField.

◆ GetSeabedRho()

marenv::Status environmentmodels::ParametricBathymetry::GetSeabedRho ( const double  pos[3],
double &  rhoOut 
)
overridevirtual

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

Implements marenv::seafloor::BathymetryField.

◆ GetSeabedSigma()

marenv::Status environmentmodels::ParametricBathymetry::GetSeabedSigma ( const double  pos[3],
double &  sigmaOut 
)
overridevirtual

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

Implements marenv::seafloor::BathymetryField.

◆ GetSeabedTau()

marenv::Status environmentmodels::ParametricBathymetry::GetSeabedTau ( const double  pos[3],
double &  tauOut 
)
overridevirtual

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

Implements marenv::seafloor::BathymetryField.


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