You can implement your own sub-class of dolfin::Expression
, and initialise it with your own data (e.g., your two standard vectors). Your subclass of dolfin::Expression
should implement the appropriate dolfin::Expression::eval
function, which can use data from vectors that you initialise the class with.