Skip to content

Commit

Permalink
0730
Browse files Browse the repository at this point in the history
  • Loading branch information
Su Tian committed Jul 30, 2021
1 parent 5309c74 commit c7c13c0
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 57 deletions.
10 changes: 6 additions & 4 deletions msgpi/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,20 +219,22 @@ def runSwiftComp(

if analysis == 0 or analysis == 'h' or analysis == '':
arg = 'H'
if aperiodic:
arg += 'A'
elif analysis == 2 or analysis == 'dl' or analysis == 'd' or analysis == 'l':
arg = 'L'
if aperiodic:
arg += 'A'
if output_gmsh_format:
arg += 'G'
elif analysis == 3 or analysis == 'fi':
arg = 'FI'
elif analysis == 4 or analysis == 'f':
arg = 'F'
elif analysis == 5 or analysis == 'fe':
arg = 'FE'

if aperiodic:
arg += 'A'

if output_gmsh_format:
arg += 'G'

cmd.append(arg)

Expand Down
97 changes: 50 additions & 47 deletions msgpi/io/iosc.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def readSCOutShellProperty(fn, scrnout=True, logger=None):

try:
ln = keywordsIndex['stff']
sp.stff = utl.textToMatrix(linesRead[ln + 2:ln + 6])
sp.stff = utl.textToMatrix(linesRead[ln + 2:ln + 8])
except KeyError:
if scrnout:
print('No classical stiffness matrix found.')
Expand All @@ -474,7 +474,7 @@ def readSCOutShellProperty(fn, scrnout=True, logger=None):

try:
ln = keywordsIndex['cmpl']
sp.cmpl = utl.textToMatrix(linesRead[ln + 2:ln + 6])
sp.cmpl = utl.textToMatrix(linesRead[ln + 2:ln + 8])
except KeyError:
if scrnout:
print('No classical flexibility matrix found.')
Expand Down Expand Up @@ -506,8 +506,11 @@ def readSCOutHomo(fn, smdim, scrnout=True, logger=None):
logger = mlog.initLogger(__name__)

if smdim == 1:
bp = readSCOutBeamProperty(fn, scrnout, logger=logger)
bp = readSCOutBeamProperty(fn, scrnout, logger)
return bp
elif smdim == 2:
sp = readSCOutShellProperty(fn, scrnout, logger)
return sp


linesRead = []
Expand Down Expand Up @@ -542,50 +545,50 @@ def readSCOutHomo(fn, smdim, scrnout=True, logger=None):

# ems = 6 # effective matrix size

if smdim == 2:
ems = 6

try:
indexStiffness = keywordsIndex['The Effective Stiffness Matrix']
sm.eff_props[2]['stiffness']['classical'] = utl.textToMatrix(
linesRead[indexStiffness + 2:indexStiffness + 2 + ems])
except KeyError:
print('No effective stiffness matrix found.')

try:
indexCompliance = keywordsIndex['The Effective Compliance Matrix']
sm.eff_props[2]['compliance']['classical'] = utl.textToMatrix(
linesRead[indexCompliance + 2:indexCompliance + 2 + ems])
except KeyError:
print('No effective compliance matrix found.')

try:
index = keywordsIndex['In-Plane Properties']
for line in linesRead[index + 2:index + 8]:
line = line.strip()
line = line.split('=')
label = line[0].strip().lower()
value = float(line[-1].strip())
sm.eff_props[2]['constants']['inplane'][label] = value
except KeyError:
print('No in-plane properties found.')

try:
index = keywordsIndex['Flexural Properties']
for line in linesRead[index + 2:index + 8]:
line = line.strip()
line = line.split('=')
label = line[0].strip().lower()
value = float(line[-1].strip())
sm.eff_props[2]['constants']['flexural'][label] = value
except KeyError:
print('No flexural properties found.')

line = linesRead[keywordsIndex['Effective Density']]
line = line.strip().split('=')
sm.eff_props[2]['density'] = float(line[-1].strip())

elif smdim == 3:
# if smdim == 2:
# ems = 6

# try:
# indexStiffness = keywordsIndex['The Effective Stiffness Matrix']
# sm.eff_props[2]['stiffness']['classical'] = utl.textToMatrix(
# linesRead[indexStiffness + 2:indexStiffness + 2 + ems])
# except KeyError:
# print('No effective stiffness matrix found.')

# try:
# indexCompliance = keywordsIndex['The Effective Compliance Matrix']
# sm.eff_props[2]['compliance']['classical'] = utl.textToMatrix(
# linesRead[indexCompliance + 2:indexCompliance + 2 + ems])
# except KeyError:
# print('No effective compliance matrix found.')

# try:
# index = keywordsIndex['In-Plane Properties']
# for line in linesRead[index + 2:index + 8]:
# line = line.strip()
# line = line.split('=')
# label = line[0].strip().lower()
# value = float(line[-1].strip())
# sm.eff_props[2]['constants']['inplane'][label] = value
# except KeyError:
# print('No in-plane properties found.')

# try:
# index = keywordsIndex['Flexural Properties']
# for line in linesRead[index + 2:index + 8]:
# line = line.strip()
# line = line.split('=')
# label = line[0].strip().lower()
# value = float(line[-1].strip())
# sm.eff_props[2]['constants']['flexural'][label] = value
# except KeyError:
# print('No flexural properties found.')

# line = linesRead[keywordsIndex['Effective Density']]
# line = line.strip().split('=')
# sm.eff_props[2]['density'] = float(line[-1].strip())

if smdim == 3:
ems = 6

try:
Expand Down
6 changes: 0 additions & 6 deletions msgpi/sg.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,6 @@ def print(self):
print(f'nu12 = {self.nu12_i:{fmt}}')
print(f'eta121 = {self.eta121_i:{fmt}}')
print(f'eta122 = {self.eta122_i:{fmt}}')
print(f'E1 = {self.e1_i:{fmt}}')
print(f'E2 = {self.e2_i:{fmt}}')
print(f'G12 = {self.g12_i:{fmt}}')
print(f'nu12 = {self.nu12_i:{fmt}}')
print(f'eta121 = {self.eta121_i:{fmt}}')
print(f'eta122 = {self.eta122_i:{fmt}}')
print()
print('Flexural Properties')
print(f'E1 = {self.e1_o:{fmt}}')
Expand Down

0 comments on commit c7c13c0

Please sign in to comment.