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
 
double DepthAt (double x, double y) const
 
- Public Member Functions inherited from marenv::seafloor::BathymetryField
virtual ~BathymetryField ()=default
 Virtual destructor.
 
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)
 

Static Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from marenv::seafloor::BathymetryField
 BathymetryField ()=default
 Constructor is empty.
 
- Static Protected Member Functions inherited from marenv::seafloor::BathymetryField
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

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

◆ 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: