Virtual Testbed
Ship dynamics simulator for extreme conditions
|
Rigid ship with a mass and translational and angular velocity. More...
#include <ship.hh>
Classes | |
union | state_vector_type |
Public Types | |
using | scalar_type = T |
using | vec3 = blitz::TinyVector< T, 3 > |
using | hull_type = Hull< T > |
using | room_type = Compartment< T > |
using | room_array = Compartment_array< T > |
using | propulsor_type = Propulsor< T > |
using | mass_type = Mass< T > |
using | mass_array_type = Mass_array< T > |
using | matrix_type = blitz::TinyMatrix< T, 3, 3 > |
using | coordinate_system_type = vtb::geometry::Coordinate_system< T, 3 > |
using | quaternion_coordinate_system_type = vtb::geometry::Quaternion_coordinate_system< T > |
using | rotation_matrix_type = vtb::geometry::Rotation_matrix< T, 3 > |
using | basis_type = vtb::geometry::Basis< T, 3 > |
using | quaternion_type = vtb::geometry::Quaternion< T > |
using | variables_type = typename state_vector_type::variables_type |
Public Member Functions | |
const vec3 & | position (int i=0) const |
Get position or its time derivatives in Earth-fixed coordinate system. More... | |
void | position (int i, const vec3 &rhs) |
Set position or its time derivatives in Earth-fixed coordinate system. More... | |
const vec3 & | velocity () const |
Get velocity in Earth-fixed coordinate system. | |
void | velocity (const vec3 &rhs) |
Set velocity in Earth-fixed coordinate system. | |
const vec3 & | acceleration () const |
Acceleration in Earth-fixed coordinate system. | |
const vec3 & | angular_displacement (int i=0) const |
Get angular position or its time derivatives in Earth-fixed coordinate system. More... | |
vec3 | euler_angles () const |
Get Euler angles or their derivatives. More... | |
const quaternion_type & | quaternion () const |
Get rotation quaternion. | |
void | euler_angles (const vec3 &rhs) |
Set Euler angles and rotation quaternion/matrix. | |
void | quaternion (const quaternion_type &q) |
Set rotation quaternion and update rotation quaternion/matrix. | |
T | roll () const |
Counterclockwise rotation about \(x\)-axis in radians. More... | |
T | pitch () const |
Counterclockwise rotation about \(y\)-axis in radians. More... | |
T | yaw () const |
Counterclockwise rotation about \(z\)-axis in radians. More... | |
T | surge (int i=0) const |
\(x\) coordinate of the position. More... | |
T | sway (int i=0) const |
\(y\) coordinate of the position. More... | |
T | heave (int i=0) const |
\(z\) coordinate of the position. More... | |
const vec3 & | angular_velocity () const |
Angular velocity in Earth-fixed coordinate system. | |
void | angular_velocity (const vec3 &rhs) |
Set angular velocity in Earth-fixed coordinate system. | |
const vec3 & | angular_acceleration () const |
Angular acceleration in Earth-fixed coordinate system. | |
const vec3 & | angular_momentum () const |
Angular momentum. | |
void | angular_momentum (const vec3 &rhs) |
Set angular momentum. | |
void | state_vector (const state_vector_type &v, const state_vector_type &dv, T dt) |
Set ship position, orientation and velocities from a state vector. More... | |
void | state_vector (const variables_type &v, const variables_type &dv, T dt) |
state_vector_type | state_vector () const |
Get state vector for ship motion equation. More... | |
void | reset () |
const hull_type & | hull () const |
void | hull (hull_type &&rhs) |
void | hull (const hull_type &rhs) |
void | compartments (const room_array &rhs) |
room_array & | compartments () |
const room_array & | compartments () const |
const propulsor_type & | propulsor () const |
void | propulsor (const propulsor_type &rhs) |
scalar_type | mass () const |
T | flooded_mass () const |
Total mass of all fluid volumes inside compartments. | |
void | mass (scalar_type rhs) |
void | displacement (scalar_type rhs) |
scalar_type | displacement () const |
void | draught (scalar_type rhs) |
coordinate_system_type | earth_fixed_coordinate_system () const |
quaternion_coordinate_system_type | body_fixed_coordinate_system () const |
const rotation_matrix_type & | rotation_matrix () const |
const rotation_matrix_type & | inertia_matrix () const |
Inertia matrix in body-fixed coordinate system. More... | |
void | dump (std::ostream &out) const |
Friends | |
template<class X > | |
std::ostream & | operator<< (std::ostream &out, const Ship< X > &rhs) |
template<class X > | |
bstream & | operator<< (bstream &out, const Ship< X > &rhs) |
template<class X > | |
bstream & | operator>> (bstream &in, Ship< X > &rhs) |
Rigid ship with a mass and translational and angular velocity.
Definition at line 186 of file core/ship.hh.
|
inline |
Get angular position or its time derivatives in Earth-fixed coordinate system.
i | derivative order (0 means no derivative). |
Definition at line 272 of file core/ship.hh.
Referenced by vtb::core::Ship< T >::angular_acceleration(), and vtb::core::Ship< T >::angular_velocity().
|
inline |
Get Euler angles or their derivatives.
i | derivative order (0 means no derivative). |
Definition at line 278 of file core/ship.hh.
Referenced by vtb::core::Ship< T >::pitch(), vtb::core::Ship< T >::roll(), and vtb::core::Ship< T >::yaw().
|
inline |
\(z\) coordinate of the position.
i | derivative order (0 means no derivative). |
Definition at line 311 of file core/ship.hh.
|
inline |
Inertia matrix in body-fixed coordinate system.
Inertia matrix \(\mathcal{I}\) is calculated from inertia tensor \(I\) as follows:
\[ \mathcal{I} = \begin{array}{ccc} I_x & -I_{xy} & -I_{xz} \\ -I_{yx} & -I_y & -I_{yz} \\ -I_{zx} & -I_{zy} & -I_z \end{array}. \]
Definition at line 418 of file core/ship.hh.
|
inline |
Counterclockwise rotation about \(y\)-axis in radians.
i | derivative order (0 means no derivative). |
Definition at line 295 of file core/ship.hh.
References vtb::core::Ship< T >::euler_angles().
|
inline |
Get position or its time derivatives in Earth-fixed coordinate system.
i | derivative order (0 means no derivative). |
Definition at line 253 of file core/ship.hh.
Referenced by vtb::core::Ship< T >::acceleration(), vtb::core::Gerstner_solver_openmp< T >::generate_field(), and vtb::core::Ship< T >::velocity().
|
inline |
Set position or its time derivatives in Earth-fixed coordinate system.
i | derivative order (0 means no derivative). |
Definition at line 257 of file core/ship.hh.
|
inline |
Counterclockwise rotation about \(x\)-axis in radians.
i | derivative order (0 means no derivative). |
Definition at line 291 of file core/ship.hh.
References vtb::core::Ship< T >::euler_angles().
void vtb::core::Ship< T >::state_vector | ( | const state_vector_type & | v, |
const state_vector_type & | dv, | ||
T | dt | ||
) |
Set ship position, orientation and velocities from a state vector.
Definition at line 73 of file core/ship.cc.
auto vtb::core::Ship< T >::state_vector | ( | ) | const |
Get state vector for ship motion equation.
Definition at line 62 of file core/ship.cc.
|
inline |
\(x\) coordinate of the position.
i | derivative order (0 means no derivative). |
Definition at line 303 of file core/ship.hh.
|
inline |
\(y\) coordinate of the position.
i | derivative order (0 means no derivative). |
Definition at line 307 of file core/ship.hh.
|
inline |
Counterclockwise rotation about \(z\)-axis in radians.
i | derivative order (0 means no derivative). |
Definition at line 299 of file core/ship.hh.
References vtb::core::Ship< T >::euler_angles().