Skip to content

Commit

Permalink
Small bathymetry update
Browse files Browse the repository at this point in the history
-- bathymetry input can now be a dictionary with 'x':x vector 'y':y vector 'depth': depth grid
  • Loading branch information
lsirkis committed Sep 19, 2024
1 parent e226c84 commit 4dce27f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions moorpy/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,14 @@ def __init__(self, file="", dirname="", rootname="", depth=0, rho=1025, g=9.81,

if 'bathymetry' in kwargs:
self.seabedMod = 2
self.bathGrid_Xs, self.bathGrid_Ys, self.bathGrid = readBathymetryFile(kwargs['bathymetry'])

if isinstance(kwargs['bathymetry'],str):
self.bathGrid_Xs, self.bathGrid_Ys, self.bathGrid = readBathymetryFile(kwargs['bathymetry'])
elif isinstance(kwargs['bathymetry'],dict):
bath_dictionary = kwargs['bathymetry']
# grid sent in, just assign to properties
self.bathGrid_Xs = bath_dictionary['x']
self.bathGrid_Ys = bath_dictionary['y']
self.bathGrid = bath_dictionary['depth']

# initializing variables and lists
self.nDOF = 0 # number of (free) degrees of freedom of the mooring system (needs to be set elsewhere)
Expand Down

0 comments on commit 4dce27f

Please sign in to comment.