From c7c13c0d401f516d547bdab608982ddf21af065b Mon Sep 17 00:00:00 2001 From: Su Tian Date: Fri, 30 Jul 2021 17:54:49 -0400 Subject: [PATCH] 0730 --- msgpi/analysis.py | 10 +++-- msgpi/io/iosc.py | 97 ++++++++++++++++++++++++----------------------- msgpi/sg.py | 6 --- 3 files changed, 56 insertions(+), 57 deletions(-) diff --git a/msgpi/analysis.py b/msgpi/analysis.py index 21f1ff2..8b14101 100644 --- a/msgpi/analysis.py +++ b/msgpi/analysis.py @@ -219,8 +219,14 @@ 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': @@ -228,11 +234,7 @@ def runSwiftComp( elif analysis == 5 or analysis == 'fe': arg = 'FE' - if aperiodic: - arg += 'A' - if output_gmsh_format: - arg += 'G' cmd.append(arg) diff --git a/msgpi/io/iosc.py b/msgpi/io/iosc.py index 6f1e843..471e74a 100644 --- a/msgpi/io/iosc.py +++ b/msgpi/io/iosc.py @@ -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.') @@ -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.') @@ -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 = [] @@ -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: diff --git a/msgpi/sg.py b/msgpi/sg.py index 7cf86db..8cbc8a1 100644 --- a/msgpi/sg.py +++ b/msgpi/sg.py @@ -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}}')