ability to add c++ forms

Issue #1045 resolved
Chaffra Affouda created an issue

The ability to add forms in ufl allows dynamically generated user-defined forms to be compiled at run time. Can the same magic be implemented in c++? I propose implementing the ability to add compiled c++ dolfin forms to each other. I don't know if that even makes sense but that would be useful for dynamically generating new forms from c++.

Comments (6)

  1. Chaffra Affouda reporter

    @michalhabera, this came about because I designed a small c++ app using the c++ side of dolfin directly. Now that my application is working, I'd like to add more interactivity for the user, which requires just-in-time compiling of the forms.

    So, for my own clarification and in your expert opinion, anything that requires just-in-time compiling should (can only) be handled in python not c++, correct? Just writing this I think I am answering my own question but I want to make sure I am not overlooking anything in the way fenics is designed.

  2. Michal Habera

    Sure, that is a very basic design of FEniCS in C++. Even if you manage to call python from c++, you need to dynamically compile generated code and dynamically work with that. Even if that would be possible by some terrible hack, you'll break so many designs... Try to design your form to be so general, that no dynamic changes are required. Or precompile all possible variants...

  3. Log in to comment