You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List of cutoff depths the changePoints should be located at
647
650
648
651
'''
649
-
defgetMG(mgDict):
652
+
defgetMG(mgDict, buoy_mg, oldLine=None):
650
653
# create a reference subsystem if it doesn't already exist
651
-
ifnotself.ss:
652
-
self.createSubsystem(pristine=1)
653
-
# set location of reference subsystem
654
-
oldLine=self.ss
654
+
ifnotoldLine:
655
+
oldLine=self.createSubsystem(pristine=1)
656
+
655
657
# set up variables
656
658
LTypes= [] # list of line types for new lines (types listed are from reference object)
657
659
Lengths= [] # lengths of each section for new line
@@ -699,31 +701,31 @@ def getMG(mgDict):
699
701
high=ssLine.rB
700
702
flip=0
701
703
702
-
th=mgDict['th']# set location for ease of coding
704
+
th=mgDict# set location for ease of coding
703
705
# look up what thickness this line section starts at (if lowest point is not on the sea floor, first segment will have a thickness other than the sea floor thickness)
704
706
rAth=0# exit while loop when we find thickness at low
705
707
count1=0# counter
706
708
whilerAth==0: # and count1 < len(th):
707
709
ifflip:
708
-
ifhigh[2] <=th[count1][2]:
709
-
LThick.append(th[count1][0])
710
+
ifhigh[2] <=th[count1]['upperRange']:
711
+
LThick.append(th[count1]['thickness'])
710
712
rAth=1# exit while loop
711
713
else:
712
-
iflow[2] <=th[count1][2]:
713
-
LThick.append(th[count1][0])
714
+
iflow[2] <=th[count1]['upperRange']:
715
+
LThick.append(th[count1]['thickness'])
714
716
rAth=1# exit while loop
715
717
count1=count1+1# iterate counter
716
718
717
719
# determine if this line section will be split
718
720
forjinrange(0,len(th)): # go through all changeDepths
719
721
ifflip:
720
-
rs=2
722
+
rs='upperRange'
721
723
else:
722
-
rs=1
724
+
rs='lowerRange'
723
725
ifth[j][rs]>low[2] andth[j][rs]<high[2]:
724
726
# line section will be split - add line type, mg thickness, and material to list
725
727
LTypes.append(ssLine.type['name'])
726
-
slthick.append(th[j][0])
728
+
slthick.append(th[j]['thickness'])
727
729
# Mats.append(ssLine.type['material'])
728
730
# add an empty connector object to list for split location
729
731
sCount+=1
@@ -771,12 +773,12 @@ def getMG(mgDict):
771
773
772
774
else:
773
775
# this is a buoy section, add the prescribed buoy marine growth thickness
774
-
ifisinstance(mgDict['buoy_th'],list):
776
+
ifisinstance(buoy_mg,list):
775
777
# add the buoy thickness for this specific buoyancy section
776
-
LThick.append(mgDict['buoy_th'][buoyCount])
778
+
LThick.append(buoy_mg[buoyCount])
777
779
else:
778
780
# add the single buoy thickness
779
-
LThick.append(mgDict['buoy_th'])
781
+
LThick.append(buoy_mg)
780
782
781
783
ifslthick: # add the length of the top line (from last split to upper end of section) if there was a split in the line
782
784
slength.append(float(ssLine.L-ln_raw[-1]))
@@ -811,17 +813,13 @@ def getMG(mgDict):
811
813
mu_mg=np.zeros((len(LTypes)))
812
814
rho_mg=np.ones((len(LTypes)))*1325
813
815
# adjust rho value if alternative provided
814
-
if'rho'inmgDict:
815
-
ifnottype(mgDict['rho']) islist:
816
-
# just one density given for all marine growth on the line
817
-
rho_mg=rho_mg*mgDict['rho']/1325
818
-
else: # density given for each thickness of marine growth
819
-
foriinrange(0,len(rho_mg)):
820
-
# look up what thickness number this rho is related to
821
-
forjinrange(0,len(LThick)):
822
-
thind=np.where(th[:][0]==LThick[j])
823
-
# assign rho_mg based on the rho_mg of the thickness
824
-
rho_mg[i] =mgDict['rho'][thind]
816
+
if'density'inmgDict[0]:
817
+
foriinrange(0,len(mgDict)):
818
+
# look up what thickness number this rho is related to
0 commit comments