FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches

Scalar environment fields: temperature, salinity and concentration. More...

+ Collaboration diagram for Scalar Fields:

Classes

class  marenv::field::ConstantScalarField
 
class  marenv::field::DepthLayeredScalarField
 
struct  marenv::field::BeamProfileQuery
 
class  marenv::field::IntegrableField
 
class  marenv::field::ParametricScalarField
 
struct  marenv::field::Property
 
class  marenv::field::ScalarField
 

Enumerations

enum class  marenv::field::Quantity { marenv::field::Quantity::Temperature , marenv::field::Quantity::Salinity , marenv::field::Quantity::SpeciesConcentration , marenv::field::Quantity::Other }
 

Functions

marenv::calc::DepthProfile marenv::field::MakeDepthProfile (std::vector< double > depths, std::vector< double > values, const std::string &context)
 

Detailed Description

The scalar field interface with its static metadata (name, quantity, unit and properties), the constant and depth-layered fields, and the interface of a field whose beam-weighted line integral is needed.

Enumeration Type Documentation

◆ Quantity

enum class marenv::field::Quantity
strong

Advisory tag describing what a scalar field measures.

The tag is metadata only: it is not enforced against the values a field returns, and two fields with the same quantity may use different units. Its purpose is to let a consumer discover the fields of a given kind through the field registry of fhsim_environment (EnvironmentProvider::GetScalarFieldNames) instead of hard-coding field names.

Enumerator
Temperature 

Water temperature, conventionally [degC].

Salinity 

Water salinity, conventionally [PSU].

SpeciesConcentration 

Biomass concentration of one species, conventionally [kg/m^3].

Other 

Anything else.

Function Documentation

◆ MakeDepthProfile()

marenv::calc::DepthProfile marenv::field::MakeDepthProfile ( std::vector< double >  depths,
std::vector< double >  values,
const std::string &  context 
)

Builds the validated vertical profile of a scalar field (W-30).

Shared by DepthLayeredScalarField and by the depth_profile background of ParametricScalarField, so that both accept exactly the same profiles; the profile is marenv's one depth-profile type (marenv::calc::DepthProfile, owner ruling R122): linear between the layers, clamped to the shallowest or deepest layer outside them with marenv::Status::OUT_OF_RANGE_INACCURATE (a temperature of 0 degC or a salinity of 0 PSU would be misleading), and marenv::Status::ERROR_NOT_SET with the value 0 for a NaN depth.

Parameters
[in]depthsLayer coordinates [m], strictly increasing. At least two entries.
[in]valuesValue at each layer. Same length as depths.
[in]contextPrefix for the exception message, e.g. ‘DepthLayeredScalarField 'X’`.
Returns
The profile.
Exceptions
std::invalid_argument,itsmessage prefixed by context, if the lists differ in length, if fewer than two layers are given, if a depth or a value is not finite (ENV-0060), or if the depths are not strictly increasing.