New question #105494 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/105494

why does my random function return just zero?

from dolfin import *
from random import *

# random funtion
class myrand(Function):
    def __init__(self, V):
        Function.__init__(self, V)
    def eval(self, values, x):
        values[0] = gauss(0,1)

# Create mesh and finite element
mesh = UnitSquare(20, 20)
V = FunctionSpace(mesh, "CG", 1)

randf = myrand(V)


-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.

_______________________________________________
Mailing list: https://launchpad.net/~dolfin
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp

Reply via email to