← Back to team overview

dolfin team mailing list archive

[Question #105494]: random function

 

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.



Follow ups