← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Work on PyDOLFIN demos. More work is needed before PyDOLFIN support all demos.

 

Kristian Oelgaard wrote:
Current status of PyDOLFIN demos:

#Not working:

pde/elasticity
pde/stokes/stabilized
pde/stokes/taylor-hood


For these the issue was how to do vector-valued user functions with pydolfin, right? That is definitely possible, you just have to add information on the rank and length of the vector.

For instance, for the Clamp function in the elasticity demo, try:

class Clamp(Function):
   def __init__(self, element, mesh):
       Function.__init__(self, element, mesh)

   def eval(self, values, x):
       values[0] = 0.0
       values[1] = 0.0
       values[2] = 0.0

   def rank(self):
       return 1 # Tensor of rank 1, i.e vector

   def dim(self, i):
       return 3 # Vector of length 3

--
Marie E. Rognes
Ph.D Fellow, Centre of Mathematics for Applications, University of Oslo
http://folk.uio.no/meg



References