Exemple #1
0
  def displayLocalAxes(self,setToDisplay=None,vectorScale=1.0,viewDef= vtk_graphic_base.CameraParameters('XYZPos'), caption= '',fileName=None,defFScale=0.0):
    '''vector field display of the loads applied to the chosen set of elements in the load case passed as parameter
    
    :param setToDisplay:   set of elements to be displayed (defaults to total set)
    :param vectorScale:    factor to apply to the vectors length in the representation
    :param viewDef:       parameters that define the view to use
           predefined view names: 'XYZPos','XNeg','XPos','YNeg','YPos',
           'ZNeg','ZPos'
    :param fileName:       full name of the graphic file to generate. Defaults to `None`, in this case it returns a console output graphic.
    :param caption:        text to display in the graphic 
    :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 == None):
      setToDisplay=self.getPreprocessor().getSets.getSet('total')
      setToDisplay.fillDownwards()
      lmsg.warning('set to display not defined; using total set.')

    defDisplay= vtk_FE_graphic.RecordDefDisplayEF()
    defDisplay.setupGrid(setToDisplay)
    if setToDisplay.color.Norm()==0:
      setToDisplay.color=xc.Vector([rd.random(),rd.random(),rd.random()])
    vField=lavf.LocalAxesVectorField(setToDisplay.name+'_localAxes',vectorScale)
    vField.dumpVectors(setToDisplay)
    defDisplay.cameraParameters= viewDef
    defDisplay.defineMeshScene(None,defFScale,color=setToDisplay.color) 
    vField.addToDisplay(defDisplay)
    defDisplay.displayScene(caption,fileName)
    return defDisplay
Exemple #2
0
def displayLocalAxes(setToDisplay=None,
                     vectorScale=1.0,
                     viewNm="XYZPos",
                     hCamFct=1.0,
                     caption='',
                     fileName=None):
    '''vector field display of the loads applied to the chosen set of elements in the load case passed as parameter
    
    :param setToDisplay:   set of elements to be displayed (defaults to total set)
    :param vectorScale:    factor to apply to the vectors length in the representation
    :param viewNm:         name of the view  that contains the renderer (possible options: "XYZPos", "XPos", "XNeg","YPos", "YNeg", "ZPos", "ZNeg")
    :param hCamFct:     factor that applies to the height of the camera position in order to
                        change perspective of isometric views (defaults to 1). Usual values 0.1 to 10
    :param fileName:       full name of the graphic file to generate. Defaults to `None`, in this case it returns a console output graphic.
    :param caption:        text to display in the graphic 
    '''
    defDisplay = vtk_FE_graphic.RecordDefDisplayEF()
    defDisplay.setupGrid(setToDisplay)
    vField = lavf.LocalAxesVectorField(setToDisplay.name + '_localAxes',
                                       vectorScale)
    vField.dumpVectors(setToDisplay)
    defDisplay.viewName = viewNm
    defDisplay.hCamFct = hCamFct
    defDisplay.defineMeshScene(None)
    vField.addToDisplay(defDisplay)
    defDisplay.displayScene(caption, fileName)
    return defDisplay
Exemple #3
0
def displayLocalAxes(prep,setToDisplay=None,vectorScale=1.0,viewNm="XYZPos",hCamFct=1.0,caption= '',fileName=None,defFScale=0.0):
    '''vector field display of the loads applied to the chosen set of elements in the load case passed as parameter
    
    :param setToDisplay: set of elements to be displayed (defaults to total set)
    :param vectorScale: factor to apply to the vectors length in the 
           representation.
    :param viewNm: name of the view  that contains the renderer 
           (possible options: 
            "XYZPos", "XPos", "XNeg","YPos", "YNeg", "ZPos", "ZNeg")
    :param hCamFct: factor that applies to the height of the camera position 
           in order to change perspective of isometric views (defaults to 1). 
           Usual values 0.1 to 10
    :param fileName: full name of the graphic file to generate. 
           Defaults to `None`, in this case it returns a console output graphic.
    :param caption: text to display in the graphic 
    :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 == None):
        setToDisplay=preprocessor.getSets.getSet('total')
        setToDisplay.fillDownwards()
        lmsg.warning('set to display not defined; using total set.')
    vField=lavf.LocalAxesVectorField(setToDisplay.name+'_localAxes',vectorScale)
    vField.dumpVectors(setToDisplay)
    return displayAxes(vField, prep,setToDisplay,vectorScale,viewNm,hCamFct,caption,fileName,defFScale)
Exemple #4
0
def display_local_axes(prep,
                       setToDisplay=None,
                       vectorScale=1.0,
                       viewDef=vtk_graphic_base.CameraParameters(
                           "XYZPos", 1.0),
                       caption='',
                       fileName=None,
                       defFScale=0.0):
    '''vector field display of the loads applied to the chosen set of elements in the load case passed as parameter
    
    :param setToDisplay: set of elements to be displayed (defaults to total set)
    :param vectorScale: factor to apply to the vectors length in the 
           representation.
    :param viewDef: camera parameters.
    :param fileName: full name of the graphic file to generate. 
           Defaults to `None`, in this case it returns a console output graphic.
    :param caption: text to display in the graphic 
    :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 == None):
        setToDisplay = preprocessor.getSets.getSet('total')
        setToDisplay.fillDownwards()
        lmsg.warning('set to display not defined; using total set.')
    vField = lavf.LocalAxesVectorField(setToDisplay.name + '_localAxes',
                                       vectorScale)
    vField.dumpVectors(setToDisplay)
    return display_axes(vField, prep, setToDisplay, vectorScale, viewDef,
                        caption, fileName, defFScale)
Exemple #5
0
    def displayLocalAxes(self, xcSet, caption='local axis', vectorScale=1.0):
        '''vector field display of the loads applied to the chosen set of elements in the load case passed as parameter

        :param xcSet:   set of elements to be displayed (defaults to total set)
        :param caption:        text to display in the graphic 
        :param vectorScale:    factor to apply to the vectors length in the representation
        '''
        self.setupGrid(xcSet)
        vField = lavf.LocalAxesVectorField(xcSet.name + '_localAxes',
                                           vectorScale)
        vField.dumpVectors(xcSet)
        self.defineMeshScene(None)
        vField.addToDisplay(self)
        self.displayScene(caption)