Skip to content

Commit

Permalink
Add warnings when adding inertia and hydrostatic stiffness automatica…
Browse files Browse the repository at this point in the history
  • Loading branch information
jtgrasb authored May 15, 2024
1 parent d9f8907 commit c218780
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wecopttool/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2175,8 +2175,16 @@ def run_bem(
wec_im = fb.copy(name=f"{fb.name}_immersed").keep_immersed_part()
wec_im = set_fb_centers(wec_im, rho=rho)
if not hasattr(wec_im, 'inertia_matrix'):
_log.warning('FloatingBody has no inertia_matrix field. ' +
'If the FloatingBody mass is defined, it will be ' +
'used for calculating the inertia matrix here. ' +
'Otherwise, the neutral buoyancy assumption will ' +
'be used to auto-populate.')
wec_im.inertia_matrix = wec_im.compute_rigid_body_inertia(rho=rho)
if not hasattr(wec_im, 'hydrostatic_stiffness'):
_log.warning('FloatingBody has no hydrostatic_stiffness field. ' +
'Capytaine will auto-populate the hydrostatic ' +
'stiffness based on the provided mesh.')
wec_im.hydrostatic_stiffness = wec_im.compute_hydrostatic_stiffness(rho=rho, g=g)
bem_data = solver.fill_dataset(
test_matrix, wec_im, n_jobs=njobs, **write_info)
Expand Down

0 comments on commit c218780

Please sign in to comment.