capytaine.bodies.abstract_bodies module¶
Abstract base class for floating bodies.
- class capytaine.bodies.abstract_bodies.AbstractBody[source]¶
Bases:
ABCAbstract 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 copy(name=None) AbstractBody[source]¶
- abstractmethod immersed_part(free_surface=0.0, *, sea_botton=None, water_depth=None, name=None) AbstractBody[source]¶
- abstractmethod mirrored(plane: Literal['xOz', 'yOz']) AbstractBody[source]¶
- name: str¶
- 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]¶