Achim! Just change Function -> Expression and you are good to go!
Johan On Thursday March 25 2010 05:21:34 Achim Schroll wrote: > 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) _______________________________________________ Mailing list: https://launchpad.net/~dolfin Post to : [email protected] Unsubscribe : https://launchpad.net/~dolfin More help : https://help.launchpad.net/ListHelp

