Is the C++ interface supposed to be used?

I am about to implement parallel-in-time methods for large-scale systems. In order to make deployment to computation clusters easier, I was wondering if the C++ interface is supposed to be used as a possible replacement of the Python interface?

1 Like

There are fundamental differences between the C++ and Python interface.

The Python interface has some nice convenience wrappers and is at times less explicit than the C++ interface. Note that there are no functions doing heavy lifting in the Python interface, they are all calling the C++ functions.

The C++ interface is more verbose (as C++ usually is), meaning that you need to get more familiarized with the internals of DOLFINx.

2 Likes

Ok, thank you. I tried to compile some sampel C++ code in the docker container, however, the CMAKE package dolfinx didn’t seem to be installed. Is there any docker image that supports easy compilation of C++ dolfinx sampels?

The docker containers (dolfinx/dolfinx) should work with C++ out of the box. Could you check if you can compile any of the demos (the poisson demo for instance), and report back any error messages.

Thanks very much! I looked into it again and it compiles now. I was missing something in my CMakeLists.txt file. It is working now.

The C++ interface is very much designed to be used. It’s often the right place to work if you’re building libraries on top of DOLFINx, and it’s often the right interface for HPC to avoid issues that can plague Python for HPC.

The C++ interface is designed for intermediate-to-advanced users. To keep it tight we favour powerful lower level interfaces that give a lot of control over high-level convenience functions.

1 Like