I'm trying to squeeze some performance out of my integration, and some low hanging fruit appears to be some vector operations (based on profiling).
For derived vectors is there a way to iterate upon DOFs to peform the calculation? Currently I have been defining an Expression and interpolating that onto the Function, but this leads to a significant amount of time in evaluating basis functions.
For example, if I were to find internal energy, e, from Cv*T, I would hope to do
e.vector() = Cv.vector()*T.vector()
however, Cv is not a constant scalar so I have been using an expression. If it were all local I would just do a loop on the vector size, but I would like to keep the parallelism. Perhaps something like the CellIterator?
for (CellIterator c(mesh); !c.end(); ++c){
}
I suspect creating a Functional form would help, however, some of the vectors depend on external libraries that wouldn't fit into a UFL form.
Overall, I am looking to prevent e=CvT from consuming 10% of the CPU time (due to evaluating Cv and T on their basis functions).
Thanks!