12.07.2015 Views

DOLFIN User Manual - FEniCS Project

DOLFIN User Manual - FEniCS Project

DOLFIN User Manual - FEniCS Project

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>DOLFIN</strong> <strong>User</strong> <strong>Manual</strong>Hoffman, Jansson, Logg, Wellsclass : public Function{real eval(const Point& p, unsigned int i){return p.x*sin(p.y);}} f;// Boundary conditionclass : public BoundaryCondition{void eval(BoundaryValue& value, const Point& p, unsigned int i){if ( std::abs(p.x - 1.0) < <strong>DOLFIN</strong>_EPS )value = 0.0;}} bc;// Set up problemUnitSquare mesh(16, 16);Poisson::BilinearForm a;Poisson::LinearForm L(f);PDE pde(a, L, mesh, bc);// Compute solutionFunction U = pde.solve();// Save solution to fileFile file("poisson.pvd");file

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

Saved successfully!

Ooh no, something went wrong!