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 # pylint: disable=C0103,C0302,R0902,R0904,R0914,W0201,W0611 00026 00027 from __future__ import division, print_function 00028 import os 00029 import sys 00030 import warnings 00031 00032 from pyNastran.general.general import ListPrint 00033 00034 from .cards.elements.elements import CFAST, CGAP, CRAC2D, CRAC3D 00035 from .cards.properties.properties import (PFAST, PGAP, PLSOLID, PSOLID, 00036 PRAC2D, PRAC3D, PCONEAX) 00037 00038 from .cards.elements.springs import (CELAS1, CELAS2, CELAS3, CELAS4, 00039 SpringElement) 00040 from .cards.properties.springs import PELAS, PELAST 00041 #------ 00042 from .cards.elements.solid import (CTETRA4, CTETRA10, CPENTA6, CPENTA15, 00043 CHEXA8, CHEXA20, SolidElement) 00044 from .cards.elements.rigid import (RBAR, RBAR1, RBE1, RBE2, RBE3, RigidElement) 00045 #------ 00046 from .cards.elements.shell import (CQUAD, CQUAD4, CQUAD8, CQUADR, CQUADX, 00047 CSHEAR, CTRIA3, CTRIA6, CTRIAX, 00048 CTRIAX6, CTRIAR, ShellElement) 00049 from .cards.properties.shell import PSHELL, PCOMP, PCOMPG, PSHEAR 00050 #------ 00051 from .cards.elements.bush import CBUSH, CBUSH1D, CBUSH2D 00052 from .cards.properties.bush import PBUSH, PBUSH1D 00053 #------ 00054 from .cards.elements.damper import (CVISC, CDAMP1, CDAMP2, CDAMP3, CDAMP4, 00055 CDAMP5, DamperElement) 00056 from .cards.properties.damper import (PVISC, PDAMP, PDAMP5, PDAMPT) 00057 #------ 00058 from .cards.elements.bars import (CROD, CONROD, CTUBE, CBAR, CBEAM, CBEAM3, 00059 CBEND, LineElement, RodElement) 00060 from .cards.properties.bars import (PROD, PTUBE, PBAR, PBARL, 00061 PBEAM, PBEAML) # PBEND 00062 #------ 00063 00064 from .cards.elements.mass import (CONM1, CONM2, CMASS1, CMASS2, CMASS3, CMASS4, 00065 PointElement, PointMassElement) # CMASS5 00066 from .cards.properties.mass import (PMASS, NSM) 00067 00068 #-------------------------------- 00069 from .cards.aero import (AEFACT, AELINK, AELIST, AEPARM, AESTAT, AESURF, 00070 AESURFS, AERO, AEROS, CSSCHD, CAERO1, CAERO2, CAERO3, 00071 CAERO4, CAERO5, FLFACT, FLUTTER, GUST, MKAERO1, 00072 MKAERO2, PAERO1, PAERO2, SPLINE1, SPLINE2, SPLINE4, 00073 SPLINE5, TRIM) 00074 from .cards.constraints import (SPC, SPCADD, SPCD, SPCAX, SPC1, 00075 MPC, MPCADD, SUPORT1, SUPORT, 00076 constraintObject2) 00077 from .cards.coordinateSystems import (CORD1R, CORD1C, CORD1S, 00078 CORD2R, CORD2C, CORD2S, CORD3G) 00079 from .cards.dmig import (DEQATN, DMIG, DMI, DMIJ, DMIK, DMIJI, NastranMatrix) 00080 from .cards.dynamic import (FREQ, FREQ1, FREQ2, FREQ4, TSTEP, TSTEPNL, NLPARM) 00081 00082 from .cards.loads.loads import (LSEQ, SLOAD, DLOAD, DAREA, TLOAD1, TLOAD2, 00083 RLOAD1, RLOAD2, RANDPS, RFORCE) 00084 from .cards.loads.staticLoads import (LOAD, GRAV, ACCEL1, FORCE, 00085 FORCE1, FORCE2, MOMENT, MOMENT1, MOMENT2, 00086 PLOAD, PLOAD1, PLOAD2, PLOAD4, PLOADX1) 00087 00088 from .cards.materials import (MAT1, MAT2, MAT3, MAT4, MAT5, 00089 MAT8, MAT9, MAT10, 00090 MATHP, CREEP, MATS1) 00091 from .cards.methods import (EIGB, EIGC, EIGR, EIGP, EIGRL) 00092 from .cards.nodes import GRID, GRDSET, SPOINTs 00093 from .cards.optimization import (DCONSTR, DESVAR, DDVAL, DOPTPRM, DLINK, 00094 DRESP1, DRESP2, DVMREL1, DVPREL1, DVPREL2) 00095 from .cards.params import PARAM 00096 from .cards.sets import (ASET, BSET, CSET, QSET, 00097 ASET1, BSET1, CSET1, QSET1, 00098 SET1, SET3, SESET, SEQSEP, RADSET) 00099 00100 from .cards.thermal.loads import (QBDY1, QBDY2, QBDY3, QHBDY, TEMP, TEMPD) 00101 from .cards.thermal.thermal import (CHBDYE, CHBDYG, CHBDYP, PCONV, PCONVM, 00102 PHBDY, CONV, RADM, RADBC,) 00103 00104 00105 from .cards.tables import (TABLED1, TABLED2, TABLED3, 00106 TABLEM1, TABLEM2, TABLEM3, TABLEM4, 00107 TABLES1, TABLEST, TABRND1, TABRNDG, TIC) 00108 00109 from pyNastran.bdf.caseControlDeck import CaseControlDeck 00110 from pyNastran.bdf.bdf_Methods import BDFMethods 00111 00112 from .bdfInterface.getCard import GetMethods 00113 from .bdfInterface.addCard import AddMethods 00114 from .bdfInterface.BDF_Card import BDFCard 00115 from .bdfInterface.bdf_Reader import BDFReader 00116 from .bdfInterface.bdf_writeMesh import WriteMesh 00117 from .bdfInterface.bdf_cardMethods import CardMethods 00118 from .bdfInterface.crossReference import XrefMesh 00119 00120 00121 class BDF(BDFReader, BDFMethods, GetMethods, AddMethods, WriteMesh, 00122 CardMethods, XrefMesh): 00123 """ 00124 NASTRAN BDF Reader/Writer/Editor class. 00125 """ 00126 modelType = 'nastran' 00127 isStructured = False 00128 00129 def __init__(self, debug=True, log=None, nCardLinesMax=1000): 00130 """ 00131 Initializes the BDF object 00132 @param self the object pointer 00133 @param debug used to set the logger if no logger is passed in 00134 @param log a python logging module object 00135 @param nCardLinesMax the number of lines of the longest card in the deck (default=1000) 00136 """ 00137 ## allows the BDF variables to be scoped properly (i think...) 00138 BDFReader.__init__(self, debug, log) 00139 GetMethods.__init__(self) 00140 AddMethods.__init__(self) 00141 BDFMethods.__init__(self) 00142 WriteMesh.__init__(self) 00143 CardMethods.__init__(self, nCardLinesMax) 00144 XrefMesh.__init__(self) 00145 00146 ## useful in debugging errors in input 00147 self.debug = debug 00148 self._init_solution() 00149 00150 ## flag that allows for OpenMDAO-style optimization syntax to be used 00151 self.isDynamicSyntax = False 00152 ## lines that were rejected b/c they were for a card 00153 ## that isnt supported 00154 self.rejects = [] 00155 ## cards that were created, but not processed 00156 self.reject_cards = [] 00157 ## list of execive control deck lines 00158 self.executive_control_lines = [] 00159 ## list of case control deck lines 00160 self.case_control_lines = [] 00161 00162 ## the list of possible cards that will be parsed 00163 self.cardsToRead = set([ 00164 'PARAM', 00165 'GRID', 'GRDSET', 'SPOINT', #'RINGAX', 00166 00167 # elements 00168 'CONM2', 'CMASS1', 'CMASS2', 'CMASS3', 'CMASS4', # 'CONM1', 00169 'CELAS1', 'CELAS2', 'CELAS3', 'CELAS4', #'CELAS5', 00170 'CBUSH', 'CBUSH1D', 'CBUSH2D', 00171 00172 'CDAMP1', 'CDAMP2', 'CDAMP3', 'CDAMP4', 'CDAMP5', 00173 'CFAST', 00174 00175 'CBAR', 'CROD', 'CTUBE', 'CBEAM', 'CBEAM3', 'CONROD', 'CBEND', 00176 'CTRIA3', 'CTRIA6', 'CTRIAR', 'CTRIAX', 'CTRIAX6', 00177 'CQUAD4', 'CQUAD8', 'CQUADR', 'CQUADX', 'CQUAD', 00178 'CTETRA', 'CPENTA', 'CHEXA', 00179 'CSHEAR', 'CVISC', 'CRAC2D', 'CRAC3D', 00180 'CGAP', 00181 00182 # rigid elements 00183 'RBAR', 'RBAR1', 'RBE1', 'RBE2', 'RBE3', 00184 00185 # properties 00186 'PMASS', 00187 'PELAS', 'PGAP', 'PFAST', 00188 'PBUSH', 'PBUSH1D', 00189 'PDAMP', 'PDAMP5', 'PDAMPT', 00190 'PROD', 'PBAR', 'PBARL', 'PBEAM', 'PTUBE', 'PBEND', #'PBEAML',#'PBEAM3', 00191 'PSHELL', 'PCOMP', 'PCOMPG', 'PSHEAR', 00192 'PSOLID', 'PLSOLID', 'PVISC', 00193 00194 # creep materials 00195 'CREEP', 00196 00197 # materials 00198 'MAT1', 'MAT2', 'MAT3', 'MAT8', 'MAT9', 'MAT10', 'MATHP', 00199 #'MATT1', 'MATT2', 'MATT3', 'MATT4', 'MATT5', 'MATT8', 'MATT9', 00200 'MATS1', 00201 00202 # thermal materials 00203 'MAT4', 'MAT5', 00204 00205 # spc/mpc constraints 00206 'SPC', 'SPCADD', 'SPC1', 'SPCD', 'SPCAX', 00207 'MPC', 'MPCADD', 00208 'SUPORT', 'SUPORT1', 00209 00210 # loads 00211 'LOAD', 'LSEQ', 'RANDPS', 00212 'DLOAD', 'SLOAD', 'TLOAD1', 'TLOAD2', 'RLOAD1', 'RLOAD2', 00213 'FORCE', 'FORCE1', 'FORCE2', 00214 'MOMENT', 'MOMENT1', 'MOMENT2', 00215 'GRAV', 'ACCEL1', 00216 'PLOAD', 'PLOAD1', 'PLOAD2', 'PLOAD4', 00217 'PLOADX1', 'RFORCE', 00218 00219 # aero cards 00220 'AERO', 'AEROS', 'GUST', 'FLUTTER', 'FLFACT', 'MKAERO1', 'MKAERO2', 00221 'AEFACT', 'AELINK', 'AELIST', 'AEPARAM', 'AESTAT', 'AESURF', 00222 'CAERO1', 'CAERO2', #'CAERO3', 'CAERO4', 'CAERO5', 00223 'PAERO1', 'PAERO2', #'PAERO3', 'PAERO4', 'PAERO5', 00224 'SPLINE1', 'SPLINE2', 'SPLINE4', 'SPLINE5', 00225 #'SPLINE3', 'SPLINE6', 'SPLINE7', 00226 'TRIM', 00227 00228 # coords 00229 'CORD1R', 'CORD1C', 'CORD1S', 00230 'CORD2R', 'CORD2C', 'CORD2S', 00231 00232 # temperature cards 00233 'TEMP',#'TEMPD', 00234 'QBDY1', 'QBDY2', 'QBDY3', 'QHBDY', 00235 'CHBDYE', 'CHBDYG', 'CHBDYP', 00236 'PCONV', 'PCONVM', 'PHBDY', 00237 'RADBC', 'CONV', #'RADM', 00238 00239 # dynamic cards 00240 'DAREA', 'NLPARM', 'TSTEP', 'TSTEPNL', 00241 00242 # frequencies 00243 'FREQ', 'FREQ1', 'FREQ2', 00244 00245 # direct matrix input cards 00246 'DMIG', 'DMIJ', 'DMIJI', 'DMIK', 'DMI', 00247 'DEQATN', 00248 00249 # optimization cards 00250 'DCONSTR', 'DESVAR', 'DDVAL', 'DRESP1', 'DRESP2', 'DVPREL1', 'DVPREL2', 00251 'DOPTPRM', 'DVMREL1', 'DLINK', 'DRESP3', 00252 00253 # sets 00254 'ASET', 'BSET', 'CSET', 'QSET', #'USET', 00255 'ASET1', 'BSET1', 'CSET1', 'QSET1', #'USET1', 00256 'SET1', 'SET3', 00257 00258 # super-element sets 00259 'SESET', 00260 00261 # tables 00262 #'DTABLE', 'TABLEHT', 'TABRNDG', 00263 'TABLED1', 'TABLED2', 'TABLED3',#'TABLED4', 00264 'TABLEM1', 'TABLEM2', 'TABLEM3', 'TABLEM4', 00265 'TABLES1', 'TABLEST', 00266 'TABRND1', 'TABRNDG', 00267 00268 # initial conditions - sid (set ID) 00269 #'TIC', (in tables.py) 00270 00271 # methods - @todo EIGRL not done??? 00272 'EIGB', 'EIGR', 'EIGRL', 00273 00274 # cMethods - @todo EIGC not done??? 00275 'EIGC', 'EIGP', 00276 00277 # other 00278 'INCLUDE', # '=' 00279 'ENDDATA', 00280 ]) 00281 00282 caseControlCards = set(['FREQ', 'GUST', 'MPC', 'SPC', 'NLPARM', 'NSM', 00283 'TEMP', 'TSTEPNL', 'INCLUDE']) 00284 self.uniqueBulkDataCards = self.cardsToRead.difference( 00285 caseControlCards) 00286 00287 ## / is the delete from restart card 00288 self.specialCards = ['DEQATN', '/'] 00289 ## was playing around with an idea...does nothing for now... 00290 self.cardsToWrite = self.cardsToRead 00291 00292 def disableCards(self, cards): 00293 """ 00294 @see disable_cards 00295 """ 00296 warnings.warn('disableCards has been deprecated; use disable_cards', 00297 DeprecationWarning, stacklevel=2) 00298 self.disable_cards(cards) 00299 00300 def disable_cards(self, cards): 00301 """ 00302 Method for removing broken cards from the reader 00303 @param self the object pointer 00304 @param cards a list/set of cards that should not be read 00305 """ 00306 disableSet = set(cards) 00307 self.cardsToRead.difference(disableSet) 00308 00309 def is_thermal_solution(self): 00310 """ 00311 @todo implement case control deck checker 00312 @warning dont use this...returns False 00313 """ 00314 return False 00315 #self.caseControlDeck.is_thermal_solution() 00316 00317 def _init_solution(self): 00318 """ 00319 creates storage objects for the BDF object 00320 this would be in the init but doing it this way allows for 00321 better inheritance 00322 00323 References: 00324 1. http://www.mscsoftware.com/support/library/conf/wuc87/p02387.pdf 00325 """ 00326 self.bdf_filename = None 00327 self.autoReject = False 00328 self.solmap_toValue = { 00329 00330 'NONLIN' : 101, #66 -> 101 per Reference 1 00331 'SESTATIC' : 101, 00332 'SESTATICS' : 101, 00333 'SEMODES' : 103, 00334 'BUCKLING' : 105, 00335 'SEBUCKL' : 105, 00336 'NLSTATIC' : 106, 00337 'SEDCEIG' : 107, 00338 'SEDFREQ' : 108, 00339 'SEDTRAN' : 109, 00340 'SEMCEIG' : 110, 00341 'SEMFREQ' : 111, 00342 'SEMTRAN' : 112, 00343 'CYCSTATX' : 114, 00344 'CYCMODE' : 115, 00345 'CYCBUCKL' : 116, 00346 'CYCFREQ' : 118, 00347 'NLTRAN' : 129, 00348 'AESTAT' : 144, 00349 'FLUTTR' : 145, 00350 'SEAERO' : 146, 00351 'NLSCSH' : 153, 00352 'NLTCSH' : 159, 00353 'DBTRANS' : 190, 00354 'DESOPT' : 200, 00355 00356 # guessing 00357 #'CTRAN' : 115, 00358 'CFREQ' : 118, 00359 00360 # solution 200 names 00361 'STATICS' : 101, 00362 'MODES' : 103, 00363 'BUCK' : 105, 00364 'DFREQ' : 108, 00365 'MFREQ' : 111, 00366 'MTRAN' : 112, 00367 'DCEIG' : 107, 00368 'MCEIG' : 110, 00369 #'HEAT' : None, 00370 #'STRUCTURE': None, 00371 #'DIVERGE' : None, 00372 'FLUTTER' : 145, 00373 'SAERO' : 146, 00374 } 00375 00376 self.rsolmap_toStr = { 00377 66 : 'NONLIN', 00378 101 : 'SESTSTATIC', # linear static 00379 103 : 'SEMODES' , # modal 00380 105 : 'BUCKLING' , # buckling 00381 106 : 'NLSTATIC' , # non-linear static 00382 107 : 'SEDCEIG' , # direct complex frequency response 00383 108 : 'SEDFREQ' , # direct frequency response 00384 109 : 'SEDTRAN' , # direct transient response 00385 110 : 'SEMCEIG' , # modal complex eigenvalue 00386 111 : 'SEMFREQ' , # modal frequency response 00387 112 : 'SEMTRAN' , # modal transient response 00388 114 : 'CYCSTATX' , 00389 115 : 'CYCMODE' , 00390 116 : 'CYCBUCKL' , 00391 118 : 'CYCFREQ' , 00392 129 : 'NLTRAN' , # nonlinear transient 00393 144 : 'AESTAT' , # static aeroelastic 00394 145 : 'FLUTTR' , # flutter/aeroservoelastic 00395 146 : 'SEAERO' , # dynamic aeroelastic 00396 153 : 'NLSCSH' , # nonlinear static thermal 00397 159 : 'NLTCSH' , # nonlinear transient thermal 00398 190 : 'DBTRANS' , 00399 200 : 'DESOPT' , # optimization 00400 } 00401 self._init_structural_defaults() 00402 self._init_aero_defaults() 00403 self._init_thermal_defaults() 00404 00405 def _is_special_card(self, cardName): 00406 """these cards are listed in the case control and the bulk data deck""" 00407 if cardName in self.specialCards: 00408 return True 00409 return False 00410 00411 def _init_structural_defaults(self): 00412 """ 00413 creates storage objects for the BDF object 00414 this would be in the init but doing it this way allows for 00415 better inheritance 00416 """ 00417 ## the analysis type 00418 self.sol = None 00419 ## used in solution 600, method 00420 self.solMethod = None 00421 ## the line with SOL on it, marks ??? 00422 self.iSolLine = None 00423 self.caseControlDeck = CaseControlDeck([], self.log) 00424 #self.executive_control_lines = [self.sol] 00425 00426 # main structural block 00427 ## store the PARAM cards 00428 self.params = {} 00429 ## stores SPOINT, GRID cards 00430 self.nodes = {} 00431 self.spoints = None 00432 ## stores GRIDSET card 00433 self.gridSet = None 00434 ## stores elements (CQUAD4, CTRIA3, CHEXA8, CTETRA4, CROD, CONROD, etc.) 00435 self.elements = {} 00436 ## stores rigid elements (RBE2, RBE3, RJOINT, etc.) 00437 self.rigidElements = {} 00438 ## store CMASS1,CMASS2,CMASS3,CMASS4,CMASS5 00439 #self.massElements = {} 00440 ## stores LOTS of propeties (PBAR, PBEAM, PSHELL, PCOMP, etc.) 00441 self.properties = {} 00442 ## stores MAT1, MAT2, MAT3,...MAT10 (no MAT4, MAT5) 00443 self.materials = {} 00444 ## stores MATS1 00445 self.materialDeps = {} 00446 ## stores the CREEP card 00447 self.creepMaterials = {} 00448 00449 # loads 00450 ## stores LOAD, FORCE, MOMENT, etc. 00451 self.loads = {} 00452 #self.gusts = {} # Case Control GUST = 100 00453 #self.random = {} # Case Control RANDOM = 100 00454 00455 ## stores coordinate systems 00456 self.coords = {0: CORD2R() } 00457 00458 # constraints 00459 ## stores SUPORT1s 00460 #self.constraints = {} # suport1, anything else??? 00461 self.suports = [] # suport, suport1 00462 00463 ## stores SPCADD,SPC,SPC1,SPCD,SPCAX 00464 self.spcObject2 = constraintObject2() 00465 ## stores MPCADD,MPC 00466 self.mpcObject2 = constraintObject2() 00467 00468 self.spcs = {} 00469 self.spcadds = {} 00470 00471 self.mpcs = {} 00472 self.mpcadds = {} 00473 00474 # dynamic cards 00475 ## stores DAREA 00476 self.dareas = {} 00477 ## stores NLPARM 00478 self.nlparms = {} 00479 ## stores TSTEPs 00480 self.tsteps = {} 00481 ## stores TSTEPNL 00482 self.tstepnls = {} 00483 00484 ## direct matrix input - DMIG 00485 self.dmis = {} 00486 self.dmigs = {} 00487 self.dmijs = {} 00488 self.dmijis = {} 00489 self.dmiks = {} 00490 self.dequations = {} 00491 00492 ## frequencies 00493 self.frequencies = {} 00494 00495 # optimization 00496 self.dconstrs = {} 00497 self.desvars = {} 00498 self.ddvals = {} 00499 self.dlinks = {} 00500 self.dresps = {} 00501 ## stores DVPREL1, DVPREL2...might change to DVxRel 00502 self.dvprels = {} 00503 self.dvmrels = {} 00504 self.doptprm = None 00505 00506 ## SETx 00507 self.sets = {} 00508 self.asets = [] 00509 self.bsets = [] 00510 self.csets = [] 00511 self.qsets = [] 00512 ## SESETx 00513 self.setsSuper = {} 00514 ## tables 00515 self.tables = {} 00516 ## randomTables 00517 self.randomTables = {} 00518 00519 ## methods 00520 self.methods = {} ## EIGB, EIGR, EIGRL 00521 self.cMethods = {} ## EIGC, EIGP 00522 00523 def _init_aero_defaults(self): 00524 """ 00525 creates storage objects for the BDF object 00526 this would be in the init but doing it this way allows for 00527 better inheritance 00528 """ 00529 # aero cards 00530 ## stores CAEROx 00531 self.caeros = {} 00532 ## stores PAEROx 00533 self.paeros = {} 00534 ## stores AERO 00535 self.aero = {} 00536 ## stores AEROS 00537 self.aeros = {} 00538 00539 ## stores AEFACT 00540 self.aefacts = {} 00541 ## stores AELINK 00542 self.aelinks = {} 00543 ## stores AELIST 00544 self.aelists = {} 00545 ## stores AEPARAM 00546 self.aeparams = {} 00547 ## stores AESURF 00548 self.aesurfs = {} 00549 ## stores AESTAT 00550 self.aestats = {} 00551 00552 ## stores GUST cards 00553 self.gusts = {} 00554 ## stores FLFACT 00555 self.flfacts = {} # can this be simplified ??? 00556 ## stores FLUTTER 00557 self.flutters = {} 00558 ## mkaeros 00559 self.mkaeros = [] 00560 ## store SPLINE1,SPLINE2,SPLINE4,SPLINE5 00561 self.splines = {} 00562 ## stores TRIM 00563 self.trims = {} 00564 00565 def _init_thermal_defaults(self): 00566 """initializes some bdf parameters""" 00567 # BCs 00568 ## stores thermal boundary conditions - CONV,RADBC 00569 self.bcs = {} # e.g. RADBC 00570 ## defines the MAT4, MAT5, MATT4, etc. @todo verify MATT4 00571 self.thermalMaterials = {} 00572 00573 # elements 00574 # see self.elements 00575 00576 # properties 00577 ## stores other thermal properties - unused ??? 00578 #self.thermalProperties = {} 00579 ## stores PHBDY 00580 self.phbdys = {} 00581 ## stores convection properties - PCONV, PCONVM ??? 00582 self.convectionProperties = {} 00583 00584 def readBDF(self, infilename, includeDir=None, xref=True): 00585 """ 00586 main read method for the bdf 00587 @param infilename 00588 the input bdf 00589 @param includeDir 00590 the relative path to any include files (default=None 00591 if no include files) 00592 @param xref 00593 should the bdf be cross referenced (default=True) 00594 """ 00595 self._set_infile(infilename, includeDir) 00596 00597 fname = self.print_filename(self.bdf_filename) 00598 self.log.debug('---starting BDF.readBDF of %s---' %(fname)) 00599 #self.log.info('xref=%s' %(xref)) 00600 sys.stdout.flush() 00601 00602 #self.debug = True 00603 if self.debug: 00604 self.log.debug("*BDF.readBDF") 00605 self._read_executive_control_deck() 00606 self._read_case_control_deck(self.bdf_filename) 00607 self._read_bulk_data_deck() 00608 00609 self.crossReference(xref=xref) 00610 if self.debug: 00611 self.log.debug("***BDF.readBDF") 00612 00613 self.log.debug('---finished BDF.readBDF of %s---' %(fname)) 00614 sys.stdout.flush() 00615 00616 def readBDF_Punch(self, infilename, includeDir=None, xref=True): 00617 """ 00618 BDF punch file reader 00619 @param infilename 00620 the input bdf 00621 @param includeDir 00622 the relative path to any include files (default=None 00623 if no include files) 00624 @param xref 00625 should the bdf be cross referenced (default=True) 00626 """ 00627 self._set_infile(infilename, includeDir) 00628 00629 fname = self.print_filename(self.bdf_filename) 00630 self.log.debug('---starting BDF.readBDF_Punch of %s---' %(fname)) 00631 #self.log.info('xref=%s' %(xref)) 00632 sys.stdout.flush() 00633 00634 #self.debug = True 00635 if self.debug: 00636 self.log.debug("*BDF.readBDF_Punch") 00637 self._read_bulk_data_deck() 00638 #self.close_file() 00639 self.crossReference(xref=xref) 00640 if self.debug: 00641 self.log.debug("***BDF.readBDF_Punch") 00642 00643 self.log.debug('---finished BDF.readBDF_Punch of %s---' %(fname)) 00644 sys.stdout.flush() 00645 00646 def _is_executive_control_deck(self, line): 00647 """@todo code this...""" 00648 return True 00649 00650 def _read_executive_control_deck(self): 00651 """reads the executive control deck""" 00652 self.open_file(self.bdf_filename) 00653 line = '' 00654 emptyLines = 0 00655 while emptyLines < 50 and 'CEND' not in line.upper()[:4]: 00656 line = self.infilesPack[-1].readline() 00657 line = line.rstrip('\n\r\t ') 00658 if(len(line) > 0): 00659 self.executive_control_lines.append(line) 00660 else: 00661 emptyLines += 1 00662 ### 00663 ### 00664 00665 if 0: # old method; breaks DMAP alters 00666 while len(self._active_filenames) > 0: # keep going until finished 00667 lineIn = self.get_next_line() 00668 #print(lineIn) 00669 if lineIn == None: # file was closed and a 2nd readCaseControl 00670 return # was called 00671 00672 line = lineIn.strip() 00673 if self.debug: 00674 (n) = self.get_line_number() 00675 self.log.debug("executiveLine[%s] = |%s|" %(n, line)) 00676 self.executive_control_lines.append(lineIn) 00677 if 'CEND' in line.upper(): 00678 break 00679 ### 00680 ### 00681 self._parse_executive_control_deck() 00682 00683 def _parse_executive_control_deck(self): 00684 """extracts the solution from the executive control deck""" 00685 for (i, eline) in enumerate(self.executive_control_lines): 00686 #print 'eLine = |%r|' %(eline) 00687 uline = eline.strip().upper() # uppercase line 00688 uline = uline.split('$')[0] 00689 if 'SOL ' in uline[:4]: 00690 #print "line = ",uline 00691 if ',' in uline: 00692 sline = uline.split(',') # SOL 600,method 00693 solValue = sline[0] 00694 method = sline[1] 00695 00696 #print "sline = |%s|" %(sline) 00697 #print "sline2 = |%s|" %(sline2) 00698 else: 00699 solValue = uline 00700 method = None 00701 00702 #print "solValue = |%s|" %(solValue) 00703 sol = solValue[3:].strip() 00704 00705 assert self.sol == None, ('cannot overwrite solution existing=' 00706 '|SOL %s| new =|%s|' %(self.sol,uline)) 00707 self.iSolLine = i 00708 00709 try: 00710 self.update_solution(sol, method) 00711 except: 00712 msg = ('update_solution failed...line=%s' %(uline)) 00713 raise RuntimeError(msg) 00714 ### 00715 ### 00716 ### 00717 #print("sol = ", sol) 00718 00719 def updateSolution(self, sol, method=None): 00720 """ 00721 @see update_solution 00722 """ 00723 warnings.warn('updateSolution has been deprecated; use ' 00724 'update_solution', DeprecationWarning, stacklevel=2) 00725 self.update_solution(sol, method) 00726 00727 def update_solution(self, sol, method=None): 00728 """ 00729 updates the overall solution type (e.g. 101,200,600) 00730 @param self the object pointer 00731 @param sol the solution type (101,103, etc) 00732 @param method the solution method (only for SOL=600), default=None 00733 """ 00734 ## the integer of the solution type (e.g. SOL 101) 00735 try: 00736 self.sol = int(sol) 00737 #print "sol = |%s|" %(sol) 00738 except ValueError: 00739 #print "sol = |%r|" %(sol) 00740 self.sol = self.solmap_toValue[sol] 00741 #print "sol = ",self.sol 00742 00743 if self.sol == 600: 00744 ## solution 600 method modifier 00745 self.solMethod = method.strip() 00746 self.log.debug("sol=%s method=%s" %(self.sol, self.solMethod)) 00747 else: # very common 00748 self.solMethod = None 00749 ### 00750 #print "sol=%s method=%s" %(self.sol,self.solMethod) 00751 00752 00753 def setDynamicSyntax(self, dictOfVars): 00754 """@see set_dynamic_syntax""" 00755 warnings.warn('setDynamicSyntax has been deprecated; use ' 00756 'set_dynamic_syntax',DeprecationWarning, stacklevel=2) 00757 self.set_dynamic_syntax(dictOfVars) 00758 00759 def set_dynamic_syntax(self, dictOfVars): 00760 """ 00761 uses the OpenMDAO syntax of %varName in an embedded BDF to 00762 update the values for an optimization study. 00763 Variables should be 7 characters to fit in an 8-character field. 00764 %varName 00765 dictOfVars = {'varName': 10} 00766 """ 00767 self.dictOfVars = {} 00768 for (key, value) in sorted(dictOfVars.iteritems()): 00769 assert len(key) <= 7, ('max length for key is 7; ' 00770 'len(%s)=%s' %(key, len(key))) 00771 self.dictOfVars[key.upper()] = value 00772 ### 00773 self.isDynamicSyntax = True 00774 00775 def _is_case_control_deck(self, line): 00776 """@todo not done...""" 00777 #print "line = |%r|" %(line) 00778 lineUpper = line.upper().strip() 00779 #print "line = |%s|" %(lineUpper) 00780 if 'CEND' in line.upper(): 00781 raise SyntaxError('invalid Case Control Deck card...CEND...') 00782 if '=' in lineUpper or ' ' in lineUpper: 00783 #print "True1" 00784 return True 00785 for card in self.uniqueBulkDataCards: 00786 lenCard = len(card) 00787 if card in lineUpper[:lenCard]: 00788 #print "*card = |%s|" %(card) 00789 #print "False1" 00790 return False 00791 #print "card = |%s|" %(card) 00792 #print "True2" 00793 return True 00794 00795 def _read_case_control_deck(self, infilename): 00796 """ 00797 reads the case control deck 00798 @note called with recursion if an INCLUDE file is found 00799 """ 00800 #print "opening |%s|" %(infilename) 00801 self.open_file(infilename) 00802 #self.log.info("reading Case Control Deck...") 00803 line = '' 00804 #self.caseControlControlLines = [] 00805 00806 i = 0 00807 while len(self._active_filenames)>0: # keep going until finished 00808 #while 'BEGIN BULK' not in line: 00809 lineIn = self.get_next_line() 00810 #print("lineIn = |%r|" % (lineIn)) 00811 #print("lineIn = ", lineIn) 00812 if lineIn == None: 00813 return # file was closed and a 2nd readCaseControl was called 00814 if not self._is_case_control_deck(lineIn): 00815 self.linesPack = [lineIn]+self.linesPack 00816 line = lineIn.strip().split('$')[0].strip() 00817 lineUpper = line.upper() 00818 00819 (line, lineUpper) = self._checkForIncludeFile_CaseControlDeck( 00820 lineIn, line, lineUpper) 00821 00822 #print "*line = |%s|" %(line) 00823 if 'BEGIN' in lineUpper and 'BULK' in lineUpper: 00824 self.log.debug('found the end of the case control deck!') 00825 #print "breaking" 00826 break 00827 if i > 10000: 00828 raise RuntimeError('there are too many lines in the ' 00829 'Case Control Deck; max=10000') 00830 i += 1 00831 #self.log.info("finished with Case Control Deck..") 00832 #print("self.case_controlLines = ",self.case_control_lines) 00833 00834 #for line in self.case_control_lines: 00835 #print "** line=|%r|" %(line) 00836 00837 self.caseControlDeck = CaseControlDeck(self.case_control_lines, 00838 self.log) 00839 self.caseControlDeck.solmap_toValue = self.solmap_toValue 00840 self.caseControlDeck.rsolmap_toStr = self.rsolmap_toStr 00841 00842 #print "done w/ case control..." 00843 #print '***********************' 00844 return self.case_control_lines 00845 00846 def _checkForIncludeFile_CaseControlDeck(self, lineIn, line, lineUpper): 00847 """ 00848 Special parsing must be done if an INCLUDE file is found. 00849 @param lineIn 00850 the current line without any stripping of comments (defined by $) 00851 @param line 00852 the current line 00853 @param lineUpper 00854 the current line (in all caps) 00855 @retval line 00856 the new current line 00857 @retval lineUpper 00858 the new current line (in all caps) 00859 """ 00860 if lineUpper.startswith('INCLUDE'): 00861 nextLine = self.get_next_line().strip().split('$')[0].strip() 00862 includeLines = [line] 00863 #print "^&*1",nextLine 00864 while '\\' in nextLine or '/' in nextLine: # more includes 00865 includeLines.append(nextLine) 00866 nextLine = self.get_next_line().strip().split('$')[0].strip() 00867 #print "^&*2",nextLine 00868 00869 #print "include lines = |%s|" %(includeLines) 00870 filename = self._get_include_file_name(includeLines) 00871 00872 self._add_include_file(filename) 00873 #self.open_file(filename) 00874 self._read_case_control_deck(filename) 00875 line = nextLine 00876 #print "appending |%r|" %(nextLine) 00877 self.case_control_lines.append(nextLine) 00878 else: 00879 #print "appending |%r|" %(lineIn) 00880 self.case_control_lines.append(lineIn) 00881 ### 00882 return (line, lineUpper) 00883 00884 def _get_card_name(self, cardLines): 00885 """ 00886 Given a list of card lines, determines the cardName. 00887 @param self the object pointer 00888 @param cardLines the list of lines that define the card 00889 @retval cardName the name of the card 00890 @note 00891 Parses the first 8 characters of a card, splits bassed on a comma, 00892 pulls off any spaces or asterisks and returns what is left. 00893 """ 00894 #self.log.debug("getting cardName...") 00895 cardName = cardLines[0][0:8].strip() 00896 if ',' in cardName: 00897 cardName = cardName.split(',')[0].strip() 00898 00899 cardName = cardName.lstrip().rstrip(' *') 00900 #self.log.debug("_get_card_name cardName=|%s|" %(cardName)) 00901 return cardName 00902 00903 def _is_reject(self, cardName): 00904 """Can the card be read""" 00905 #cardName = self._get_card_name(card) 00906 if cardName.startswith('='): 00907 return False 00908 elif cardName in self.cardsToRead: 00909 #print "*card = ",card 00910 #print "RcardName = |%s|" %(cardName) 00911 return False 00912 if cardName: 00913 if cardName not in self.rejectCount: 00914 self.log.info("RejectCardName = |%s|" %(cardName)) 00915 self.rejectCount[cardName] = 0 00916 self.rejectCount[cardName] += 1 00917 return True 00918 00919 def _get_include_file_name(self, cardLines): 00920 """Parses an INCLUDE file split into multiple lines (as a list). 00921 @param self 00922 the BDF object 00923 @param cardLines 00924 the list of lines in the include card (all the lines!) 00925 @param cardName 00926 INCLUDE or include (needed to strip it off without converting 00927 the case) 00928 @retval filename the INCLUDE filename 00929 """ 00930 cardLines2 = [] 00931 for line in cardLines: 00932 line = line.strip('\t\r\n ') 00933 cardLines2.append(line) 00934 00935 cardLines2[0] = cardLines2[0][7:].strip() # truncate the cardname 00936 filename = ''.join(cardLines2) 00937 filename = filename.strip('"').strip("'") 00938 if ':' in filename: 00939 ifilepaths = filename.split(':') 00940 filename = os.path.join(*ifilepaths) 00941 #print 'filename = |%s|' % (filename) 00942 filename = os.path.join(self.includeDir, filename) 00943 return filename 00944 00945 def _add_include_file(self, infileName): 00946 """ 00947 This method must be called before opening an INCLUDE file. 00948 Identifies the new file as being opened. 00949 @param self the object pointer 00950 @param infileName the new INCLUDE file 00951 @note isOpened[fileName] is really initialized to False 00952 """ 00953 self.isOpened[infileName] = False 00954 00955 def _read_bulk_data_deck(self): 00956 """parses the Bulk Data Deck""" 00957 if self.debug: 00958 self.log.debug("*read_bulk_data_deck") 00959 self.open_file(self.bdf_filename) 00960 00961 #old_card_obj = BDFCard() 00962 while len(self._active_filenames) > 0: # keep going until finished 00963 ## gets the cardLines 00964 (rawCard, card, cardName) = self._get_card(debug=False) 00965 #print "outcard = ",card 00966 00967 if cardName == 'INCLUDE': 00968 #print "rawCard = ",rawCard 00969 #print "card = ",card 00970 filename = self._get_include_file_name(rawCard) 00971 #print 'filename = ', os.path.relpath(filename) 00972 self._add_include_file(filename) 00973 self.open_file(filename) 00974 reject = '$ INCLUDE processed: %s\n' % (filename) 00975 self.rejects.append([reject]) 00976 continue 00977 #elif cardName is None: 00978 #self.close_file() 00979 #continue 00980 00981 passCard = False 00982 if self._is_special_card(cardName): 00983 passCard = True 00984 card = rawCard 00985 #print(rawCard) 00986 elif not self._is_reject(cardName): 00987 #print "" 00988 #print "not a reject" 00989 card = self.processCard(card) # parse the card into fields 00990 #print "processedCard = ",card 00991 elif card[0].strip() == '': 00992 #print "funny strip thing..." 00993 pass 00994 else: 00995 #print "reject!" 00996 self.rejects.append(card) 00997 continue 00998 #print " rejecting card = ",card 00999 #card = self.processCard(card) 01000 01001 #print "card2 = ",ListPrint(card) 01002 #print "card = ",card 01003 #cardName = self._get_card_name(card) 01004 01005 if 'ENDDATA' in cardName: 01006 #print cardName 01007 break # exits while loop 01008 #self.log.debug('cardName = |%s|' %(cardName)) 01009 01010 #cardObj = BDFCard(card,oldCardObj) 01011 #if cardName in self.specialCards: 01012 # cardObj = card 01013 #else: 01014 # cardObj = BDFCard(card) 01015 #cardObj = BDFCard(card) 01016 01017 nCards = 1 01018 #special = False 01019 if '=' in cardName: 01020 nCards = cardName.strip('=()') 01021 if nCards: 01022 nCards = int(nCards) 01023 else: 01024 nCards = 1 01025 #special = True 01026 #print "nCards = ",nCards 01027 #cardName = oldCardObj.field(0) 01028 ### 01029 01030 for iCard in xrange(nCards): 01031 #print "----------------------------" 01032 #if special: 01033 #print "iCard = ",iCard 01034 self.add_card(card, cardName, iCard=0, old_card_obj=None) 01035 #if self.foundEndData: 01036 # break 01037 ### iCard 01038 if self.doneReading or len(self.linesPack[-1])==0: 01039 #print("doneReading=%s len(pack)=%s" 01040 # %(self.doneReading, len(self.linesPack[-1]))) 01041 self.close_file() 01042 ### 01043 #oldCardObj = copy.deepcopy(cardObj) # used for =(*1) stuff 01044 #print "" 01045 01046 #print "self.linesPack[-1] = ",len(self.linesPack[-1]) 01047 #print "self._active_filenames = ",self._active_filenames 01048 ### end of while loop 01049 01050 #self.debug = True 01051 if self.debug: 01052 #for nid,node in self.nodes.iteritems(): 01053 #print node 01054 #for eid,element in self.elements.iteritems(): 01055 #print element 01056 01057 #self.log.debug("\n$REJECTS") 01058 #for reject in self.rejects: 01059 #print printCard(reject) 01060 #print ''.join(reject) 01061 self.log.debug("***read_bulk_data_deck") 01062 ### 01063 01064 def addCard(self, card, cardName, iCard=0, oldCardObj=None): 01065 """@see add_card""" 01066 warnings.warn('addCard has been deprecated; use add_card', 01067 DeprecationWarning, stacklevel=2) 01068 return self.add_card(card, cardName, iCard=iCard, 01069 old_card_obj=oldCardObj) 01070 01071 def add_card(self, card, cardName, iCard=0, old_card_obj=None): 01072 """ 01073 adds a card object to the BDF object. 01074 @param self 01075 the object pointer 01076 @param card 01077 the list of the card fields -> ['GRID',1,2,] 01078 @param cardName 01079 the cardName -> 'GRID' 01080 @param iCard 01081 used when reading Nastran Free-Format (disabled) 01082 @param old_card_obj 01083 the last card object that was returned (type=BDFCard or None; 01084 default=None) 01085 @retval cardObject 01086 the card object representation of card 01087 @note 01088 this is a very useful method for interfacing with the code 01089 @note 01090 the cardObject is not a card-type object...so not a GRID card 01091 or CQUAD4 object. It's a BDFCard Object. However, you know the 01092 type (assuming a GRID), so just call the mesh.Node(nid) to get the 01093 No de object that was just created. 01094 @warning 01095 cardObject is not returned 01096 @todo this method is 600+ lines long...refactor time... 01097 """ 01098 #print "card = ",card 01099 01100 #if cardName in self.specialCards: 01101 # pass #cardObj = card 01102 #else: 01103 cardObj = BDFCard(card, oldCardObj=None) 01104 01105 #cardObj = BDFCard(card, old_card_obj=None) 01106 #if self.debug: 01107 # self.log.debug(card) 01108 # self.log.debug("*old_card_obj = \n%s" %(old_card_obj)) 01109 # self.log.debug("*cardObj = \n%s" %(cardObj)) 01110 #cardObj.applyOldFields(iCard) 01111 01112 try: 01113 if self.autoReject == True: 01114 print('rejecting processed %s' %(card)) 01115 self.reject_cards.append(card) 01116 elif card == [] or cardName == '': 01117 pass 01118 elif cardName == 'DMIG': # not done... 01119 if cardObj.field(2)=='UACCEL': # special DMIG card 01120 self.reject_cards.append(card) 01121 elif cardObj.field(2)==0: 01122 dmig = DMIG(cardObj) 01123 self.addDMIG(dmig) 01124 else: 01125 name = cardObj.field(1) 01126 dmig = self.dmigs[name] 01127 dmig.addColumn(cardObj) 01128 ### 01129 elif cardName == 'DMIJ': 01130 if cardObj.field(2)==0: 01131 dmij = DMIJ(cardObj) 01132 self.addDMIJ(dmij) 01133 else: 01134 name = cardObj.field(1) 01135 dmij = self.dmijs[name] 01136 dmij.addColumn(cardObj) 01137 elif cardName == 'DMIJI': 01138 if cardObj.field(2)==0: 01139 dmiji = DMIJI(cardObj) 01140 self.addDMIJI(dmiji) 01141 else: 01142 name = cardObj.field(1) 01143 dmiji = self.dmijis[name] 01144 dmiji.addColumn(cardObj) 01145 elif cardName == 'DMIK': 01146 if cardObj.field(2)==0: 01147 dmik = DMIK(cardObj) 01148 self.addDMIK(dmik) 01149 else: 01150 name = cardObj.field(1) 01151 dmik = self.dmiks[name] 01152 dmik.addColumn(cardObj) 01153 elif cardName == 'DMI': 01154 if cardObj.field(2)==0: 01155 dmi = DMI(cardObj) 01156 self.addDMI(dmi) 01157 else: 01158 name = cardObj.field(1) 01159 dmi = self.dmis[name] 01160 dmi.addColumn(cardObj) 01161 01162 elif cardName == 'DEQATN': # buggy for commas 01163 #print 'DEQATN: cardObj.card=%s' %(cardObj.card) 01164 #equation = DEQATN(cardObj) 01165 #self.addDEQATN(equation) 01166 self.rejects.append(card) 01167 01168 elif cardName == 'GRID': 01169 node = GRID(cardObj) 01170 self.addNode(node) 01171 elif cardName == 'GRDSET': 01172 self.gridSet = GRDSET(cardObj) 01173 01174 #elif cardName == 'RINGAX': 01175 # node = RINGAX(cardObj) 01176 # self.addNode(node) 01177 elif cardName == 'SPOINT': 01178 spoint = SPOINTs(cardObj) 01179 self.addSPoint(spoint) 01180 01181 elif cardName == 'CQUAD4': 01182 elem = CQUAD4(cardObj) 01183 self.addElement(elem) 01184 elif cardName == 'CQUAD8': 01185 elem = CQUAD8(cardObj) 01186 self.addElement(elem) 01187 elif cardName == 'CQUAD': 01188 elem = CQUAD(cardObj) 01189 self.addElement(elem) 01190 elif cardName == 'CQUADR': 01191 elem = CQUADR(cardObj) 01192 self.addElement(elem) 01193 elif cardName == 'CQUADX': 01194 elem = CQUADX(cardObj) 01195 self.addElement(elem) 01196 01197 elif cardName == 'CTRIA3': 01198 elem = CTRIA3(cardObj) 01199 self.addElement(elem) 01200 elif cardName == 'CTRIA6': 01201 elem = CTRIA6(cardObj) 01202 self.addElement(elem) 01203 01204 elif cardName == 'CTRIAR': 01205 elem = CTRIAR(cardObj) 01206 self.addElement(elem) 01207 elif cardName == 'CTRIAX': 01208 elem = CTRIAX(cardObj) 01209 self.addElement(elem) 01210 elif cardName == 'CTRIAX6': 01211 elem = CTRIAX6(cardObj) 01212 self.addElement(elem) 01213 01214 elif cardName == 'CTETRA': # 4/10 nodes 01215 nFields = cardObj.nFields() 01216 if nFields == 7: 01217 elem = CTETRA4(cardObj) # 4+3 01218 else: 01219 elem = CTETRA10(cardObj) # 10+3 01220 self.addElement(elem) 01221 elif cardName == 'CHEXA': # 8/20 nodes 01222 nFields = cardObj.nFields() 01223 if nFields == 11: 01224 elem = CHEXA8(cardObj) # 8+3 01225 else: 01226 elem = CHEXA20(cardObj) # 20+3 01227 self.addElement(elem) 01228 elif cardName == 'CPENTA': # 6/15 nodes 01229 nFields = cardObj.nFields() 01230 if nFields == 9: 01231 elem = CPENTA6(cardObj) # 6+3 01232 else: 01233 elem = CPENTA15(cardObj) # 15+3 01234 self.addElement(elem) 01235 01236 elif cardName == 'CBAR': 01237 elem = CBAR(cardObj) 01238 self.addElement(elem) 01239 elif cardName == 'CBEAM': 01240 elem = CBEAM(cardObj) 01241 self.addElement(elem) 01242 elif cardName == 'CBEAM3': 01243 elem = CBEAM3(cardObj) 01244 self.addElement(elem) 01245 elif cardName == 'CROD': 01246 elem = CROD(cardObj) 01247 self.addElement(elem) 01248 elif cardName == 'CONROD': 01249 elem = CONROD(cardObj) 01250 self.addElement(elem) 01251 elif cardName == 'CTUBE': 01252 elem = CTUBE(cardObj) 01253 self.addElement(elem) 01254 elif cardName == 'CBEND': 01255 elem = CBEND(cardObj) 01256 self.addElement(elem) 01257 01258 elif cardName == 'CELAS1': 01259 elem = CELAS1(cardObj) 01260 self.addElement(elem) 01261 elif cardName == 'CELAS2': 01262 (elem) = CELAS2(cardObj) 01263 self.addElement(elem) 01264 elif cardName == 'CELAS3': 01265 (elem) = CELAS3(cardObj) 01266 self.addElement(elem) 01267 elif cardName == 'CELAS4': 01268 (elem) = CELAS4(cardObj) 01269 self.addElement(elem) 01270 01271 elif cardName == 'CBUSH': 01272 (elem) = CBUSH(cardObj) 01273 self.addDamperElement(elem) 01274 elif cardName == 'CBUSH1D': 01275 (elem) = CBUSH1D(cardObj) 01276 self.addDamperElement(elem) 01277 elif cardName == 'CFAST': 01278 (elem) = CFAST(cardObj) 01279 self.addDamperElement(elem) 01280 01281 elif cardName == 'CDAMP1': 01282 (elem) = CDAMP1(cardObj) 01283 self.addDamperElement(elem) 01284 elif cardName == 'CDAMP2': 01285 (elem) = CDAMP2(cardObj) 01286 self.addDamperElement(elem) 01287 elif cardName == 'CDAMP3': 01288 (elem) = CDAMP3(cardObj) 01289 self.addDamperElement(elem) 01290 elif cardName == 'CDAMP4': 01291 (elem) = CDAMP4(cardObj) 01292 self.addDamperElement(elem) 01293 elif cardName == 'CDAMP5': 01294 (elem) = CDAMP5(cardObj) 01295 self.addDamperElement(elem) 01296 01297 elif cardName == 'CONM1': 01298 elem = CONM1(cardObj) 01299 self.addElement(elem) 01300 elif cardName == 'CONM2': 01301 elem = CONM2(cardObj) 01302 self.addElement(elem) 01303 01304 elif cardName == 'CMASS1': 01305 elem = CMASS1(cardObj) 01306 self.addElement(elem) 01307 elif cardName == 'CMASS2': 01308 elem = CMASS2(cardObj) 01309 self.addElement(elem) 01310 elif cardName == 'CMASS3': 01311 elem = CMASS3(cardObj) 01312 self.addElement(elem) 01313 elif cardName == 'CMASS4': 01314 elem = CMASS4(cardObj) 01315 self.addElement(elem) 01316 01317 elif cardName == 'CVISC': 01318 elem = CVISC(cardObj) 01319 self.addElement(elem) 01320 elif cardName == 'CSHEAR': 01321 elem = CSHEAR(cardObj) 01322 self.addElement(elem) 01323 elif cardName == 'CGAP': 01324 elem = CGAP(cardObj) 01325 self.addElement(elem) 01326 01327 elif cardName == 'CRAC2D': 01328 elem = CRAC2D(cardObj) 01329 self.addElement(elem) 01330 elif cardName == 'CRAC3D': 01331 elem = CRAC3D(cardObj) 01332 self.addElement(elem) 01333 01334 # rigid elements 01335 elif cardName == 'RBAR': 01336 (elem) = RBAR(cardObj) 01337 self.addRigidElement(elem) 01338 elif cardName == 'RBAR1': 01339 (elem) = RBAR1(cardObj) 01340 self.addRigidElement(elem) 01341 elif cardName == 'RBE1': 01342 (elem) = RBE1(cardObj) 01343 self.addRigidElement(elem) 01344 elif cardName == 'RBE2': 01345 (elem) = RBE2(cardObj) 01346 self.addRigidElement(elem) 01347 elif cardName == 'RBE3': 01348 (elem) = RBE3(cardObj) 01349 self.addRigidElement(elem) 01350 01351 elif cardName == 'PSHELL': 01352 prop = PSHELL(cardObj) 01353 self.addProperty(prop) 01354 elif cardName == 'PCOMP': 01355 prop = PCOMP(cardObj) 01356 self.addProperty(prop) 01357 elif cardName == 'PCOMPG': # hasnt been verified 01358 prop = PCOMPG(cardObj) 01359 self.addProperty(prop) 01360 elif cardName == 'PSHEAR': 01361 prop = PSHEAR(cardObj) 01362 self.addProperty(prop) 01363 01364 elif cardName == 'PSOLID': 01365 prop = PSOLID(cardObj) 01366 self.addProperty(prop) 01367 elif cardName == 'PBAR': 01368 prop = PBAR(cardObj) 01369 self.addProperty(prop) 01370 elif cardName == 'PBARL': 01371 prop = PBARL(cardObj) 01372 self.addProperty(prop) 01373 elif cardName == 'PBEAM': 01374 prop = PBEAM(cardObj) 01375 self.addProperty(prop) 01376 #elif cardName == 'PBEAM3': 01377 # prop = PBEAM3(cardObj) 01378 # self.addProperty(prop) 01379 #elif cardName == 'PBEAML': # disabled 01380 # prop = PBEAML(cardObj) 01381 # self.addProperty(prop) 01382 elif cardName == 'PELAS': 01383 prop = PELAS(cardObj) 01384 self.addProperty(prop) 01385 if cardObj.field(5): 01386 prop = PELAS(cardObj, 1) # makes 2nd PELAS card 01387 self.addProperty(prop) 01388 elif cardName == 'PVISC': 01389 prop = PVISC(cardObj) 01390 self.addProperty(prop) 01391 if cardObj.field(5): 01392 prop = PVISC(card, 1) 01393 self.addProperty(prop) 01394 elif cardName == 'PROD': 01395 prop = PROD(cardObj) 01396 self.addProperty(prop) 01397 elif cardName == 'PTUBE': 01398 prop = PTUBE(cardObj) 01399 self.addProperty(prop) 01400 elif cardName == 'PMASS': 01401 prop = PMASS(cardObj, nOffset=0) 01402 self.addProperty(prop) 01403 01404 if cardObj.field(3) is not None: 01405 prop = PMASS(cardObj, nOffset=1) 01406 self.addProperty(prop) 01407 if cardObj.field(5) is not None: 01408 prop = PMASS(cardObj, nOffset=2) 01409 self.addProperty(prop) 01410 if cardObj.field(7) is not None: 01411 prop = PMASS(cardObj, nOffset=3) 01412 self.addProperty(prop) 01413 ### 01414 elif cardName == 'PLSOLID': 01415 prop = PLSOLID(cardObj) 01416 self.addProperty(prop) 01417 01418 elif cardName == 'PBUSH1D': 01419 prop = PBUSH1D(cardObj) 01420 self.addProperty(prop) 01421 #elif cardName == 'PBUSHT': 01422 # prop = PBUSHT(cardObj) 01423 # self.addProperty(prop) 01424 elif cardName == 'PBUSH': 01425 prop = PBUSH(cardObj) 01426 self.addProperty(prop) 01427 elif cardName == 'PFAST': 01428 prop = PFAST(cardObj) 01429 self.addProperty(prop) 01430 01431 elif cardName == 'PDAMPT': 01432 prop = PDAMPT(cardObj) 01433 self.addProperty(prop) 01434 elif cardName == 'PDAMP': 01435 prop = PDAMP(cardObj) 01436 self.addProperty(prop) 01437 if cardObj.field(3): 01438 prop = PDAMP(cardObj, 1) # makes 2nd PDAMP card 01439 self.addProperty(prop) 01440 if cardObj.field(5): 01441 prop = PDAMP(cardObj, 1) # makes 3rd PDAMP card 01442 self.addProperty(prop) 01443 01444 elif cardName == 'PDAMP5': 01445 prop = PDAMP5(cardObj) 01446 self.addProperty(prop) 01447 elif cardName == 'PGAP': 01448 elem = PGAP(cardObj) 01449 self.addProperty(elem) 01450 01451 elif cardName == 'CREEP': # hasnt been verified 01452 creep = CREEP(cardObj) 01453 # links up to MAT1, MAT2, MAT9 w/ same MID 01454 self.addCreepMaterial(creep) 01455 elif cardName == 'MAT1': 01456 material = MAT1(cardObj) 01457 self.addMaterial(material) 01458 elif cardName == 'MAT2': 01459 material = MAT2(cardObj) 01460 self.addMaterial(material) 01461 elif cardName == 'MAT3': 01462 material = MAT3(cardObj) 01463 self.addMaterial(material) 01464 elif cardName == 'MAT4': 01465 material = MAT4(cardObj) 01466 self.addThermalMaterial(material) 01467 elif cardName == 'MAT5': 01468 material = MAT5(cardObj) 01469 self.addThermalMaterial(material) 01470 elif cardName == 'MAT8': # note there is no MAT6 or MAT7 01471 material = MAT8(cardObj) 01472 self.addMaterial(material) 01473 elif cardName == 'MAT9': 01474 material = MAT9(cardObj) 01475 self.addMaterial(material) 01476 elif cardName == 'MAT10': 01477 material = MAT10(cardObj) 01478 self.addMaterial(material) 01479 01480 elif cardName == 'MATHP': 01481 material = MATHP(cardObj) 01482 self.addMaterial(material) 01483 01484 elif cardName == 'MATS1': 01485 material = MATS1(cardObj) 01486 self.addMaterialDependence(material) 01487 #elif cardName == 'MATT1': 01488 # material = MATT1(cardObj) 01489 # self.addTempMaterial(material) 01490 #elif cardName == 'MATT2': 01491 # material = MATT2(cardObj) 01492 # self.addTempMaterial(material) 01493 #elif cardName == 'MATT3': 01494 # material = MATT3(cardObj) 01495 # self.addTempMaterial(material) 01496 #elif cardName == 'MATT4': 01497 # material = MATT4(cardObj) 01498 # self.addTempMaterial(material) 01499 #elif cardName == 'MATT5': 01500 # material = MATT5(cardObj) 01501 # self.addTempMaterial(material) 01502 #elif cardName == 'MATT8': 01503 # material = MATT8(cardObj) 01504 # self.addTempMaterial(material) 01505 #elif cardName == 'MATT9': 01506 # material = MATT9(cardObj) 01507 # self.addTempMaterial(material) 01508 01509 # cards contained within the LOAD card 01510 elif cardName == 'FORCE': 01511 force = FORCE(cardObj) 01512 self.addLoad(force) 01513 elif cardName == 'FORCE1': 01514 force = FORCE1(cardObj) 01515 self.addLoad(force) 01516 elif cardName == 'FORCE2': 01517 force = FORCE2(cardObj) 01518 self.addLoad(force) 01519 elif cardName == 'MOMENT': 01520 moment = MOMENT(cardObj) 01521 self.addLoad(moment) 01522 elif cardName == 'MOMENT1': 01523 moment = MOMENT1(cardObj) 01524 self.addLoad(moment) 01525 elif cardName == 'MOMENT2': 01526 moment = MOMENT2(cardObj) 01527 self.addLoad(moment) 01528 elif cardName == 'GRAV': 01529 grav = GRAV(cardObj) 01530 self.addLoad(grav) 01531 elif cardName == 'ACCEL1': 01532 grav = ACCEL1(cardObj) 01533 self.addLoad(grav) 01534 elif cardName == 'LOAD': 01535 load = LOAD(cardObj) 01536 self.addLoad(load) 01537 elif cardName == 'PLOAD': 01538 load = PLOAD(cardObj) 01539 self.addLoad(load) 01540 elif cardName == 'PLOAD1': 01541 load = PLOAD1(cardObj) 01542 self.addLoad(load) 01543 elif cardName == 'PLOAD2': 01544 load = PLOAD2(cardObj) 01545 self.addLoad(load) 01546 elif cardName == 'PLOAD4': 01547 load = PLOAD4(cardObj) 01548 self.addLoad(load) 01549 elif cardName == 'PLOADX1': 01550 load = PLOADX1(cardObj) 01551 self.addLoad(load) 01552 elif cardName == 'RFORCE': 01553 load = RFORCE(cardObj) 01554 self.addLoad(load) 01555 01556 01557 elif cardName == 'LSEQ': 01558 load = LSEQ(cardObj) 01559 self.addLSeq(load) 01560 01561 elif cardName == 'DLOAD': 01562 load = DLOAD(cardObj) 01563 self.addLoad(load) 01564 elif cardName == 'SLOAD': 01565 load = SLOAD(cardObj) 01566 self.addLoad(load) 01567 01568 elif cardName == 'TLOAD1': 01569 load = TLOAD1(cardObj) 01570 self.addLoad(load) 01571 elif cardName == 'TLOAD2': 01572 load = TLOAD2(cardObj) 01573 self.addLoad(load) 01574 elif cardName == 'RLOAD1': 01575 load = RLOAD1(cardObj) 01576 self.addLoad(load) 01577 elif cardName == 'RLOAD2': 01578 load = RLOAD2(cardObj) 01579 self.addLoad(load) 01580 elif cardName == 'RANDPS': 01581 load = RANDPS(cardObj) 01582 self.addLoad(load) 01583 01584 # thermal loads 01585 elif cardName == 'TEMP': 01586 load = TEMP(cardObj) 01587 self.addThermalLoad(load) 01588 #elif cardName == 'TEMPD': 01589 # load = TEMPD(cardObj) 01590 # self.addThermalLoad(load) 01591 elif cardName == 'QBDY1': 01592 load = QBDY1(cardObj) 01593 self.addThermalLoad(load) 01594 elif cardName == 'QBDY2': 01595 load = QBDY2(cardObj) 01596 self.addThermalLoad(load) 01597 elif cardName == 'QBDY3': 01598 load = QBDY3(cardObj) 01599 self.addThermalLoad(load) 01600 elif cardName == 'QHBDY': 01601 load = QHBDY(cardObj) 01602 self.addThermalLoad(load) 01603 01604 # thermal elements 01605 elif cardName == 'CHBDYE': 01606 element = CHBDYE(cardObj) 01607 self.addThermalElement(element) 01608 elif cardName == 'CHBDYG': 01609 element = CHBDYG(cardObj) 01610 self.addThermalElement(element) 01611 elif cardName == 'CHBDYP': 01612 element = CHBDYP(cardObj) 01613 self.addThermalElement(element) 01614 01615 # thermal properties 01616 elif cardName == 'PCONV': 01617 prop = PCONV(cardObj) 01618 self.addConvectionProperty(prop) 01619 elif cardName == 'PCONVM': 01620 prop = PCONVM(cardObj) 01621 self.addConvectionProperty(prop) 01622 elif cardName == 'PHBDY': 01623 prop = PHBDY(cardObj) 01624 self.addPHBDY(prop) 01625 01626 # thermal BCs 01627 elif cardName == 'CONV': 01628 bc = CONV(cardObj) 01629 self.addThermalBC(bc, bc.eid) 01630 #elif cardName == 'RADM': 01631 # bc = RADM(cardObj) 01632 # self.addThermalBC(bc, bc.nodamb) 01633 elif cardName == 'RADBC': 01634 bc = RADBC(cardObj) 01635 self.addThermalBC(bc, bc.nodamb) 01636 01637 #elif cardName == 'TABLEH1': 01638 # load = TABLEH1(cardObj) 01639 # self.addTable(load) 01640 01641 # constraints 01642 elif cardName == 'MPC': 01643 constraint = MPC(cardObj) 01644 self.addConstraint_MPC(constraint) 01645 elif cardName == 'MPCADD': 01646 constraint = MPCADD(cardObj) 01647 #assert not isinstance(constraint,SPCADD) 01648 self.addConstraint_MPC(constraint) 01649 01650 # constraints 01651 elif cardName == 'SPC': 01652 constraint = SPC(cardObj) 01653 self.addConstraint_SPC(constraint) 01654 elif cardName == 'SPC1': 01655 constraint = SPC1(cardObj) 01656 self.addConstraint_SPC(constraint) 01657 elif cardName == 'SPCAX': 01658 constraint = SPCAX(cardObj) 01659 self.addConstraint_SPC(constraint) 01660 elif cardName == 'SPCD': 01661 constraint = SPCD(cardObj) 01662 self.addConstraint_SPC(constraint) 01663 elif cardName == 'SPCADD': 01664 constraint = SPCADD(cardObj) 01665 #assert not isinstance(constraint,MPCADD) 01666 self.addConstraint_SPC(constraint) 01667 elif cardName == 'SUPORT': # pseudo-constraint 01668 suport = SUPORT(cardObj) 01669 self.addSuport(suport) 01670 elif cardName == 'SUPORT1': # pseudo-constraint 01671 suport1 = SUPORT1(cardObj) 01672 self.addConstraint(suport1) 01673 01674 # aero 01675 elif cardName == 'SPLINE1': 01676 aero = SPLINE1(cardObj) 01677 self.addSpline(aero) 01678 elif cardName == 'SPLINE2': 01679 aero = SPLINE2(cardObj) 01680 self.addSpline(aero) 01681 #elif cardName == 'SPLINE3': 01682 #aero = SPLINE3(cardObj) 01683 #self.addSpline(aero) 01684 elif cardName == 'SPLINE4': 01685 aero = SPLINE4(cardObj) 01686 self.addSpline(aero) 01687 elif cardName == 'SPLINE5': 01688 aero = SPLINE5(cardObj) 01689 self.addSpline(aero) 01690 01691 elif cardName == 'CAERO1': 01692 aero = CAERO1(cardObj) 01693 self.addCAero(aero) 01694 elif cardName == 'CAERO2': 01695 aero = CAERO2(cardObj) 01696 self.addCAero(aero) 01697 #elif cardName == 'CAERO3': 01698 # aero = CAERO3(cardObj) 01699 # self.addCAero(aero) 01700 elif cardName == 'PAERO1': 01701 aero = PAERO1(cardObj) 01702 self.addPAero(aero) 01703 elif cardName == 'PAERO2': 01704 aero = PAERO2(cardObj) 01705 self.addPAero(aero) 01706 #elif cardName == 'PAERO3': 01707 # aero = PAERO3(cardObj) 01708 # self.addPAero(aero) 01709 elif cardName == 'AERO': 01710 aero = AERO(cardObj) 01711 self.addAero(aero) 01712 elif cardName == 'AEROS': 01713 aeros = AEROS(cardObj) 01714 self.addAeros(aeros) 01715 01716 elif cardName == 'AEFACT': 01717 aefact = AEFACT(cardObj) 01718 self.addAEFact(aefact) 01719 elif cardName == 'AELINK': 01720 aelink = AELINK(cardObj) 01721 self.addAELink(aelink) 01722 elif cardName == 'AELIST': 01723 aelist = AELIST(cardObj) 01724 self.addAEList(aelist) 01725 elif cardName == 'AEPARM': 01726 aeparm = AEPARM(cardObj) 01727 self.addAEParam(aeparm) 01728 elif cardName == 'AESTAT': 01729 aestat = AESTAT(cardObj) 01730 self.addAEStat(aestat) 01731 elif cardName == 'AESURF': 01732 aesurf = AESURF(cardObj) 01733 self.addAESurf(aesurf) 01734 01735 elif cardName == 'TRIM': 01736 trim = TRIM(cardObj) 01737 self.addTrim(trim) 01738 01739 elif cardName == 'FLUTTER': 01740 flutter = FLUTTER(cardObj) 01741 self.addFlutter(flutter) 01742 elif cardName == 'MKAERO1': 01743 mkaero = MKAERO1(cardObj) 01744 self.addMKAero(mkaero) 01745 elif cardName == 'MKAERO2': 01746 mkaero = MKAERO2(cardObj) 01747 self.addMKAero(mkaero) 01748 01749 elif cardName == 'FLFACT': 01750 flfact = FLFACT(cardObj) 01751 self.addFLFACT(flfact) 01752 elif cardName == 'GUST': 01753 gust = GUST(cardObj) 01754 self.addGUST(gust) 01755 01756 # dynamic 01757 elif cardName == 'DAREA': 01758 darea = DAREA(cardObj) 01759 self.addDArea(darea) 01760 if cardObj.field(5): 01761 darea = DAREA(cardObj, 1) 01762 self.addDArea(darea) 01763 elif cardName == 'NLPARM': 01764 nlparmObj = NLPARM(cardObj) 01765 self.addNLParm(nlparmObj) 01766 elif cardName == 'TSTEP': 01767 tstepObj = TSTEP(cardObj) 01768 self.addTSTEP(tstepObj) 01769 elif cardName == 'TSTEPNL': 01770 tstepnlObj = TSTEPNL(cardObj) 01771 self.addTSTEPNL(tstepnlObj) 01772 01773 # frequencies 01774 elif cardName == 'FREQ': 01775 freq = FREQ(cardObj) 01776 self.addFREQ(freq) 01777 elif cardName == 'FREQ1': 01778 freq = FREQ1(cardObj) 01779 self.addFREQ(freq) 01780 elif cardName == 'FREQ2': 01781 freq = FREQ2(cardObj) 01782 self.addFREQ(freq) 01783 #elif cardName == 'FREQ3': 01784 # freq = FREQ3(cardObj) 01785 # self.addFREQ(freq) 01786 #elif cardName == 'FREQ4': 01787 # freq = FREQ4(cardObj) 01788 # self.addFREQ(freq) 01789 #elif cardName == 'FREQ5': 01790 # freq = FREQ5(cardObj) 01791 # self.addFREQ(freq) 01792 01793 # SETx 01794 elif cardName == 'ASET': 01795 set_obj = ASET(cardObj) 01796 self.addASet(set_obj) 01797 elif cardName == 'BSET': 01798 set_obj = BSET(cardObj) 01799 self.addBSet(set_obj) 01800 elif cardName == 'CSET': 01801 set_obj = CSET(cardObj) 01802 self.addCSet(set_obj) 01803 elif cardName == 'QSET': 01804 set_obj = QSET(cardObj) 01805 self.addQSet(set_obj) 01806 elif cardName == 'ASET1': 01807 set_obj = ASET1(cardObj) 01808 self.addASet(set_obj) 01809 elif cardName == 'BSET1': 01810 set_obj = BSET1(cardObj) 01811 self.addBSet(set_obj) 01812 elif cardName == 'CSET1': 01813 set_obj = CSET1(cardObj) 01814 self.addCSet(set_obj) 01815 elif cardName == 'QSET1': 01816 set_obj = QSET1(cardObj) 01817 self.addQSet(set_obj) 01818 01819 #elif cardName == 'USET': 01820 # set_obj = USET(cardObj) 01821 # self.addSet(set_obj) 01822 #elif cardName == 'USET1': 01823 # set_obj = USET1(cardObj) 01824 # self.addSet(set_obj) 01825 elif cardName == 'SET1': 01826 set_obj = SET1(cardObj) 01827 self.addSet(set_obj) 01828 #elif cardName == 'SET2': 01829 # set_obj = SET2(cardObj) 01830 # self.addSet(set_obj) 01831 elif cardName == 'SET3': 01832 set_obj = SET3(cardObj) 01833 self.addSet(set_obj) 01834 01835 elif cardName == 'SESET': 01836 set_obj = SESET(cardObj) 01837 self.addSetSuper(set_obj) 01838 01839 # optimization 01840 elif cardName == 'DCONSTR': 01841 flutter = DCONSTR(cardObj) 01842 self.addDConstr(flutter) 01843 elif cardName == 'DESVAR': 01844 desvar = DESVAR(cardObj) 01845 self.addDesvar(desvar) 01846 elif cardName == 'DDVAL': 01847 ddval = DDVAL(cardObj) 01848 self.addDDVal(ddval) 01849 elif cardName == 'DLINK': 01850 dlink = DLINK(cardObj) 01851 self.addDLink(dlink) 01852 elif cardName == 'DRESP1': 01853 ddval = DRESP1(cardObj) 01854 self.addDResp(ddval) 01855 elif cardName == 'DRESP2': 01856 ddval = DRESP2(cardObj) 01857 self.addDResp(ddval) 01858 elif cardName == 'DVPREL1': 01859 dvprel = DVPREL1(cardObj) 01860 self.addDvprel(dvprel) 01861 elif cardName == 'DVPREL2': 01862 dvprel = DVPREL2(cardObj) 01863 self.addDvprel(dvprel) 01864 elif cardName == 'DVMREL1': 01865 dvmrel = DVMREL1(cardObj) 01866 self.addDvmrel(dvmrel) 01867 #elif cardName == 'DVMREL2': 01868 # dvmrel = DVMREL2(cardObj) 01869 # self.addDvmrel(dvmrel) 01870 elif cardName == 'DOPTPRM': 01871 doptprm = DOPTPRM(cardObj) 01872 #self.addDoptprm(doptprm) 01873 self.doptprm = doptprm 01874 01875 # coordinate systems 01876 elif cardName == 'CORD2R': 01877 coord = CORD2R(cardObj) 01878 self.addCoord(coord) 01879 elif cardName == 'CORD2C': 01880 coord = CORD2C(cardObj) 01881 self.addCoord(coord) 01882 elif cardName == 'CORD2S': 01883 coord = CORD2S(cardObj) 01884 self.addCoord(coord) 01885 01886 elif cardName == 'CORD1R': 01887 coord = CORD1R(cardObj) 01888 self.addCoord(coord) 01889 if cardObj.field(5): 01890 coord = CORD1R(cardObj, nCoord=1) 01891 self.addCoord(coord) 01892 ### 01893 elif cardName == 'CORD1C': 01894 coord = CORD1C(cardObj) 01895 self.addCoord(coord) 01896 if cardObj.field(5): 01897 coord = CORD1C(cardObj, nCoord=1) 01898 self.addCoord(coord) 01899 ### 01900 elif cardName == 'CORD1S': 01901 coord = CORD1S(cardObj) 01902 self.addCoord(coord) 01903 if cardObj.field(5): 01904 coord = CORD1S(cardObj, nCoord=1) 01905 self.addCoord(coord) 01906 ### 01907 #elif cardName == 'CORD3G': 01908 # coord = CORD3G(cardObj) 01909 # self.addCoord(coord) 01910 01911 # Table 01912 elif cardName == 'TABLED1': 01913 table = TABLED1(cardObj) 01914 self.addTable(table) 01915 elif cardName == 'TABLED2': 01916 table = TABLED2(cardObj) 01917 self.addTable(table) 01918 elif cardName == 'TABLED3': 01919 table = TABLED3(cardObj) 01920 self.addTable(table) 01921 #elif cardName == 'TABLED4': 01922 # table = TABLED4(cardObj) 01923 # self.addTable(table) 01924 01925 elif cardName == 'TABLEM1': 01926 table = TABLEM1(cardObj) 01927 self.addTable(table) 01928 elif cardName == 'TABLEM2': 01929 table = TABLEM2(cardObj) 01930 self.addTable(table) 01931 elif cardName == 'TABLEM3': 01932 table = TABLEM3(cardObj) 01933 self.addTable(table) 01934 elif cardName == 'TABLEM4': 01935 table = TABLEM4(cardObj) 01936 self.addTable(table) 01937 01938 elif cardName == 'TABLES1': 01939 table = TABLES1(cardObj) 01940 self.addTable(table) 01941 elif cardName == 'TABLEST': 01942 table = TABLEST(cardObj) 01943 self.addTable(table) 01944 01945 # randomTables 01946 elif cardName == 'TABRND1': 01947 table = TABRND1(cardObj) 01948 self.addRandomTable(table) 01949 elif cardName == 'TABRNDG': 01950 table = TABRNDG(cardObj) 01951 self.addRandomTable(table) 01952 01953 # Methods 01954 elif cardName == 'EIGB': 01955 method = EIGB(cardObj) 01956 self.addMethod(method) 01957 elif cardName == 'EIGR': 01958 method = EIGR(cardObj) 01959 self.addMethod(method) 01960 elif cardName == 'EIGRL': 01961 method = EIGRL(cardObj, sol=self.sol) 01962 self.addMethod(method) 01963 01964 # CMethods 01965 elif cardName == 'EIGC': 01966 method = EIGC(cardObj) 01967 self.addCMethod(method) 01968 elif cardName == 'EIGP': 01969 method = EIGP(cardObj) 01970 self.addCMethod(method) 01971 01972 01973 elif cardName == 'PARAM': 01974 param = PARAM(cardObj) 01975 self.addParam(param) 01976 elif 'ENDDATA' in cardName: 01977 self.foundEndData = True 01978 #break 01979 else: 01980 ## @warning cards with = signs in them 01981 ## are not announced when they are rejected 01982 if '=' not in card[0]: 01983 print('rejecting processed %s' %(card)) 01984 self.reject_cards.append(card) 01985 ### 01986 except: 01987 print("cardName = |%r|" %(cardName)) 01988 print("failed! Unreduced Card=%s\n" %(ListPrint(card))) 01989 print("filename = %s\n" %(self.bdf_filename)) 01990 sys.stdout.flush() 01991 raise 01992 01993 return cardObj 01994