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, Wells# ./configure# make# make installMake sure that you download the latest release (which is not 0.1.0).Note that you may need to be root on your system to perform the laststep. Since <strong>DOLFIN</strong> depends on a number of other packages, including thelinear algebra package PETSc and the form compiler FFC, you may also needdownload and install these packages before you can compile <strong>DOLFIN</strong>. (SeeAppendix B for detailed instructions.)2.2 Solving Poisson’s equation with <strong>DOLFIN</strong>Let’s say that we want to solve Poisson’s equation on the unit square Ω =(0, 1)×(0, 1) with homogeneous Dirichlet boundary conditions on the boundaryΓ 0 = {(x, y) ∈ ∂Ω : x = 1}, homogeneous Neumann boundary conditionson the remaining part of the boundary and right-hand side given byf = x sin(y),− ∆u(x, y) = x sin(y), x ∈ Ω = (0, 1) × (0, 1), (2.1)u(x) = 0, x ∈ Γ 0 = {(x, y) ∈ ∂Ω : x = 1}, (2.2)∂ n u(x) = 0, x ∈ ∂Ω \ Γ 0 . (2.3)To solve a partial differential equation such as Poisson with <strong>DOLFIN</strong>, itmust first be rewritten in variational form. The discrete variational (finiteelement) formulation for Poisson’s equation reads: Find u ∈ V h such thata(v, U) = L(v) ∀v ∈ ˆV h , (2.4)with ( ˆV h , V h ) a pair of suitable function spaces (the test and trial spaces).The bilinear form a : ˆV h × V h → R is given by∫a(v, U) = ∇v · ∇U dx (2.5)Ω16

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

Saved successfully!

Ooh no, something went wrong!