Ejemplo n.º 1
0
    def plot(self, filename=None):
        import gist

        gist.window(self.id, wait=1)
        gist.pltitle(self.title)
        gist.animate(1)

        var = self.vars[0]

        if isinstance(var, FaceVariable):
            x, y = var.mesh.faceCenters
        elif isinstance(var, CellVariable):
            x, y = var.mesh.cellCenters

        gist.plmesh(numerix.array([y, y]), numerix.array([x, y]))

        vx = numerix.array(var[0])
        vy = numerix.array(var[1])

        maxVec = var.mag.max().value
        maxGrid = var.mesh._cellDistances.max()

        gist.plv(numerix.array([vy, vy]),
                 numerix.array([vx, vx]),
                 scale=maxGrid / maxVec * 3,
                 hollow=1,
                 aspect=0.25)  #,scale=0.002)

        if filename is not None:

            gist.hcp_file(filename)
            gist.hcp()

        gist.fma()
Ejemplo n.º 2
0
    def plot(self, filename=None):
        import gist

        gist.window(self.id, wait = 1)
        gist.pltitle(self.title)
        gist.animate(1)
        
        var = self.vars[0]
        
        if isinstance(var, FaceVariable):
            x, y = var.getMesh().getFaceCenters()
        elif isinstance(var, CellVariable):
            x, y = var.getMesh().getCellCenters()
        
        gist.plmesh(numerix.array([y, y]), numerix.array([x, y]))

        vx = numerix.array(var[0])
        vy = numerix.array(var[1])
        
        maxVec = var.getMag().max().getValue()
        maxGrid = var.getMesh()._getCellDistances().max()
        
        gist.plv(numerix.array([vy,vy]), numerix.array([vx,vx]), scale=maxGrid / maxVec * 3, hollow=1, aspect=0.25) #,scale=0.002)
        
        if filename is not None:
            
            gist.hcp_file(filename)
            gist.hcp()

        gist.fma()
Ejemplo n.º 3
0
    def plotMesh(self, filename = None):
        self._plot()
        
        faceVertexIDs = self.mesh.faceVertexIDs
        vertexCoords = self.mesh.vertexCoords
        
        x0 = numerix.take(vertexCoords[0], faceVertexIDs[0])
        y0 = numerix.take(vertexCoords[1], faceVertexIDs[0])
        x1 = numerix.take(vertexCoords[0], faceVertexIDs[1])
        y1 = numerix.take(vertexCoords[1], faceVertexIDs[1])
        
        import gist
        
        gist.pldj(x0, y0, x1, y1)

        if filename is not None:
            import os.path
            root, ext = os.path.splitext(filename)
            if ext.lower() in (".eps", ".epsi"):
                gist.eps(root)
            else:
                gist.hcp_file(filename, dump = 1)
                gist.hcp()
                gist.hcp_finish(-1)

        gist.fma()
Ejemplo n.º 4
0
    def plotMesh(self, filename=None):
        self._plot()

        faceVertexIDs = self.mesh.faceVertexIDs
        vertexCoords = self.mesh.vertexCoords

        x0 = numerix.take(vertexCoords[0], faceVertexIDs[0])
        y0 = numerix.take(vertexCoords[1], faceVertexIDs[0])
        x1 = numerix.take(vertexCoords[0], faceVertexIDs[1])
        y1 = numerix.take(vertexCoords[1], faceVertexIDs[1])

        import gist

        gist.pldj(x0, y0, x1, y1)

        if filename is not None:
            import os.path
            root, ext = os.path.splitext(filename)
            if ext.lower() in (".eps", ".epsi"):
                gist.eps(root)
            else:
                gist.hcp_file(filename, dump=1)
                gist.hcp()
                gist.hcp_finish(-1)

        gist.fma()
Ejemplo n.º 5
0
 def plot(self, filename=None):
     import gist
 
     if filename is not None:
         import os.path
         root, ext = os.path.splitext(filename)
         if ext.lower() in (".eps", ".epsi"):
             gist.eps(root)
         else:
             gist.hcp_file(filename, dump = 1)
             gist.hcp()
             gist.hcp_finish(-1)
     gist.fma()
Ejemplo n.º 6
0
    def plot(self, filename=None):
        import gist

        if filename is not None:
            import os.path
            root, ext = os.path.splitext(filename)
            if ext.lower() in (".eps", ".epsi"):
                gist.eps(root)
            else:
                gist.hcp_file(filename, dump=1)
                gist.hcp()
                gist.hcp_finish(-1)
        gist.fma()