|
FhSim
3.1.0
Marine systems simulation
|
#include <EnvironmentQuantityField.h>
Inheritance diagram for util::EnvironmentQuantityField:
Collaboration diagram for util::EnvironmentQuantityField:Public Member Functions | |
| EnvironmentQuantityField (environment::EnvironmentProvider &environment, FieldQuantity quantity, const marenv::WaterVelocityParts &terms, const double axis[3]) | |
| marenv::Status | GetValue (double time, const double position[3], double &value) const override |
| void | GetValues (double time, std::span< const std::array< double, 3 > > positions, std::span< double > values, std::span< marenv::Status > statuses) const override |
| bool | IsThreadSafe () const override |
| True: the marenv fields allow concurrent readers. | |
A quantity of the environment (any FieldQuantity but Scalar) as an unregistered scalar field.
So the baking of util::BakeScalarField serves the flow, the waves and the wakes as it serves the registered scalar fields. Thread-safe by the reader contract of the marenv fields (CurrentField::GetCurrent(), WaveField, WakeField::Sample()): the visualisers sample it in parallel while the simulation waits. Never time-invariant.
| util::EnvironmentQuantityField::EnvironmentQuantityField | ( | environment::EnvironmentProvider & | environment, |
| FieldQuantity | quantity, | ||
| const marenv::WaterVelocityParts & | terms, | ||
| const double | axis[3] | ||
| ) |
Construct the field.
| [in] | environment | Environment sampled; must outlive the field. |
| [in] | quantity | Quantity to sample; not Scalar. |
| [in] | terms | The velocity parts of Speed and Component; ignored otherwise. |
| [in] | axis | Direction of Component, normalised here; ignored otherwise. |
| std::invalid_argument | for Scalar, or for Component with a zero axis. |
|
override |
The quantity at a point.
| [in] | time | Simulation time [s]. |
| [in] | position | Position in the NED frame [m]. |
| [out] | value | The quantity. |
|
override |
The quantity at many points: GetValue() at each, bit for bit, the wake and jet fields loaded once per call.
Speed, Component and Deficit go through the environment's batch queries (marenv::EnvironmentFacade::GetWaterVelocities(), EnvironmentProvider::GetWakeDeficits()); the wave quantities point by point.