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, Wellsdolfin assert(check);This macro accepts a boolean expression and if the expression evaluates tofalse, an error message is displayed, including the file, function name andline number of the assertion, and a segmentation fault is raised (to enableeasy attachment to a debugger). The following examples illustrate the useof dolfin assert():dolfin_assert(i >= 0);dolfin_assert(i < n);dolfin_assert(cell.type() == Cell::triangle);dolfin_assert(cell.type() == Cell::tetrahedron);Note that assertions are only active when compiling <strong>DOLFIN</strong> and yourprogram with DEBUG defined (configure option --enable-debug or compilerflag -DDEBUG). Otherwise, the macro dolfin assert() expands to nothing,meaning that liberal use of assertions does not affect performance, since assertionsare only present during development and debugging.10.4 Task notificationThe two functions dolfin begin() and dolfin end() available in the dolfinname space can be used to notify the <strong>DOLFIN</strong> log system about the beginningand end of a task:void dolfin_begin();void dolfin_end();Alternatively, a string message (or a formatting string with optional arguments)can be supplied:68

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

Saved successfully!

Ooh no, something went wrong!