pyNastran  0.5.0
pyNastran BDF Reader/Writer, OP2 Parser, and GUI
oesWriter.py
Go to the documentation of this file.
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 struct import pack
00026 
00027 class Oes1Writer(object):
00028     def writeOES1(self):
00029         """
00030         writes isotropic/composite stress/strain
00031         @todo assumes sCode=0 (stress) or 10 (strain)
00032         """
00033         msg += self.printHeader('OES1X1',8)
00034         # OES1X1
00035         stress = [
00036               self.rodStress,
00037               self.barStress,  
00038               self.beamStress, 
00039               self.plateStress,
00040               self.solidStress,
00041         ]
00042         cstress = [self.compositePlateStress,] # OES1C
00043 
00044         # approachCode=1, tableCode=1
00045         for data in stress:
00046             for iSubcase in data:
00047                 msg += self.writeMarkers([self.iTable,1,0])
00048                 msg += self.writeOES(iSubcase,data)
00049                 self.iTable-=1
00050         msg += self.writeMarkers([self.iTable,1,0])
00051         
00052         # ----------------
00053         msg += self.printHeader('OSTR1X',8)
00054         # OSTR1X
00055         strain = [
00056               self.rodStrain,
00057               self.barStrain,
00058               self.beamStrain,
00059               self.plateStrain,
00060               self.solidStrain,
00061               self.compositePlateStrain, 
00062         ]
00063         for data in strain:
00064             for iSubcase in data:
00065                 msg += self.writeMarkers([self.iTable,1,0])
00066                 msg += self.writeOES(iSubcase,data)
00067                 self.iTable-=1
00068         msg += self.writeMarkers([self.iTable,1,0])
00069 
00070         # ----------------
00071         msg = self.printHeader('OSTRIC',8)
00072         cstrain = [self.compositePlateStrain,] # OSTR1C
00073         for data in cstrain:
00074             for iSubcase in data:
00075                 msg += self.writeMarkers([self.iTable,1,0])
00076                 msg += self.writeOES(iSubcase,data)
00077                 self.iTable-=1
00078         msg += self.writeMarkers([self.iTable,1,0])
00079 
00080 
 All Classes Namespaces Files Functions Variables