This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Expression from std::vector

0 votes

Is there a way to create an expression from two std::vector-s consist of the values and coordinates respectively and are generated by an externel numerical solver.

asked Mar 24, 2016 by str FEniCS User (1,600 points)

1 Answer

0 votes
 
Best answer

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.

answered Mar 29, 2016 by Garth N. Wells FEniCS Expert (35,930 points)
selected Mar 30, 2016 by str
...