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 class MaxDisplacement(object): 00026 def __init__(self,data): 00027 self.translations = {} 00028 self.rotations = {} 00029 for line in data: 00030 sid = line[0] 00031 self.translations[sid] = line[1:4] 00032 self.rotations[sid] = line[4:] 00033 ### 00034 00035 def writeF06(self,pageStamp='',pageNum=1): 00036 msg = ['0 MAXIMUM DISPLACEMENTS', 00037 ' SUBCASE/', 00038 ' DAREA ID T1 T2 T3 R1 R2 R3'] 00039 for sid,trans in sorted(self.translations.iteritems()): 00040 rot = self.rotations[sid] 00041 msg.append('0 %8i %13.8E %13.8E %13.8E %13.8E %13.8E %13.8E' %(tuple([sid]+trans+rot))) 00042 msg.append(pageStamp+str(pageNum)) 00043 return '\n'.join(msg) 00044