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, WellsNext, we initialize the pair of bilinear and linear forms that we have previouslycompiled with FFC:Poisson::BilinearForm a;Poisson::LinearForm L(f);We may now define a PDE from the pair of forms, the mesh and the boundaryconditions:PDE pde(a, L, mesh, bc);To solve the PDE, we now just need to call the solve function as follows:Function U = pde.solve();Finally, we export the solution u to a file for visualization. Here, we chooseto save the solution in VTK format for visualization in ParaView or MayaVi,which we do by specifying a file name with extension .pvd:File file(‘‘poisson.pvd’’);file

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

Saved successfully!

Ooh no, something went wrong!