capytaine.bodies.abstract_bodies module

Abstract base class for floating bodies.

class capytaine.bodies.abstract_bodies.AbstractBody[source]

Bases: ABC

Abstract base class for FloatingBody and Multibody.

Defines the shared interface that both single bodies and collections of bodies must implement.

Subclasses must provide the following attributes (either as instance attributes set in __init__, or as properties/cached_properties):

name: str mesh lid_mesh mesh_including_lid hull_mask dofs: dict mass center_of_mass

add_dofs_labels_to_matrix(matrix)[source]

Helper function turning a bare matrix into a matrix labelled by the name of the dofs of the body, to be used for instance for the computation of RAO.

add_dofs_labels_to_vector(vector)[source]

Helper function turning a bare vector into a vector labelled by the name of the dofs of the body, to be used for instance for the computation of RAO.

abstractmethod clipped(*, origin, normal, name=None) AbstractBody[source]
abstractmethod compute_hydrostatic_stiffness(*, rho=1000.0, g=9.81)[source]
abstractmethod compute_rigid_body_inertia(rho=1000.0)[source]
abstractmethod copy(name=None) AbstractBody[source]
abstractmethod first_irregular_frequency_estimate(*args, **kwargs)[source]
abstractmethod immersed_part(free_surface=0.0, *, sea_botton=None, water_depth=None, name=None) AbstractBody[source]
abstractmethod integrate_pressure(pressure)[source]
join_bodies(*, name=None) Multibody[source]
abstractmethod minimal_computable_wavelength()[source]
abstractmethod mirrored(plane: Literal['xOz', 'yOz']) AbstractBody[source]
name: str
abstractmethod rename(name)[source]
abstractmethod rotated_with_matrix(R, *, name=None) AbstractBody[source]
rotated_x(angle: float, *, name=None) AbstractBody[source]
rotated_y(angle: float, *, name=None) AbstractBody[source]
rotated_z(angle: float, *, name=None) AbstractBody[source]
abstractmethod translated(shift, *, name=None) AbstractBody[source]
translated_x(dx: float, *, name=None) AbstractBody[source]
translated_y(dy: float, *, name=None) AbstractBody[source]
translated_z(dz: float, *, name=None) AbstractBody[source]