Tips
Tips#
Here, a list of useful tips/remarks that, hopefully, will make your life easier.
The choice of the solver can have huge impact on performance (see How to choose an appropriate solver?).
If a given matrix is required in several steps, it should be assembled only once (e.g. time-dependent problems).
Some functions don’t have the expected behavior within a
jupyter notebook. This applies mainly to functions imported fromdolfin.cppwhich task is to print information (e.g.dolfin.cpp.la.list_linear_algebra_backends). This does not mean you should stop usingjupyter notebook(they’re very useful!), it simply means you have to go for a script to get this kind of information.Code verbosity can change:
set_log_level(log_level). In old documentation, you can findset_log_level(DEBUG)andset_log_level(PROGRESS)as the go-to commands. Nevertheless, they do not work in version2019.1.0, asDEBUGandPROGRESScannot be imported. To access this variables you have to importLogLevel(from dolfin.cpp.log import LogLevel) and then access the desired variables (e.g.LogLevel.DEBUG). Alternatively , you can use an integer, beinglog_level=10andlog_level=16, forDEBUGandPROGRESS, respectively. Other options can be found here). I could tell you what each level prints, but why wouldn’t try it yourself? (not in ajupyter notebook!)