Re: [firedrake] Regarding using UFL in meshfree code
Dear Sarosh, Apologies for the slow response. Find some answers inline. On 12/02/14 10:44, quraishi@math.tu-berlin.de wrote:
Dear Florian I saw your PyOP2 library and so I got motivated to interface my meshfree code with high level interfaces like UFL.
Glad to hear PyOP2 motivated you to look at UFL and high-level interfaces! I should add that PyOP2 is not "my" library but the effort of our entire research group.
Currently my code is in Matlab, and everything is hardcoded. I wish that by using UFL I could also generate variational forms using highlevel code.
By "everything" I'm assuming you mean the finite-element basis functions, derivatives etc.? You're absolutely right that UFL allows you to generate implementations of variational forms via a form compiler such as the FEniCS form compiler FFC.
Please suggest me how could I use UFL in this context? Is it possible to generate python code (in addition to C++ code) by using UFL as well?
FFC by default generates code conforming to the UFC interface specification. I'm not very familiar with MATLAB and even less with its interfacing capabilities to 3rd party code, but in theory you might be able to compile FFC generated forms into a library and call them from MATLAB. Depending on how invested you are into your MATLAB code base you might find it easier to port it over to Python and use FFC's ability to generate and compile code just-in-time. I'm not sure what exactly you mean by "generate python code": the implementation of the variational form? FFC currently only has a C++ backend and I don't think you would want tight loops and heavy arithmetic in Python for performance reasons. However since UFL is an embedded DSL in Python you can do pretty much whatever you want with the UFL form. UFL comes with a number of transformation algorithms. I'm copying in our mailing list, so maybe others have things to add. Best, Florian
Thanks Best Regards Sarosh Quraishi
participants (1)
- 
                
                Florian Rathgeber