19.06.2015 Views

A FEniCS Tutorial - FEniCS Project

A FEniCS Tutorial - FEniCS Project

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

Once the Ubuntu window is up and running, <strong>FEniCS</strong> is painlessly installed<br />

by<br />

sudo apt-get install fenics<br />

Terminal<br />

Sometimesthe<strong>FEniCS</strong>softwareinastandardUbuntuinstallationlackssomerecentfeaturesandbugfixes.<br />

Visitingthedetaileddownloadpageonfenicsproject.org<br />

and copying afew Unix commands is all you have to doto install a newer version<br />

of the software.<br />

7.7 Troubleshooting: Compilation Problems<br />

Expressions and variational forms in a <strong>FEniCS</strong> program need to be compiled to<br />

C++ and linked with libraries if the expressions or forms have been modified<br />

since last time they were compiled. The tool Instant, which is part of the<br />

<strong>FEniCS</strong> software suite, is used for compiling and linking C++ code so that it<br />

can be used with Python.<br />

Sometimes the compilation fails. You can see from the series of error messageswhichstatementinthePythonprogramthatledtoacompilationproblem.<br />

Make sure to scroll back and identify whether the problematic line is associated<br />

with an expression, variational form, or the solve step.<br />

The final line in the output of error messages points to a log file from the<br />

compilation where one can examine the error messages from the compiler. It<br />

is usually the last lines of this log file that are of interest. Occasionally, the<br />

compiler’smessagecanquicklyleadtoanunderstandingoftheproblem. Amore<br />

fruitful approach is normally to examine the below list of common compilation<br />

problems and their remedies.<br />

Problems with the Instant Cache. Instant remembers information about<br />

previous compilations and versions of your program. Sometimes removal of this<br />

information can solve the problem. Just run<br />

instant-clean<br />

Terminal<br />

in a terminal window.<br />

Syntax Errors in Expressions. If the compilation problem arises from line<br />

with an Expression object, examine the syntax of the expression carefully.<br />

Section 7.3 contains some information on valid syntax. You may also want to<br />

examine the log file, pointed to in the last line in the output of error messages.<br />

The compiler’s message about the syntax problem may lead you to a solution.<br />

Some common problems are<br />

1. using a**b for exponentiation (illegal in C++) instead of pow(a, b),<br />

88

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

Saved successfully!

Ooh no, something went wrong!