19.06.2015 Views

A FEniCS Tutorial - FEniCS Project

A FEniCS Tutorial - FEniCS Project

A FEniCS Tutorial - 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.

}<br />

"smoother: type" : "ML symmetric Gauss-Seidel",<br />

"aggregation: type" : "Uncoupled",<br />

"ML validate parameter list" : False<br />

# Create the preconditioner<br />

prec = ML.MultiLevelPreconditioner(A_epetra, False)<br />

prec.SetParameterList(ML_param)<br />

prec.ComputePreconditioner()<br />

# Create solver and solve system<br />

solver = AztecOO.AztecOO(A_epetra, U_epetra, b_epetra)<br />

solver.SetPrecOperator(prec)<br />

solver.SetAztecOption(AztecOO.AZ_solver, AztecOO.AZ_cg)<br />

solver.SetAztecOption(AztecOO.AZ_output, 16)<br />

solver.Iterate(MaxIters=1550, Tolerance=1e-5)<br />

plot(u)<br />

7.6 Installing <strong>FEniCS</strong><br />

The <strong>FEniCS</strong> software components are available for Linux, Windows and Mac<br />

OS X platforms. Detailed information on how to get <strong>FEniCS</strong> running on such<br />

machines are available at the fenicsproject.org website. Here are just some<br />

quick descriptions and recommendations by the author.<br />

To make the installation of <strong>FEniCS</strong> as painless and reliable as possible, the<br />

reader is strongly recommended to use Ubuntu Linux. (Even though Mac users<br />

now can get <strong>FEniCS</strong> by a one-click install, I recommend using Ubuntu on Mac,<br />

unless you have high Unix competence and much experience with compiling<br />

and linking C++ libraries on Mac OS X.) Any standard PC can easily be<br />

equipped with Ubuntu Linux, which may live side by side with either Windows<br />

or Mac OS X or another Linux installation. Basically, you download Ubuntu<br />

from www.ubuntu.com/getubuntu/download, burn the file on a CD or copy<br />

it to a memory stick, reboot the machine with the CD or memory stick, and<br />

answer some usually straightforward questions (if necessary). On Windows,<br />

Wubi is a tool that automatically installs Ubuntu on the machine. Just give a<br />

user name and password for the Ubuntu installation, and Wubi performs the<br />

rest. The graphical user interface (GUI) of Ubuntu is quite similar to both<br />

Windows 7 and Mac OS X, but to be efficient when doing science with <strong>FEniCS</strong><br />

this author recommends to run programs in a terminal window and write them<br />

in a text editor like Emacs or Vim. You can employ an integrated development<br />

environment such as Eclipse, but intensive <strong>FEniCS</strong> developers and users tend<br />

to find terminal windows and plain text editors more user friendly.<br />

Instead of making it possible to boot your machine with the Linux Ubuntu<br />

operating system, you can run Ubuntu in a separate window in your existing operation<br />

system. There are several solutions to chose among: the free VirtualBox<br />

and VMWare Player, or the commercial tools VMWare Fusion and Parallels<br />

(just search for the names to download the programs).<br />

87

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

Saved successfully!

Ooh no, something went wrong!