← Back to team overview

dolfin team mailing list archive

Expression subclass

 

I'd like to create a sub-class of Expression,

  class my_expression(Expression):
      def __init__(self, V, x):
          self.x =x
          Expression.__init__(V = V)

but I'm having trouble with the constructor - I get the below error. Any tips?

Garth


line 120, in __init__
raise TypeError, "Expression need to be initialized using either a 'cpp.FunctionSpace', using kwarg 'V', or an 'ufl.FiniteElement' using kwarg 'element'." TypeError: Expression need to be initialized using either a 'cpp.FunctionSpace', using kwarg 'V', or an 'ufl.FiniteElement' using kwarg 'element'.


Follow ups