Skip to content

Commit

Permalink
updated read shell effective props for geo corrected stiffness
Browse files Browse the repository at this point in the history
  • Loading branch information
tian50 committed Oct 1, 2021
1 parent 0c68e9f commit cbd54e7
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 7 deletions.
22 changes: 22 additions & 0 deletions msgpi/sg/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,11 @@ def readSCOutShellProperty(fn, scrnout=True, logger=None):
elif 'Effective Compliance Matrix' in line:
keywordsIndex['cmpl'] = ln

elif 'Geometric Correction to the Stiffness Matrix' in line:
keywordsIndex['geo_to_stff'] = ln
elif 'Total Stiffness Matrix after Geometric Correction' in line:
keywordsIndex['stff_geo'] = ln

elif 'In-Plane' in line:
prop_plane = 'in'
elif 'Flexural' in line:
Expand Down Expand Up @@ -1087,6 +1092,23 @@ def readSCOutShellProperty(fn, scrnout=True, logger=None):
else:
pass

try:
ln = keywordsIndex['geo_to_stff']
sp.geo_correction_stff = utio.textToMatrix(linesRead[ln + 2:ln + 8])
except KeyError:
if scrnout:
print('No geometric correction matrix found.')
else:
pass

try:
ln = keywordsIndex['stff_geo']
sp.stff_geo = utio.textToMatrix(linesRead[ln + 2:ln + 8])
except KeyError:
if scrnout:
print('No geometric corrected stiffness matrix found.')
else:
pass


return sp
Expand Down
8 changes: 8 additions & 0 deletions msgpi/sg/sg.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,9 @@ def __init__(self):
self.stff = []
self.cmpl = []

self.geo_correction_stff = []
self.stff_geo = []

self.e1_i = None
self.e2_i = None
self.g12_i = None
Expand Down Expand Up @@ -521,6 +524,11 @@ def print(self):
print(f'nu12 = {self.nu12_o:{fmt}}')
print(f'eta121 = {self.eta121_o:{fmt}}')
print(f'eta122 = {self.eta122_o:{fmt}}')
print()
print('The Geometric Correction to the Stiffness Matrix')
print(utio.matrixToString(self.geo_correction_stff, fmt=fmt))
print('The Total Stiffness Matrix after Geometric Correction')
print(utio.matrixToString(self.stff_geo, fmt=fmt))



Expand Down
66 changes: 66 additions & 0 deletions tests/test_sg_io/shell1L_T3_R21.5.sc.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
The Effective Stiffness Matrix
--------------------------------------------
3.6940748E+005 8.5871841E+003 0.0000000E+000 -8.5792095E-011 -7.3166245E-013 0.0000000E+000
8.5871841E+003 3.2001833E+004 0.0000000E+000 -4.1321240E-013 -3.5289815E-012 0.0000000E+000
0.0000000E+000 0.0000000E+000 1.6190886E+004 0.0000000E+000 0.0000000E+000 -3.1832315E-012
-8.5792095E-011 -4.1321240E-013 0.0000000E+000 2.7705561E+005 6.4403881E+003 0.0000000E+000
-7.3166245E-013 -3.5289815E-012 0.0000000E+000 6.4403881E+003 2.4001375E+004 0.0000000E+000
0.0000000E+000 0.0000000E+000 -3.1832315E-012 0.0000000E+000 0.0000000E+000 1.2143165E+004

The Effective Compliance Matrix
--------------------------------------------
2.7240293E-006 -7.3095003E-007 0.0000000E+000 8.4828270E-022 -2.5205677E-022 -0.0000000E+000
-7.3095003E-007 3.1444349E-005 0.0000000E+000 -2.8819917E-022 4.6783916E-021 -0.0000000E+000
0.0000000E+000 0.0000000E+000 6.1763143E-005 0.0000000E+000 -0.0000000E+000 1.6190704E-020
8.4828270E-022 -2.8819917E-022 0.0000000E+000 3.6320390E-006 -9.7460003E-007 -0.0000000E+000
-2.5205677E-022 4.6783916E-021 0.0000000E+000 -9.7460003E-007 4.1925798E-005 -0.0000000E+000
0.0000000E+000 0.0000000E+000 1.6190704E-020 0.0000000E+000 0.0000000E+000 8.2350857E-005

In-Plane Properties
----------------------------------------------------------
E1 = 1.2236775E+005
E2 = 1.0600739E+004
G12 = 5.3969620E+003
nu12= 2.6833413E-001
eta121= 0.0000000E+000
eta122= 0.0000000E+000

Flexural Properties
----------------------------------------------------------
E1 = 1.2236775E+005
E2 = 1.0600739E+004
G12 = 5.3969620E+003
nu12= 2.6833413E-001
eta121= -0.0000000E+000
eta122= -0.0000000E+000

The Geometric Correction to the Stiffness Matrix
--------------------------------------------
3.2809089E-012 -7.8987832E-013 0.0000000E+000 -1.7719845E+004 -1.1235958E+002 0.0000000E+000
-8.3561081E-013 -4.4876903E-013 0.0000000E+000 -5.1268198E+003 9.9716583E+002 0.0000000E+000
0.0000000E+000 0.0000000E+000 0.0000000E+000 0.0000000E+000 0.0000000E+000 0.0000000E+000
-1.7719845E+004 -5.1268198E+003 0.0000000E+000 9.8093350E-012 1.3855875E-012 0.0000000E+000
-1.1235958E+002 9.9716583E+002 0.0000000E+000 1.4025411E-012 -6.2098742E-013 0.0000000E+000
0.0000000E+000 0.0000000E+000 0.0000000E+000 0.0000000E+000 0.0000000E+000 -1.1368684E-013

The Total Stiffness Matrix after Geometric Correction
--------------------------------------------
3.6940748E+005 8.5871841E+003 0.0000000E+000 -1.7719845E+004 -1.1235958E+002 0.0000000E+000
8.5871841E+003 3.2001833E+004 0.0000000E+000 -5.1268198E+003 9.9716583E+002 0.0000000E+000
0.0000000E+000 0.0000000E+000 1.6190886E+004 0.0000000E+000 0.0000000E+000 -3.1832315E-012
-1.7719845E+004 -5.1268198E+003 0.0000000E+000 2.7705561E+005 6.4403881E+003 0.0000000E+000
-1.1235958E+002 9.9716583E+002 0.0000000E+000 6.4403881E+003 2.4001375E+004 0.0000000E+000
0.0000000E+000 0.0000000E+000 -3.1832315E-012 0.0000000E+000 0.0000000E+000 1.2143165E+004


Effective Mass Matrix =
--------------------------------------------
3.0000000E-005 0.0000000E+000 0.0000000E+000 0.0000000E+000 -5.0821977E-021 0.0000000E+000
0.0000000E+000 3.0000000E-005 0.0000000E+000 5.0821977E-021 0.0000000E+000 0.0000000E+000
0.0000000E+000 0.0000000E+000 3.0000000E-005 0.0000000E+000 0.0000000E+000 0.0000000E+000
0.0000000E+000 5.0821977E-021 0.0000000E+000 2.2500000E-005 0.0000000E+000 0.0000000E+000
-5.0821977E-021 0.0000000E+000 0.0000000E+000 0.0000000E+000 2.2500000E-005 0.0000000E+000
0.0000000E+000 0.0000000E+000 0.0000000E+000 0.0000000E+000 0.0000000E+000 0.0000000E+000

Mass Center Location -1.6940659E-016
Mass moments of inertia i11=i22 2.2500000E-005
16 changes: 9 additions & 7 deletions tests/test_sg_io/test_sg_io_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@

analysis = 'h'

solver = 'vabs'
fn = 'box_v.sg.k'
bp = sgio.readVABSOut(fn, analysis)
bp.print()
# solver = 'vabs'
# fn = 'box_v.sg.k'
# bp = sgio.readVABSOut(fn, analysis)
# bp.print()

print('----------')
# print('----------')

solver = 'sc'
fn = 'box_s.sg.k'
bp = sgio.readSCOut(fn, smdim=1, analysis=analysis, logger=logger)
smdim = 2
# fn = 'box_s.sg.k'
fn = 'shell1L_T3_R21.5.sc.k'
bp = sgio.readSCOut(fn, smdim, analysis=analysis, logger=logger)
bp.print()


0 comments on commit cbd54e7

Please sign in to comment.