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 PanairWrite(object): 00026 def __init__(self): 00027 pass 00028 00029 def printAbutments(self): 00030 msg = '' 00031 msg += ' SUMMARY OF FACING SURFACES (+:upper, -:lower)\n' 00032 msg += ' abutment nw-ident ntd knet.edge nw-ident ntd knet.edge\n' 00033 msg += ' 1 winga 12 1.3+ wingwk 18 7.1+\n' 00034 msg += ' wingwk 18 7.1- winga 12 1.1+\n' 00035 msg += ' winga 12 1.1- winga 12 1.3-\n' 00036 msg += ' 9 1st p-o-s 0 -1.0 bodyl 12 3.4+\n' 00037 msg += ' bodyl 12 3.4- 1st p-o-s 0 -1.0\n' 00038 00039 for patchID,patch in self.patches.items(): 00040 (p1,x1,y1,z1) = patch.getEdges() 00041 self.log.debug("p[%s] = %s" %(patchID,p1)) 00042 #print "x = ",x1 00043 #print "y = ",y1 00044 #print "z = ",z1 00045 00046 return msg 00047 00048 def printOptions(self): 00049 msg='' 00050 msg += '0 print options\n' 00051 msg += ' %i = singularity grid print flag\n' %(self.isings) 00052 msg += ' %i = panel geometry print flag\n' %(self.igeomp) 00053 msg += ' %i = spline data flag ( 0 ==> off, nonzero ==> on )\n' %(self.isingp) 00054 msg += ' %i = control point information print flag\n' %(self.icontp) 00055 msg += ' %i = boundary condition data print flag \n' %(self.ibconp) 00056 msg += ' %i = edge matching information print flag\n' %(self.iedgep) 00057 msg += ' %i = index of control point for which aic-s are printed\n' %(self.ipraic) 00058 msg += ' %i = edge control point flow properties print flag\n' %(self.nexdgn) 00059 msg += ' %i = output control flag (-1 ==> no surface flow properties, 0 ==> standard output, 1 ==> short form output )\n' %(self.ioutpr) 00060 msg += ' %s = force/moment control flag (-1 ==> no force and moment data, 0 ==> standard output, 1 ==> nw totals only )\n' %(self.ifmcpr) 00061 msg += ' %i = print flag for detailed cost information during execution of job\n' %(self.icostp) 00062 msg += ' 1 = print flag for singularity parameter maps\n' 00063 msg += '0 abutment processing options\n' 00064 msg += ' %10s = global edge abutment tolerance specified by user. if this value is zero, a default value will be calculated\n' %(fortranValue(self.epsgeo)) 00065 msg += ' later. this default value is taken as: .001 * (minimum panel diameter)\n' 00066 msg += ' %i = print flag controlling geometry printout b e f o r e the abutment processing. ( nonzero ==> do print )\n' %(self.igeoin) 00067 msg += ' %i = print flag controlling geometry printout a f t e r the abutment processing. ( nonzero ==> do print )\n' %(self.igeout) 00068 msg += ' %i = network/abutment/abutment-intersection print flag. ( nonzero ==> generate the cross referenced abutment listing\n' %(self.nwxref) 00069 msg += ' %i = control index for panel intersection checking. ( nonzero ==> do perform the check. )\n' %(self.triint) 00070 msg += ' %i = abutment/abutment-intersection (short listing) print flag ( 0 ==> suppress, nonzero ==> generate usual print )\n' %(2) 00071 msg += ' \n' 00072 msg += ' force and moment reference parameters\n' 00073 msg += ' %10s = reference area for force and moment calculations. (sref)\n' %(fortranValue(self.sref)) 00074 msg += ' %10s = rolling moment reference length (bref)\n' %(fortranValue(self.bref)) 00075 msg += ' %10s = pitching moment reference length (cref)\n' %(fortranValue(self.cref)) 00076 msg += ' %10s = yawing moment reference length (dref)\n' %(fortranValue(self.dref)) 00077 msg += ' %10s = x - coordinate for the point about which moments will be calculated (xref)\n' %(fortranValue(self.xref)) 00078 msg += ' %10s = y - coordinate for the point about which moments will be calculated (yref)\n' %(fortranValue(self.yref)) 00079 msg += ' %10s = z - coordinate for the point about which moments will be calculated (zref)\n' %(fortranValue(self.zref)) 00080 msg += ' 3 = pressure coefficient index (nprcof) (1=linear, 2=slenderbody, 3=2nd, 4=isentropic)\n' 00081 msg += '1\n' 00082 return msg 00083 00084 def printOutHeader(self): 00085 msg = """\n 00086 **************************************************************************************************** 00087 00088 dynamic memory management initialization 00089 00090 max no. levels 15 max no. arrays 200 maximum scratch storage 900000 total storage provided 900000 00091 addr(maplev) 0 addr(maplws) 0 addr(scratch storage) 1 00092 00093 **************************************************************************************************** 00094 wopen call on unit 1 blocks: 10 status: 0 00095 wopen call on unit 2 blocks: 10 status: 0 00096 wopen call on unit 3 blocks: 10 status: 0 00097 1 00098 00099 00100 ***************************************************************************** 00101 * * 00102 * a502 - pan-air technology program * 00103 * * 00104 * potential flow about arbitrary configurations * 00105 * version id = ht2 (12 feb 92) boeing ver i00 * 00106 * * 00107 * 02/12/92 * 00108 * * 00109 * * 00110 * simple wing-body with composite panel. (run with a502i) 00111 * saaris 865-6209 m/s 7c-36 00112 * * 00113 * * 00114 * * 00115 ***************************************************************************** 00116 1 00117 0*b*input-da 00118 00119 00120 00121 00122 00123 00124 - list of a502 input data cards -\n""" 00125 return msg 00126 00127 def printGridSummary(self): 00128 msg='';msg2='';msg3='' 00129 00130 self.nOffBodyPoints = 0 00131 self.nStreamlines = 0 00132 msg += ' 1 *** quick summary of a502 input ***\n' 00133 00134 for i,titleLine in enumerate(self.titleLines): 00135 msg += "title%s:%s\n" %(i+1,titleLine) 00136 00137 msg += '0 processing options\n' 00138 msg += ' %i = datacheck. (0=regular run,1=full datacheck,2=short datacheck)\n' %(self.dataCheck) 00139 msg += ' 0 = s.p. flag. (0 ==> no s.p. file (ft09) provided, 1 ==> local file ft09 with singularity values is provided)\n' 00140 msg += ' 0 = aic flag. (0 ==> no aic file (ft04) provided, 1 ==> local file ft04 with aic-s is provided by the user)\n' 00141 msg += ' 0 = b.l. flag (0 ==> no boundary layer file requested, 1 ==> boundary layer data will be written to file ft17)\n' 00142 msg += ' 0 = velocity correction index. (0 ==> no correction, 1 ==> mclean correction, 2 ==> boctor correction)\n' 00143 msg += ' 0 = flow visualization flag. (nonzero ==> off-body and streamline processing will be performed)\n' 00144 msg += ' 0 = off-body calculation type. (0 ==> mass flux, nonzero ==> velocity)\n' 00145 msg += ' 0 = streamline calculation type. (0 ==> mass flux, nonzero ==> velocity)\n' 00146 msg += ' %2i = number of off-body points.\n' %(self.nOffBodyPoints) 00147 msg += ' %2i = number of streamlines to be traced.\n' %(self.nStreamlines) 00148 msg += '0 case summary\n' 00149 msg += ' %2i = number of cases\n' %(self.ncases) 00150 msg += ' %f = mach number\n' %(self.mach) 00151 msg += ' %f = compressibility axis angle of attack (alpc)\n' %(self.alphaC) 00152 msg += ' %f = compressibliity axis angle of sideslip (betc)\n' %(self.betaC) 00153 00154 00155 msg3 += '0network id&index #rows #cols kt src dblt nlopt1 nropt1 nlopt2 nropt2 ipot # pts # pans cpnorm cum pt cum pn\n' 00156 msg3 += '---------- ----- ----- ----- -- --- ---- ------ ------ ------ ------ ---- ---- ---- ------ ------ ------\n' 00157 00158 totalPoints = 0 00159 totalPanels = 0 00160 for patchID in xrange(self.nPatches()): 00161 patch = self.patch(patchID) 00162 msg3 += patch.quickSummary(totalPoints,totalPanels) 00163 totalPanels += patch.nPanels() 00164 totalPoints += patch.nPoints() 00165 ### 00166 00167 msg2 += '0 case alpha beta mag(f-s-v)\n' 00168 msg2 += ' ------ ---------- ---------- -----------\n' 00169 for (iCase) in xrange(self.ncases): 00170 alpha=self.alphas[iCase]; beta=self.betas[iCase] 00171 msg2 += ' %2s %f %f 1.000000\n' %(iCase+1,alpha,beta) 00172 00173 msg2 += '0 symmetry options\n' 00174 msg2 += ' %s = number of planes of symmetry\n' %(self.nSymmetryPlanes) 00175 msg2 += ' %s = x-z plane of symmetry flag (0 ==> no symmetry, 1==> flow symmetry, -1 ==> flow antisymmetry)\n' %(self.XZsymmetry) 00176 msg2 += ' %s = x-y plane of symmetry flag (0 ==> no symmetry, 1==> flow symmetry, -1 ==> flow antisymmetry)\n' %(self.XYsymmetry) 00177 msg2 += '0 configuration summary\n' 00178 msg2 += ' %3s = total number of networks read in\n' %(self.nNetworks) 00179 msg2 += ' %4s = total number of mesh points\n' %(totalPoints) 00180 msg2 += ' %4s = total number of panels\n' %(totalPanels) 00181 00182 return msg+msg2+msg3 00183 00184 def writeDataCheck(self): 00185 msg = '$datacheck\n' 00186 msg += '%s.\n' %(self.dataCheck) 00187 return msg 00188 00189 def writePrintout(self): 00190 msg = '$printout options\n' 00191 msg += "%-10s%-10s%-10s%-10s%-10s%-10s\n" %(self.isings, self.igeomp, self.isingp, self.icontp, self.ibconp, self.iedgep) 00192 msg += "%-10s%-10s%-10s%-10s%-10s\n" %(self.ipraic, self.nexdgn, self.ioutpr, self.ifmcpr, self.icostp) 00193 return msg