Subject: [Viper-dev] Displacement plot problem?

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Fri, 28 Mar 2008 17:07:13 +0100

This code plots vectors, not displacement, why?
(Passing a bad string as mode doesn't give any errors by the way.)

from dolfin import *

# Define a vector function
class DisplacementFunction(Function):
    def __init__(self, mesh):
        self.t = 0.0
        Function.__init__(self, mesh)

    def eval(self, values, x):
        dx = x[0] - self.t
        dy = x[1] - self.t
        values[0] = dy*0.5
        values[1] = dx*0.5

    def rank(self):
        return 1

    def dim(self, i):
        return 2

# Plot vector function
mesh = UnitSquare(16, 16)
h = DisplacementFunction(mesh)
for i in range(200):
    h.t += 0.005
    plot(h, mode="displacement")

--
Martin

---

From: Ola Skavhaug <[email-masked]>
Date: Fri, 28 Mar 2008 20:02:08 +0100

> (Passing a bad string as mode doesn't give any errors by the way.)
 
The problem is already reported. The fix is trivial (but not done).

Ola
 
> _______________________________________________
> Viper-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/viper-dev

---

From: Anders Logg <[email-masked]>
Date: Fri, 28 Mar 2008 20:10:59 +0100

> The problem is already reported. The fix is trivial (but not done).

Do it. Do it! (http://www.youtube.com/watch?v=0wP9D6tYRAU)

-- 
Anders

---

From: Ola Skavhaug <[email-masked]>
Date: Fri, 28 Mar 2008 20:37:24 +0100

> Do it. Do it! (http://www.youtube.com/watch?v=0wP9D6tYRAU)

Fixed :)  

Ola