Skip to main content

A command-line tool to run batch processes of Capytaine simulations for hydrodynamic analysis.

Project description

fleetmaster

Release Build status codecov Commit activity License

A command-line tool to run batch processes of Capytaine simulations for hydrodynamic analysis.

Installation

Using uv:

uv sync

Run CLI commands with:

uv run fleetmaster --help

Typical usage

Run a simulation batch from a YAML settings file:

uv run fleetmaster run --settings-file examples/settings_rotations.yml

Run directly from CLI options:

uv run fleetmaster run examples/boxship_t_1_r_00_00_00.stl --wave-periods 8 --wave-directions 0 --water-depth inf --water-level 0 --forward-speed 0

Dhyd workflows

Fleetmaster supports two easy ways to create a standalone mafredo hydrodynamic database (.dhyd).

1) Write .dhyd while running simulations

Set output_dhyd_file in your settings file, or pass --output-dhyd-file on the CLI. If you only want auto-generated files based on the case names, use export_to_hyd or --export-to-hyd.

Example (settings file):

output_hdf5_file: "single_case.hdf5"
output_dhyd_file: "single_case.dhyd"

Example (settings file, automatic filename):

output_hdf5_file: "single_case.hdf5"
export_to_hyd: true

Example (CLI):

uv run fleetmaster run examples/boxship_t_1_r_00_00_00.stl --wave-periods 8 --wave-directions 0 --water-depth inf --water-level 0 --forward-speed 0 --output-dhyd-file examples/single_case.dhyd

Example (CLI, automatic filename based on case):

uv run fleetmaster run examples/boxship_t_1_r_00_00_00.stl --wave-periods 8 --wave-directions 0 --water-depth inf --water-level 0 --forward-speed 0 --export-to-hyd

Notes:

  • export_to_hyd writes a .dhyd file for every case while still writing all results to the HDF5 database.
  • Without an explicit output_dhyd_file, Fleetmaster uses <case_name>.dhyd next to the HDF5 output file.
  • With an explicit output_dhyd_file and multiple cases, Fleetmaster uses that filename as a base and appends the case name.
  • If a case already exists in the HDF5 and update_cases is disabled, that case is skipped.

Symmetry in .dhyd output

To write heading symmetry metadata to the generated .dhyd file, set:

heading_symmetry: true

Recommended in combination with:

grid_symmetry: true

With heading_symmetry: true, Fleetmaster writes XZ heading symmetry metadata to .dhyd.

2) Inspect cases or plot a theta/period grid

List simulation cases:

uv run fleetmaster list results.hdf5 --cases

Create a quick grid plot for one case:

uv run fleetmaster plot results.hdf5 boxship_wd_inf_wl_0_fs_0

Write the plot to a specific PNG:

uv run fleetmaster plot results.hdf5 boxship_wd_inf_wl_0_fs_0 --output boxship_grid.png

Create additional hydrodynamic plots using mafredo (enabled by default):

uv run fleetmaster plot results.hdf5 boxship_wd_inf_wl_0_fs_0 --show

Save the mafredo hydrodynamic figures as PNG files:

uv run fleetmaster plot results.hdf5 boxship_wd_inf_wl_0_fs_0 --save-hyd-plots

Write mafredo hydrodynamic figures to a custom directory:

uv run fleetmaster plot results.hdf5 boxship_wd_inf_wl_0_fs_0 --save-hyd-plots --hyd-output-dir output/hyd_plots

Disable mafredo hydrodynamic plotting and keep only the theta/period grid plot:

uv run fleetmaster plot results.hdf5 boxship_wd_inf_wl_0_fs_0 --no-hyd-plot

3) Export .dhyd from an existing HDF5 database (without rerunning Capytaine)

List cases in an existing HDF5:

uv run fleetmaster export-dhyd results.hdf5 --list-cases

Export one specific case:

uv run fleetmaster export-dhyd results.hdf5 --case boxship_wd_inf_wl_0_fs_0 --output boxship_case.dhyd

Export all cases in one go:

uv run fleetmaster export-dhyd results.hdf5

Overwrite an existing output file:

uv run fleetmaster export-dhyd results.hdf5 --case boxship_wd_inf_wl_0_fs_0 --output boxship_case.dhyd --overwrite

Example settings

For a ready-to-use single-case example, see:

  • examples/settings_single_case_nc.yml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fleetmaster-0.3.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fleetmaster-0.3.0-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

Details for the file fleetmaster-0.3.0.tar.gz.

File metadata

  • Download URL: fleetmaster-0.3.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for fleetmaster-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9f2367f6a481c62d7c2dffdddc2dabba31ccaddda48b3d353bd9e6d16fef503b
MD5 d3e423db7382a935e942ad43ad50f226
BLAKE2b-256 1f68caddf62d69c760a60f044e49fab0089247f1cc0bd33bdfeb6c42a81f2f1d

See more details on using hashes here.

File details

Details for the file fleetmaster-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: fleetmaster-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 47.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for fleetmaster-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6dd18a82ee335eb4f021823b5bdabaa45e0abc1460ca60634c86aa3e4d027ba
MD5 cd36b0d0aa7b8505765ebf6300b399c7
BLAKE2b-256 ef102156dc23942d248cb2bf061bc273097dfea941cfc15e8ee63ac7c52b0b8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page