Skip to content

Commit 3f350e9

Browse files
author
Nicola-Fonzi
committed
Modification suggested by codeFactor
1 parent 349594a commit 3f350e9

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

SU2_PY/FSI_tools/FSIInterface.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2189,10 +2189,10 @@ def MapModes(self, FSI_config, FluidSolver, SolidSolver):
21892189

21902190
if myid == self.rootProcess:
21912191
AllFiles = os.listdir()
2192-
for FileNumber in range(len(AllFiles)):
2193-
if SurfaceFileName in AllFiles[FileNumber]:
2194-
file = AllFiles[FileNumber].split(".")[0]
2195-
extension = AllFiles[FileNumber].split(".")[1]
2192+
for FileNumber,FileName in enumerate(AllFiles):
2193+
if SurfaceFileName in FileName:
2194+
file = FileName.split(".")[0]
2195+
extension = FileName.split(".")[1]
21962196
os.rename(file+"."+extension,"Mode{}.".format(mode)+extension)
21972197

21982198
self.MPIPrint('\n*************************')

SU2_PY/SU2_Nastran/pysu2_nastran.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def GetDispl(self,time):
7777
if self.typeOfMotion == "BLENDED_STEP":
7878
if (time < 0.0) or (time > self.timeStop):
7979
return 0.0
80-
elif time < self.tmax:
80+
if time < self.tmax:
8181
return self.amplitude/2.0*(1.0-cos(self.omega0*time*self.vinf/self.lref))
8282
return self.amplitude
8383

@@ -93,7 +93,7 @@ def GetVel(self,time):
9393
if self.typeOfMotion == "BLENDED_STEP":
9494
if (time < 0.0) or (time > self.timeStop):
9595
return 0.0
96-
elif time < self.tmax:
96+
if time < self.tmax:
9797
return self.amplitude/2.0*sin(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref)
9898
return 0.0
9999

@@ -108,7 +108,7 @@ def GetAcc(self,time):
108108
if self.typeOfMotion == "BLENDED_STEP":
109109
if (time < 0.0) or (time > self.timeStop):
110110
return 0.0
111-
elif time < self.tmax:
111+
if time < self.tmax:
112112
return self.amplitude/2.0*cos(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref)**2
113113
return 0.0
114114

@@ -511,8 +511,7 @@ def __checkBlankField(self, string):
511511

512512
if string == ' ':
513513
return int(0)
514-
else:
515-
return int(string)
514+
return int(string)
516515

517516

518517
def __setStructuralMatrices(self):
@@ -808,7 +807,7 @@ def __setRestart(self):
808807
self.__computeInterfacePosVel(False)
809808
nSet = True
810809
break
811-
810+
812811
if (not nM1Set) or (not nSet):
813812
raise Exception('The restart iteration was not found in the structural history')
814813

0 commit comments

Comments
 (0)