12.07.2015 Views

DOLFIN User Manual - FEniCS Project

DOLFIN User Manual - FEniCS Project

DOLFIN User Manual - FEniCS Project

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>DOLFIN</strong> <strong>User</strong> <strong>Manual</strong>Hoffman, Jansson, Logg, Wellsclass Source : public Function{real eval(const Point& p, unsigned int i){return x*y*sin(z / <strong>DOLFIN</strong>_PI);}};Source f;To create a vector-valued Function, the vector dimension must be suppliedto the constructor of Function:class Source : public Function{public:Source() : Function(3) {}real eval(const Point& p, unsigned int i){if ( i == 0 )return 0.0;else if ( i == 1 )return x*y*sin(z / <strong>DOLFIN</strong>_PI);elsereturn x + y;}};Source f;40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!