Skip to content

Commit 3d3a775

Browse files
committed
Merge remote-tracking branch 'origin/main' into new_base
2 parents 7788d50 + 05f051a commit 3d3a775

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

famodel/mooring/mooring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def reposition(self, r_center=None, heading=None, project=None,
279279
# heading 2D unit vector
280280
u = np.array([np.cos(phi), np.sin(phi)])
281281

282-
if np.any(r_center):
282+
if r_center is not None:
283283
if self.shared == 1:
284284
r_centerA = np.array(r_center)[0]
285285
r_centerB = np.array(r_center)[1]

famodel/project.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4260,9 +4260,6 @@ def unload(self,file='project.yaml'):
42604260
for i,anch in enumerate(self.anchorList.values()):
42614261
newanch = True
42624262
name = anch.dd['name'] if 'name' in anch.dd else str(len(anchConfigs))
4263-
if len(anch.attachments)>1:
4264-
# shared anchor, add to arrayAnch list
4265-
arrayAnch.append([anch.id,name,anch.r[0],anch.r[1],0])
42664263
# add mass if available
42674264
aad = deepcopy(anch.dd['design'])
42684265
if anch.mass is not None and anch.mass>0:
@@ -4276,6 +4273,9 @@ def unload(self,file='project.yaml'):
42764273
name = ac[0] # reset name to matching config name
42774274
if newanch:
42784275
anchConfigs[name] = aad
4276+
if len(anch.attachments)>1:
4277+
# shared anchor, add to arrayAnch list
4278+
arrayAnch.append([anch.id,name,anch.r[0],anch.r[1],0])
42794279

42804280
mapAnchNames[anch.id] = name
42814281

@@ -4378,15 +4378,15 @@ def unload(self,file='project.yaml'):
43784378
if fairleads:
43794379
# append mooring line to array_moor section
43804380
arrayMoor.append([current_config,
4381-
mapAnchNames[atts[is_anch][0].id],
4382-
moor.attached_to[1].id,
4381+
atts[0].id,
4382+
atts[1].id,
43834383
'None',
43844384
flB])
43854385
else:
43864386
# append mooring line to array_moor section
43874387
arrayMoor.append([current_config,
4388-
mapAnchNames[atts[is_anch][0].id],
4389-
moor.attached_to[1].id])
4388+
atts[0].id,
4389+
atts[1].id])
43904390
else:
43914391
# not shared anchor or shared mooring, add line to mooring system
43924392
if fairleads:

0 commit comments

Comments
 (0)