Expression

class dolfin.cpp.function.Expression(*args)

Bases: dolfin.cpp.function.GenericFunction

This class represents a user-defined expression. Expressions can be used as coefficients in variational forms or interpolated into finite element spaces. An expression is defined by overloading the eval method. Users may choose to overload either a simple version of eval , in the case of expressions only depending on the coordinate x, or an optional version for expressions depending on x and mesh data like cell indices or facet normals. The geometric dimension (the size of x) and the value rank and dimensions of an expression must supplied as arguments to the constructor.

Copy constructor

Parameters:Expression & expression (const) – (Expression ) Object to be copied.
eval()

Evaluate at given point.

Parameters:
  • double > & values (Array<) – (Array<double>) The values at the point.
  • Array< double > & x (const) – (Array<double>) The coordinates of the point.
Return type:

void

eval_cell()

Note: The reimplementation of eval is needed for the Python interface. Evaluate at given point in given cell.

Parameters:
  • double > & values (Array<) – (Array<double>) The values at the point.
  • Array< double > & x (const) – (Array<double>) The coordinates of the point.
  • ufc::cell & cell (const) – (ufc::cell) The cell which contains the given point.
Return type:

void

thisown

The membership flag