template <class T>
class vtb::core::Ship

Rigid ship with a mass and translational and angular velocity.

  • All quantities are in Earth-fixed coordinate system if not stated otherwise.

Types
Unions
  • union vtb::core::Ship::state_vector_type
Methods
  • dump(std::ostream & out) const -> void
  • inertia_tensor() const -> const inertia_tensor_type &

    Inertia tensor in body-fixed coordinate system.

  • volume() const -> scalar_type

    Total volume of the ship hull.

  • abovewater_volume(scalar_type rhs) -> void
  • underwater_volume(scalar_type rhs) -> void
  • centre_of_wind(const vec3 & rhs) -> void
  • centre_of_floatation(const vec3 & rhs) -> void
  • centre_of_buoyancy(const vec3 & rhs) -> void
  • abovewater_volume() const -> scalar_type

    The volume of the ship hull that is above the water. Computed with respect to centre of floatation.

  • underwater_volume() const -> scalar_type

    The volume of the ship hull that is under the water. Computed with respect to centre of floatation.

  • centre_of_wind() const -> const vec3 &

    A point of application of wind forces (a centre of buoyancy for air).

  • centre_of_floatation() const -> const vec3 &

    A point around which the ship rotates. Computed as the centre of waterline 3-d polygon. All force moments are computed with respect to this point.

  • centre_of_buoyancy() const -> const vec3 &

    A point of application of buoyant and Froude—Krylov forces.

  • centre_of_gravity() const -> const vec3 &

    Centre of mass. Always equals ship position. A point of application of gravity force.

  • rotation_matrix() const -> const rotation_matrix_type &
  • body_fixed_coordinate_system() const -> quaternion_coordinate_system_type
  • earth_fixed_coordinate_system() const -> coordinate_system_type
  • draught(scalar_type rhs) -> void
  • displacement() const -> scalar_type
  • displacement(scalar_type rhs) -> void
  • mass(scalar_type rhs) -> void
  • flooded_mass() const -> T

    Total mass of all fluid volumes inside compartments.

  • mass() const -> scalar_type
  • propulsor(const propulsor_type & rhs) -> void
  • propulsor() const -> const propulsor_type &
  • compartments() const -> const room_array &
  • compartments() -> room_array &
  • compartments(const room_array & rhs) -> void
  • hull(hull_type rhs) -> void
  • hull() const -> const hull_type &
  • reset() -> void
  • state_vector() const -> state_vector_type

    Get state vector for ship motion equation.

    Date
    2018-07-31
    Author
    Ivan Gankevich
  • state_vector(const variables_type & v, const variables_type & dv, T dt) -> void
  • state_vector(const state_vector_type & v, const state_vector_type & dv, T dt) -> void

    Set ship position, orientation and velocities from a state vector.

    Date
    2018-07-19
    Author
    Ivan Gankevich
  • angular_momentum(const vec3 & rhs) -> void

    Set angular momentum.

  • angular_momentum() const -> const vec3 &

    Angular momentum.

  • angular_acceleration() const -> const vec3 &

    Angular acceleration in Earth-fixed coordinate system.

  • angular_velocity(const vec3 & rhs) -> void

    Set angular velocity in Earth-fixed coordinate system.

  • angular_velocity() const -> const vec3 &

    Angular velocity in Earth-fixed coordinate system.

  • heave(int i = 0) const -> T

    coordinate of the position.

    i
    derivative order (0 means no derivative).

  • sway(int i = 0) const -> T

    coordinate of the position.

    i
    derivative order (0 means no derivative).

  • surge(int i = 0) const -> T

    coordinate of the position.

    i
    derivative order (0 means no derivative).

  • yaw() const -> T

    Counterclockwise rotation about -axis in radians.

  • pitch() const -> T

    Counterclockwise rotation about -axis in radians.

  • roll() const -> T

    Counterclockwise rotation about -axis in radians.

  • quaternion(const quaternion_type & q) -> void

    Set rotation quaternion and update rotation quaternion/matrix.

  • euler_angles(const vec3 & rhs) -> void

    Set Euler angles and rotation quaternion/matrix.

  • quaternion() const -> const quaternion_type &

    Get rotation quaternion.

  • euler_angles() const -> vec3

    Get Euler angles or their derivatives.

  • angular_displacement(int i = 0) const -> const vec3 &

    Get angular position or its time derivatives in Earth-fixed coordinate system.

    i
    derivative order (0 means no derivative).

  • acceleration() const -> const vec3 &

    Acceleration in Earth-fixed coordinate system.

  • velocity(const vec3 & rhs) -> void

    Set velocity in Earth-fixed coordinate system.

  • velocity() const -> const vec3 &

    Get velocity in Earth-fixed coordinate system.

  • position(int i, const vec3 & rhs) -> void

    Set position or its time derivatives in Earth-fixed coordinate system.

    i
    derivative order (0 means no derivative).

    rhs
    new value

  • position(int i = 0) const -> const vec3 &

    Get position or its time derivatives in Earth-fixed coordinate system.

    i
    derivative order (0 means no derivative).

Friends
  • template <class X>
    operator<<
template <class T>
operator<<(std::ostream & out, const Ship< T > & rhs) -> std::ostream &