Skip to content

Commit

Permalink
Remove unneeded printouts from helpers, fix small subsystem bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lsirkis committed Jun 6, 2024
1 parent 2f330c8 commit 5b5d59f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions moorpy/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,6 @@ def lines2subsystem(lines,ms,span=None,case=0):
if lines[i]<lines[j]:
lines[j] -= 1
# delete old line and any necessary points
print('deleting line ',originalList[i])
helpers.deleteLine(ms,lines[i],delpts)

# print('Replacing lines ',originalList,' with a subsystem appended to the end of the lineList ')
Expand Down Expand Up @@ -1297,11 +1296,9 @@ def subsystem2Line(ms,ssNum,nsegs=10):
if spt.attachedEndB[-1]:
endB = i
points[endB]['r'] = ss.rB
print('endB: ',endB)
if spt.attachedEndB[0] == 0:
endA = i
points[endA]['r'] = ss.rA
print('endA: ',endA)
# get actual r of end points (r in subsystem is not true location)
for i in range(0,len(ms.pointList)):
# check if point is attached to the subsystem line
Expand All @@ -1321,7 +1318,7 @@ def subsystem2Line(ms,ssNum,nsegs=10):
else:
# update end A r
points[endA]['r'] = ms.pointList[i].r
points[endA]['type'] = ms.pointList[i].type
points[endA]['type'] = ms.pointList[i].type
# check if end points are attached to a body
for k in range(0,len(ms.bodyList)):
if i+1 in ms.bodyList[k].attachedP:
Expand Down
6 changes: 3 additions & 3 deletions moorpy/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def __init__(self, mooringSys=None, num=0, depth=0, rho=1025, g=9.81,
self.qs = 1 # flag that it's a MoorPy analysis, so System methods don't complain. One day should replace this <<<



def initialize(self, daf_dict={}):
'''Initialize the Subsystem including DAFs.'''

Expand Down Expand Up @@ -152,6 +151,7 @@ def initialize(self, daf_dict={}):


def makeGeneric(self, lengths, types, connectors=[], suspended=0):

'''Creates a cable of n components going between an anchor point and
a floating body (or a bridle point). If shared, it goes between two
floating bodies.
Expand Down Expand Up @@ -193,7 +193,7 @@ def makeGeneric(self, lengths, types, connectors=[], suspended=0):
if suspended==2: # symmetrical suspended case
rA = np.array([-0.5*self.span-self.rad_fair, 0, -1]) # shared line midpoint coordinates
elif suspended==1: # general suspended case
rA = np.array([-self.span-self.self.ss + self.rad_fair, 0, self.z_fair]) # other suspended end
rA = np.array([-self.span-self.rad_fair, 0, self.z_fair]) # other suspended end
else: # normal anchored line case
rA = np.array([-self.span-self.rad_fair, 0, -self.depth]) # anchor coordinates
rB = np.array([-self.rad_fair, 0, self.z_fair]) # fairlead coordinates
Expand Down Expand Up @@ -224,7 +224,7 @@ def makeGeneric(self, lengths, types, connectors=[], suspended=0):
raise Exception(f"Can't find lineType '{types[i]}' in the SubSystem.")

# add the line segment using the reference to its lineType dict
self.addLine(lengths[i], self.lineTypes[i])
self.addLine(lengths[i],self.lineTypes[i])

# add the upper end point of the segment
if i==self.nLines-1: # if this is the upper-most line
Expand Down

0 comments on commit 5b5d59f

Please sign in to comment.