pyNastran
0.5.0
pyNastran BDF Reader/Writer, OP2 Parser, and GUI
|
00001 ## GNU Lesser General Public License 00002 ## 00003 ## Program pyNastran - a python interface to NASTRAN files 00004 ## Copyright (C) 2011-2012 Steven Doyle, Al Danial 00005 ## 00006 ## Authors and copyright holders of pyNastran 00007 ## Steven Doyle <mesheb82@gmail.com> 00008 ## Al Danial <al.danial@gmail.com> 00009 ## 00010 ## This file is part of pyNastran. 00011 ## 00012 ## pyNastran is free software: you can redistribute it and/or modify 00013 ## it under the terms of the GNU Lesser General Public License as published by 00014 ## the Free Software Foundation, either version 3 of the License, or 00015 ## (at your option) any later version. 00016 ## 00017 ## pyNastran is distributed in the hope that it will be useful, 00018 ## but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 ## GNU General Public License for more details. 00021 ## 00022 ## You should have received a copy of the GNU Lesser General Public License 00023 ## along with pyNastran. If not, see <http://www.gnu.org/licenses/>. 00024 ## 00025 import sys 00026 from struct import unpack 00027 00028 from pyNastran.bdf.cards.loads.loads import DAREA 00029 00030 class DYNAMICS(object): 00031 def readTable_DYNAMICS(self): 00032 self.iTableMap = { 00033 (27, 17,182): self.readDArea, # 2 00034 (37, 18,183): self.readDelay, # 3 00035 (57, 5,123): self.readDLoad, # 4 00036 (77, 19,184): self.readDPhase, # 5 00037 (107, 1, 86): self.readEigb, # 7 00038 (207, 2, 87): self.readEigc, # 8 00039 (257, 4,158): self.readEigp, # 9 00040 (307, 3, 85): self.readEigr, # 10 00041 (308, 8,348): self.readEigrl, # 11 00042 (707, 7,124): self.readEPoint, # 12 00043 00044 00045 (1307,13,126): self.readFreq, # 13 00046 (1007,10,125): self.readFreq1, # 14 00047 (1107,11,166): self.readFreq2, # 15 00048 (1407,14,39): self.readFreq3, # 16 00049 (1507,15,40): self.readFreq4, # 17 00050 (1607,16,41): self.readFreq5, # 18 00051 00052 (3107,31,127): self.readFake, 00053 (5107,51,131): self.readRLoad1, # 26 00054 (5207,52,132): self.readRLoad2, # 27 00055 (6207,62,136): self.readFake, 00056 (6607,66,137): self.readFake, 00057 (7107,71,138): self.readTLoad1, # 37 00058 (7207,72,139): self.readTLoad2, # 38 00059 (8307,83,142): self.readTStep, # 39 00060 (2107,21,195): self.readFake, 00061 (2207,22,196): self.readFake, 00062 } 00063 self.readRecordTable('DYNAMICS') 00064 00065 #ACSRCE (5307,53,379) 00066 00067 def readDArea(self,data): 00068 """DAREA(27,17,182) - the marker for Record 2""" 00069 #print "reading DAREA" 00070 while len(data)>=16: # 4*4 00071 eData = data[:16] 00072 data = data[16:] 00073 out = unpack('iiff',eData) 00074 #(sid,p,c,a) = out 00075 darea = DAREA(data=out) 00076 self.addDArea(darea) 00077 ### 00078 00079 def readDelay(self,data): 00080 """DELAY(37,18,183) - Record 3""" 00081 self.skippedCardsFile.write('skipping DELAY in DYNAMICS\n') 00082 00083 def readDLoad(self,data): 00084 """DLOAD(57,5,123) - Record 4""" 00085 self.skippedCardsFile.write('skipping DLOAD in DYNAMICS\n') 00086 00087 def readDPhase(self,data): 00088 """DPHASE(77,19,184) - Record 5""" 00089 self.skippedCardsFile.write('skipping DPHASE in DYNAMICS\n') 00090 00091 #DYNRED(4807,48,306) 00092 00093 def readEigb(self,data): 00094 """EIGB(107,1,86) - Record 7""" 00095 self.skippedCardsFile.write('skipping EIGB in DYNAMICS\n') 00096 00097 def readEigc(self,data): 00098 """EIGC(207,2,87) - Record 8""" 00099 self.skippedCardsFile.write('skipping EIGC in DYNAMICS\n') 00100 00101 def readEigp(self,data): 00102 """EIGP(257,4,158) - Record 9""" 00103 self.skippedCardsFile.write('skipping EIGP in DYNAMICS\n') 00104 00105 def readEigr(self,data): 00106 """EIGR(307,3,85) - Record 10""" 00107 self.skippedCardsFile.write('skipping EIGR in DYNAMICS\n') 00108 00109 def readEigrl(self,data): 00110 """EIGRL(308,8,348) - Record 11""" 00111 self.skippedCardsFile.write('skipping EIGRL in DYNAMICS\n') 00112 00113 def readEPoint(self,data): 00114 """EPOINT(707,7,124) - Record 12""" 00115 self.skippedCardsFile.write('skipping EPOINT in DYNAMICS\n') 00116 00117 def readFreq(self,data): 00118 """FREQ(1307,13,126) - Record 13""" 00119 self.skippedCardsFile.write('skipping FREQ in DYNAMICS\n') 00120 00121 def readFreq1(self,data): 00122 """FREQ1(1007,10,125) - Record 14""" 00123 self.skippedCardsFile.write('skipping FREQ1 in DYNAMICS\n') 00124 00125 def readFreq2(self,data): 00126 """FREQ2(1107,11,166) - Record 15""" 00127 self.skippedCardsFile.write('skipping FREQ2 in DYNAMICS\n') 00128 00129 def readFreq3(self,data): 00130 """FREQ3(1407,14,39) - Record 16""" 00131 self.skippedCardsFile.write('skipping FREQ3 in DYNAMICS\n') 00132 00133 def readFreq4(self,data): 00134 """FREQ4(1507,15,40) - Record 17""" 00135 self.skippedCardsFile.write('skipping FREQ4 in DYNAMICS\n') 00136 00137 def readFreq5(self,data): 00138 """FREQ5(1607,16,41) - Record 18""" 00139 self.skippedCardsFile.write('skipping FREQ5 in DYNAMICS\n') 00140 00141 #NLRSFD 00142 #NOLIN1 00143 #NOLIN2 00144 #NOLIN3 00145 #NOLIN4 00146 #RANDPS 00147 #RANDT1 00148 00149 def readRLoad1(self,data): 00150 """RLOAD1(5107,51,131) - Record 26""" 00151 self.skippedCardsFile.write('skipping RLOAD1 in DYNAMICS\n') 00152 00153 def readRLoad2(self,data): 00154 """RLOAD2(5107,51,131) - Record 27""" 00155 self.skippedCardsFile.write('skipping RLOAD2 in DYNAMICS\n') 00156 00157 # 00158 #RLOAD2(5207,52,132) 00159 #RGYRO 00160 #ROTORG 00161 #RSPINR 00162 #RSPINT 00163 #SEQEP(5707,57,135) 00164 #TF 00165 #TIC 00166 #TIC 00167 #TIC3 00168 00169 def readTLoad1(self,data): 00170 """TLOAD1(7107,71,138) - Record 37""" 00171 self.skippedCardsFile.write('skipping TLOAD1 in DYNAMICS\n') 00172 00173 def readTLoad2(self,data): 00174 """TLOAD2(7207,72,139) - Record 37""" 00175 self.skippedCardsFile.write('skipping TLOAD2 in DYNAMICS\n') 00176 00177 def readTStep(self,data): 00178 """TSTEP(8307,83,142) - Record 38""" 00179 self.skippedCardsFile.write('skipping TSTEP in DYNAMICS\n') 00180 00181 #UNBALNC