Computing expensive forms efficiently
Hello,
General question. What is the best way (i.e. most efficient) to compute forms involving expensive computations? For example, suppose I am forming the semilinear form for the DG discretization of the compressible Euler equations. This will involve complicated flux functions (I am using the Roe flux function) along interior and exterior facets.
Presently, I am implementing the flux function as a function in python, which takes the finite-element (mixed-space) function on either side of the facet, and yields the flux. However, if I use this flux in the semilinear form, the execution time is extremely slow for the problem size.
I tried using cpp code in an Expression, but expressions do not seem to accept finite-element functions as parameters.
Any insights would be appreciated.
Best regards,
Jason
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Jason Hicken for more information if necessary.