Ejemplo n.º 1
0
    def displayLoadOnNode(self,
                          nod,
                          color,
                          force,
                          moment,
                          fScale,
                          defFScale=0.0):
        '''Display loads on one node

         :param nod: node instance
         :param color: color
         :param force: force (displayed as a single arrow)
         :param moment: moment (displayed as a double arrow)
         :param fScale: scaling factor (forces and moments)
         :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)
         '''
        #actorName= baseName+"%04d".format(nod.tag) # Node tag.
        pos = nod.getCurrentPos3d(defFScale)
        absForce = force.Norm()
        if (absForce > 1e-6):
            utils_vtk.drawVtkSymb('arrow', self.renderer, color, pos, force,
                                  fScale * absForce)
        absMoment = moment.Norm()
        if (absMoment > 1e-6):
            utils_vtk.drawVtkSymb('doubleArrow', self.renderer, color, pos,
                                  moment, fScale * absMoment)
Ejemplo n.º 2
0
    def displaySPconstraints(self, setToDisplay, scale):
        ''' Display single point constraints.

        :param setToDisplay: set to be displayed
        :param scale: scale for SPConstraints symbols.
        '''
        prep = setToDisplay.getPreprocessor
        nodInSet = setToDisplay.nodes.getTags()
        elementAvgSize = setToDisplay.elements.getAverageSize(False)
        #direction vectors for each DOF
        vx, vy, vz = [1, 0, 0], [0, 1, 0], [0, 0, 1]
        DOFdirVct = (vx, vy, vz, vx, vy, vz)
        spIter = prep.getDomain.getConstraints.getSPs
        sp = spIter.next()
        while sp:
            nod = sp.getNode
            if nod.tag in nodInSet:
                dof = sp.getDOFNumber
                if dof < 3:  # This is not true in 2D problems.
                    utils_vtk.drawVtkSymb(symbType='cone',
                                          renderer=self.renderer,
                                          RGBcolor=[0, 0, 1],
                                          vPos=nod.getInitialPos3d,
                                          vDir=DOFdirVct[dof],
                                          scale=scale * elementAvgSize)
                else:
                    utils_vtk.drawVtkSymb(symbType='shaftkey',
                                          renderer=self.renderer,
                                          RGBcolor=[0, 1, 0],
                                          vPos=nod.getInitialPos3d,
                                          vDir=DOFdirVct[dof],
                                          scale=scale * elementAvgSize)
            sp = spIter.next()
        return
Ejemplo n.º 3
0
 def displayElementPunctualLoad(self, preprocessor, pLoad,loadPattern, renderer, color, force, fScale):
     '''Display punctual loads on elements
     '''
     xForce= pLoad.getElems()
     eleTags= pLoad.elementTags
     loadPatternName= loadPattern.getProp("dispName")
     actorName= "flechaP"+loadPatternName+"%04d".format(tag) # Tag force.
     for tag in eleTags:
         ele= preprocessor.getElementHandler.getElement(tag)
         actorName+= "%04d".format(tag) # Tag elemento.
         pos= ele.point(xForce)
         utils_vtk.drawVtkSymb('arrow',self.renderer,color,pos,force,fScale)