capytaine.io.legacy module

Import or export Nemoh.cal files for backward compatibility with Nemoh 2.

capytaine.io.legacy.export_hydrostatics(hydrostatics_directory, bodies)[source]

Export rigid body hydrostatics in Nemoh’s format (KH.dat and Hydrostatics.dat).

Parameters:
  • hydrostatics_directory (string) – Path to the directory in which the data will be written (two files per body)

  • bodies (FloatingBody or list of FloatingBody) – The body or the list of bodies. Each body is assumed to be a single rigid body with 6 dofs. Each FloatingBody object is expected to have an inertia_matrix and a hydrostatic_stiffness parameter.

Return type:

None

capytaine.io.legacy.import_cal_file(filepath)[source]

Read a Nemoh.cal file and return a list of problems.

capytaine.io.legacy.run_cal_file(paramfile)[source]
capytaine.io.legacy.write_dataset_as_tecplot_files(results_directory, data)[source]

Write some of the data from a xarray dataset into legacy tecplot file outputs.