capytaine.bodies.dofs module

class capytaine.bodies.dofs.AbstractDof[source]

Bases: ABC

evaluate_gradient_of_motion(mesh: AbstractMesh) ndarray[source]
abstractmethod evaluate_gradient_of_motion_at_points(points: ndarray) ndarray[source]
evaluate_motion(mesh: AbstractMesh) ndarray[source]
abstractmethod evaluate_motion_at_points(points: ndarray) ndarray[source]
class capytaine.bodies.dofs.DofOnSubmesh(dof: AbstractDof, faces)[source]

Bases: AbstractDof

Defines a dof that is zeros everywhere except on a given set of faces on which another dof object is used for the definition.

Parameters:
  • dof (AbstractDof) – Some other dof

  • faces (boolean array (or slice or range)) – The indices of the faces on which the dof should be evaluated. Can be provided as a list of indices or a slice, or as a boolean array of size nb_faces the total size of the mesh on which this dof is defined.

evaluate_gradient_of_motion_at_points(points: ndarray) ndarray[source]
evaluate_motion_at_points(points: ndarray) ndarray[source]
class capytaine.bodies.dofs.RotationDof(rotation_center, direction)[source]

Bases: AbstractDof

evaluate_gradient_of_motion_at_points(points: ndarray) ndarray[source]
evaluate_motion_at_points(points: ndarray) ndarray[source]
class capytaine.bodies.dofs.TranslationDof(direction)[source]

Bases: AbstractDof

evaluate_gradient_of_motion_at_points(points: ndarray) ndarray[source]
evaluate_motion_at_points(points: ndarray) ndarray[source]
capytaine.bodies.dofs.add_dofs_labels_to_matrix(dof_names, matrix)[source]

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

capytaine.bodies.dofs.add_dofs_labels_to_vector(dof_names, vector)[source]

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

capytaine.bodies.dofs.is_rigid_body_dof(dof)[source]
capytaine.bodies.dofs.normalize_name(name)[source]
capytaine.bodies.dofs.rigid_body_dofs(only=None, rotation_center=None)[source]

Pass this to FloatingBody initializer to give it rigid body dofs.

Parameters:
  • only (sequence of str, optional) – list of the name of the rigid body dofs to be included. By default: all six of them

  • rotation_center (np.array, optional) – the center for the definition of the rotations