예제 #1
0
    def displayDispRot(self,itemToDisp='',setToDisplay=None,fConvUnits=1.0,unitDescription= '',viewName='XYZPos',hCamFct=1.0,fileName=None,defFScale=0.0):
      '''displays the component of the displacement or rotations in the 
      set of entities.

      :param itemToDisp: component of the displacement ('uX', 'uY' or 'uZ') 
                    or the rotation ('rotX', rotY', 'rotZ') to be depicted 
      :param setToDisplay:   set of entities to be represented (defaults to all 
                    entities)
      :param fConvUnits: factor of conversion to be applied to the results 
                    (defaults to 1)
      :param unitDescription: string describing units like '[mm] or [cm]'
      :param fileName: name of the file to plot the graphic. Defaults to 
                    None, in that case an screen display is generated
      :param defFScale: factor to apply to current displacement of nodes 
                so that the display position of each node equals to
                the initial position plus its displacement multiplied
                by this factor. (Defaults to 0.0, i.e. display of 
                initial/undeformed shape)

      '''
      if(setToDisplay):
          self.xcSet= setToDisplay
      else:
          lmsg.warning('QuickGraphics::displayDispRot; set to display not defined; using previously defined set (total if None).')
      vCompDisp= self.getDispComponentFromName(itemToDisp)
      nodSet= self.xcSet.getNodes
      for n in nodSet:
          n.setProp('propToDisp',n.getDisp[vCompDisp])
      field= Fields.ScalarField('propToDisp',"getProp",None,fConvUnits)
      defDisplay= self.getDisplay(vwName=viewName,hCamF= hCamFct)
      defDisplay.displayMesh(xcSet=self.xcSet,field=field,diagrams= None, fName=fileName,caption=self.loadCaseName+' '+itemToDisp+' '+unitDescription+' '+self.xcSet.description,defFScale=defFScale)
예제 #2
0
파일: quick_graphics.py 프로젝트: xyuan/xc
    def displayDispRot(self,
                       itemToDisp='',
                       setToDisplay=None,
                       fConvUnits=1.0,
                       unitDescription='',
                       viewDef=vtk_graphic_base.CameraParameters(
                           'XYZPos', 1.0),
                       fileName=None,
                       defFScale=0.0,
                       rgMinMax=None):
        '''displays the component of the displacement or rotations in the 
        set of entities.

        :param itemToDisp: component of the displacement ('uX', 'uY' or 'uZ') 
                    or the rotation ('rotX', rotY', 'rotZ') to be depicted 
        :param setToDisplay:   set of entities to be represented (defaults to all 
                    entities)
        :param fConvUnits: factor of conversion to be applied to the results 
                    (defaults to 1)
        :param unitDescription: string describing units like '[mm] or [cm]'
        :param fileName: name of the file to plot the graphic. Defaults to 
                    None, in that case an screen display is generated
        :param defFScale: factor to apply to current displacement of nodes 
                so that the display position of each node equals to
                the initial position plus its displacement multiplied
                by this factor. (Defaults to 0.0, i.e. display of 
                initial/undeformed shape)
        :param rgMinMax: range (vmin,vmax) with the maximum and minimum values of 
              the field to be represented. All the values less than vmin are 
              displayed in blue and those greater than vmax in red
              (defaults to None)

        '''
        if (setToDisplay):
            self.xcSet = setToDisplay
        else:
            lmsg.warning(
                'QuickGraphics::displayDispRot; set to display not defined; using previously defined set (total if None).'
            )
        vCompDisp = self.getDispComponentFromName(itemToDisp)
        nodSet = self.xcSet.getNodes
        for n in nodSet:
            n.setProp('propToDisp', n.getDisp[vCompDisp])
        field = Fields.ScalarField(name='propToDisp',
                                   functionName="getProp",
                                   component=None,
                                   fUnitConv=fConvUnits,
                                   rgMinMax=rgMinMax)
        defDisplay = self.getDisplay(viewDef)
        defDisplay.displayMesh(xcSets=self.xcSet,
                               field=field,
                               diagrams=None,
                               fName=fileName,
                               caption=self.loadCaseName + ' ' + itemToDisp +
                               ' ' + unitDescription + ' ' +
                               self.xcSet.description,
                               defFScale=defFScale)