|
FhSim
3.1.0
Marine systems simulation
|
#include <CurrentField3DArray.h>
Inheritance diagram for marenv::current::CurrentField3DArray:
Collaboration diagram for marenv::current::CurrentField3DArray:Public Member Functions | |
| CurrentField3DArray (std::vector< double > velocityX, std::vector< double > velocityY, std::vector< double > velocityZ, int numX, int numY, int numZ, std::vector< double > depthZ, double lengthX, double lengthY) | |
| Status | GetCurrent (double time, const double position[3], double currentVelocity[3]) override |
Public Member Functions inherited from marenv::current::CurrentField | |
| virtual | ~CurrentField ()=default |
| Virtual destructor. | |
Ocean current using a 3D array representation.
This class models an ocean current field defined on a structured 3D grid. Current velocity components (x, y, z) are stored in vectors across spatial dimensions, allowing queries of current velocity at arbitrary positions in space and time.
Horizontally the box spans (numX - 1) lengthX by (numY - 1) lengthY, centred on the origin; outside it there are no data and the current is zero with Status::ERROR_NOT_SET (owner ruling R122 (iv)). In depth the layers are a calc::DepthAxis: linear between them, the value of the nearest layer above the first and below the last, with Status::OUT_OF_RANGE_INACCURATE (R122 (iii), MENV-0053), a usable value that EnvironmentFacade sums. Above the surface (z < 0) the surface value applies.
| marenv::current::CurrentField3DArray::CurrentField3DArray | ( | std::vector< double > | velocityX, |
| std::vector< double > | velocityY, | ||
| std::vector< double > | velocityZ, | ||
| int | numX, | ||
| int | numY, | ||
| int | numZ, | ||
| std::vector< double > | depthZ, | ||
| double | lengthX, | ||
| double | lengthY | ||
| ) |
Constructs a 3D current field.
| [in] | velocityX | X-component velocities [m/s]. |
| [in] | velocityY | Y-component velocities [m/s]. |
| [in] | velocityZ | Z-component velocities [m/s]. |
| [in] | numX | Number of grid points in the x-direction. |
| [in] | numY | Number of grid points in the y-direction. |
| [in] | numZ | Number of grid points in the z-direction (depth layers). |
| [in] | depthZ | Depth values [m] corresponding to z-layers. |
| [in] | lengthX | Grid spacing in the x-direction [m]; the domain spans (numX - 1) * lengthX, centred on x = 0. |
| [in] | lengthY | Grid spacing in the y-direction [m]; the domain spans (numY - 1) * lengthY, centred on y = 0. |
| std::invalid_argument | unless depthZ has numZ entries, at least two, finite and strictly increasing (calc::DepthAxis). |
|
overridevirtual |
Returns the ocean current velocity at a given position.
| [in] | time | Simulation time [s]. |
| [in] | position | Position (x,y,z) in meters where the current is queried. |
| [out] | currentVelocity | Current velocity vector [m/s] at the given position. |
Implements marenv::current::CurrentField.