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 from pyNastran.op2.tables.oqg_constraintForces.oqg_spcForces import SPCForcesObject #,ComplexSPCForcesObject 00026 from pyNastran.op2.tables.oqg_constraintForces.oqg_mpcForces import MPCForcesObject #,ComplexMPCForcesObject 00027 00028 00029 class OQG(object): 00030 def __init__(self): 00031 self.spcForces = {} 00032 self.mpcForces = {} 00033 00034 def getSpcForces(self): 00035 (subcaseName,iSubcase,transient,dt,analysisCode,isSort1) = self.readSubcaseNameID() 00036 headers = self.skip(2) 00037 #print "headers = %s" %(headers) 00038 00039 data = self.readTable([int,str,float,float,float,float,float,float]) 00040 00041 dataCode = {'log':self.log, 'analysisCode':analysisCode, 00042 'deviceCode':1, 'tableCode':3, 'sortCode':0, 00043 'sortBits':[0,0,0], 'numWide':8, 'tableName':'OQG', 00044 'nonlinearFactor':dt, } 00045 00046 if iSubcase in self.spcForces: 00047 self.spcForces[iSubcase].addF06Data(data,transient) 00048 else: 00049 isSort1 = True 00050 spc = SPCForcesObject(dataCode,isSort1,iSubcase) 00051 spc.addF06Data(data,transient) 00052 self.spcForces[iSubcase] = spc 00053 self.iSubcases.append(iSubcase) 00054 00055 def getMpcForces(self): 00056 (subcaseName,iSubcase,transient,dt,analysisCode,isSort1) = self.readSubcaseNameID() 00057 headers = self.skip(2) 00058 #print "headers = %s" %(headers) 00059 00060 data = self.readTable([int,str,float,float,float,float,float,float]) 00061 00062 dataCode = {'log':self.log, 'analysisCode':analysisCode, 00063 'deviceCode':1,'tableCode':39, 00064 'sortCode':0, 'sortBits':[0,0,0], 'numWide':8, 00065 'tableName':'OQG', 'nonlinearFactor':dt, } 00066 00067 if iSubcase in self.mpcForces: 00068 self.mpcForces[iSubcase].addF06Data(data,transient) 00069 else: 00070 isSort1 = True 00071 mpc = MPCForcesObject(dataCode,isSort1,iSubcase) 00072 mpc.addF06Data(data,transient) 00073 self.mpcForces[iSubcase] = mpc 00074 self.iSubcases.append(iSubcase) 00075