Modules¶
Command-line interface (CLI) for Fleetmaster.
This module provides the main entrypoint for the Fleetmaster CLI, a tool for
running hydrodynamic simulations with Capytaine. It uses the click library
to define the main command group and handles global options like version and
verbosity.
Functions:
| Name | Description |
|---|---|
cli |
The main CLI entrypoint that registers subcommands and sets up logging. |
Commands
run: Runs a batch of Capytaine simulations based on a settings file or CLI options. gui: Launches the Fleetmaster graphical user interface (GUI).
cli(verbose)
¶
The main entrypoint for the Fleetmaster CLI.
This function configures the application's logging level based on the --verbose flag and registers all available subcommands.
Source code in src\fleetmaster\cli.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
EngineMesh
dataclass
¶
Represents a mesh object with its configuration.
Source code in src\fleetmaster\core\engine.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
copy()
¶
Creates a deep copy of the EngineMesh instance.
Source code in src\fleetmaster\core\engine.py
37 38 39 40 41 42 43 | |
add_mesh_to_database(output_file, mesh_to_add, mesh_name, overwrite=False, mesh_config=None)
¶
Adds a mesh and its geometric properties to the HDF5 database under the MESH_GROUP_NAME.
Checks if the mesh already exists by comparing SHA256 hashes.
If the data is different, it will either raise a warning or overwrite if overwrite is True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mesh_to_add
|
Trimesh
|
The trimesh object of the mesh to be added. |
required |
Source code in src\fleetmaster\core\engine.py
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | |
create_hyddb_from_capytaine_file(filename)
¶
Loads hydrodynamic data from a dataset produced with capytaine.
- Wave forces,
- radiation_damping and
- added_mass are read.
See Also
Rao.wave_force_from_capytaine
Source code in src\fleetmaster\core\engine.py
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 | |
create_rao_from_capytaine_wave_force(dataset, mode)
¶
Reads hydrodynamic data from a netCFD file created with capytaine and copies the data for the requested mode into the object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset
|
the xarray.Dataset read from the capytaine netCDF file |
required |
mode
|
Any
|
Name of the mode to read MotionMode |
required |
Returns:
| Type | Description |
|---|---|
Any
|
None |
Examples:
_test = Rao() _test.wave_force_from_capytaine(r"capytaine.nc", MotionMode.HEAVE)
Source code in src\fleetmaster\core\engine.py
1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 | |
export_hdf5_case_to_dhyd(hdf5_file, case_group, output_dhyd_file, *, overwrite=False)
¶
Exports one simulation case group from the Fleetmaster HDF5 database to a standalone .dhyd file.
Source code in src\fleetmaster\core\engine.py
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | |
export_hdf5_cases_to_dhyd(hdf5_file, case_groups=None, output_dhyd_file=None, *, overwrite=False)
¶
Exports one or more simulation case groups from the Fleetmaster HDF5 database to standalone .dhyd files.
Source code in src\fleetmaster\core\engine.py
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | |
list_case_groups_in_hdf5(hdf5_file)
¶
Lists all simulation case groups in an HDF5 database (excluding the meshes group).
Source code in src\fleetmaster\core\engine.py
617 618 619 620 621 622 623 624 625 | |
make_database(body, omegas, wave_directions, water_depth, water_level, forward_speed, case_label=None)
¶
Create a dataset of BEM results for a given body and conditions.
Source code in src\fleetmaster\core\engine.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
run_simulation_batch(settings)
¶
Runs a batch of Capytaine simulations and saves all results to a single HDF5 file.
If settings.drafts is provided, it generates new meshes by translating a single
base STL file for each draft. Otherwise, it processes the provided list of STL files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
SimulationSettings
|
A SimulationSettings object with all necessary parameters. |
required |
Source code in src\fleetmaster\core\engine.py
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 | |
Main window of the Fleetmaster GUI.
MainWindow
¶
Bases: QMainWindow
Main window of the Fleetmaster GUI.
Source code in src\fleetmaster\gui\main_window.py
8 9 10 11 12 13 14 15 | |
__init__()
¶
Initialize the main window.
Source code in src\fleetmaster\gui\main_window.py
11 12 13 14 15 | |
main()
¶
Create and show the main window.
Source code in src\fleetmaster\gui\main_window.py
18 19 20 21 22 23 | |