コード例 #1
0
ファイル: mpt.py プロジェクト: EPeterE/von_mises_rms
 def readNLPARM(self, data):
     """
     NLPARM(3003,30,286) - record 27
     """
     #print "reading NLPARM"
     while len(data) >= 76:  # 19*4
         data = data[76:]
         out = unpack('iifiiiiifffiiiffiff', data[:76])
         #(sid,ninc,dt,kMethod,kStep,maxIter,conv,intOut,epsU,epsP,epsW,
         # maxDiv,maxQn,maxLs,fStress,lsTol,maxBisect,maxR,rTolB) = out
         self.add_NLPARM(NLPARM(None, out))
コード例 #2
0
ファイル: mpt.py プロジェクト: 214929177/pyNastran
    def _read_nlparm(self, data: bytes, n: int) -> int:
        """
        NLPARM(3003,30,286) - record 27

        NX 2019.2
        Word Name Type Description
        1 SID       I Set identification number
        2 NINC      I Number of increments
        3 DT       RS Incremental time interval for creep analysis
        4 KMETHOD   I Method for controlling stiffness updates
        5 KSTEP     I Number of iterations before the stiffness update
        6 MAXITER   I Limit on number of iterations for each load increment
        7 CONV      I Flags to select convergence criteria
        8 INTOUT    I Intermediate output flag
        9 EPSU     RS Error tolerance for displacement U criterion
        10 EPSP    RS Error tolerance for displacement P criterion
        11 EPSW    RS Error tolerance for displacement W criterion
        12 MAXDIV   I Limit on probable divergence conditions
        13 MAXQN    I Maximum number of quasi-Newton correction vectors
        14 MAXLS    I Maximum number of line searches
        15 FSTRESS RS Fraction of effective stress
        16 LSTOL   RS Line search tolerance
        17 MAXBIS   I Maximum number of bisections
        18 MAXR    RS Maximum ratio for the adjusted arc-length increment
        19 RTOLB   RS Maximum value of incremental rotation

        ndata = 80:
                  sid nic dt   km ks max con int  epu   epp   epw   mx mx  mx fstr  lso  mx mx    rtolb
        ints    = (1, 10, 0,   1, 5, 25, -1, 0,   0.01, 0.01, 0.01, 3, 25, 4, 0.20, 0.5, 5, 20.0, 20.0, 0)
        floats  = (1, 10, 0.0, 1, 5, 25, -1, 0.0, 0.01, 0.01, 0.01, 3, 25, 4, 0.20, 0.5, 5, 20.0, 20.0, 0.0)
        """
        #print(len(data[12:]))
        #self.show_data(data[12:], types='if')
        ntotal = 76 * self.factor  # 19*4
        s = Struct(mapfmt(self._endian + b'iif5i3f3iffiff', self.size))
        ndatai = len(data) - n
        nentries = ndatai // ntotal
        assert nentries > 0
        #assert ndatai % ntotal == 0
        for unused_i in range(nentries):
            edata = data[n:n + ntotal]
            out = s.unpack(edata)
            #(sid,ninc,dt,kMethod,kStep,maxIter,conv,intOut,epsU,epsP,epsW,
            # maxDiv,maxQn,maxLs,fStress,lsTol,maxBisect,maxR,rTolB) = out
            if self.is_debug_file:
                self.binary_debug.write('  NLPARM=%s\n' % str(out))
            self._add_nlparm_object(NLPARM.add_op2_data(out))
            n += ntotal
        self.card_count['NLPARM'] = nentries
        return n
コード例 #3
0
ファイル: mpt.py プロジェクト: murmlgrmpf/pyNastran
 def _read_nlparm(self, data, n):
     """
     NLPARM(3003,30,286) - record 27
     """
     ntotal = 76  # 19*4
     s = Struct(b(self._endian + 'iif5i3f3iffiff'))
     nentries = (len(data) - n) // ntotal
     for i in range(nentries):
         edata = data[n:n+76]
         out = s.unpack(edata)
         #(sid,ninc,dt,kMethod,kStep,maxIter,conv,intOut,epsU,epsP,epsW,
         # maxDiv,maxQn,maxLs,fStress,lsTol,maxBisect,maxR,rTolB) = out
         self._add_nlparm_object(NLPARM.add_op2_data(out))
         n += ntotal
     self.card_count['NLPARM'] = nentries
     return n
コード例 #4
0
 def _read_nlparm(self, data, n):
     """
     NLPARM(3003,30,286) - record 27
     """
     #print "reading NLPARM"
     ntotal = 76  # 19*4
     s = Struct(b(self._endian + 'iif5i3f3iffiff'))
     nentries = (len(data) - n) // ntotal
     for i in range(nentries):
         edata = data[n:n+76]
         out = s.unpack(edata)
         #(sid,ninc,dt,kMethod,kStep,maxIter,conv,intOut,epsU,epsP,epsW,
         # maxDiv,maxQn,maxLs,fStress,lsTol,maxBisect,maxR,rTolB) = out
         self.add_NLPARM(NLPARM.add_op2_data(out))
         n += ntotal
     self.card_count['NLPARM'] = nentries
     return n
コード例 #5
0
 def _readNLPARM(self, data, n):
     """
     NLPARM(3003,30,286) - record 27
     """
     #print "reading NLPARM"
     ntotal = 76  # 19*4
     s = Struct(b'iif5i3f3iffiff')
     nentries = (len(data) - n) // ntotal
     for i in xrange(nentries):
         edata = data[n:n+76]
         out = s.unpack(edata)
         #(sid,ninc,dt,kMethod,kStep,maxIter,conv,intOut,epsU,epsP,epsW,
         # maxDiv,maxQn,maxLs,fStress,lsTol,maxBisect,maxR,rTolB) = out
         self.add_NLPARM(NLPARM(None, out))
         n += ntotal
     self.card_count['NLPARM'] = nentries
     return n