Efficiency of calculating the gradient of reduced functional

Issue #47 resolved
Miguel Salazar created an issue

Hi,

I have compared the timings between the forward run and reduced_functional.derivative() in the test case:

https://bitbucket.org/dolfin-adjoint/dolfin-adjoint/src/42b89686435dc2664fb94def8bb1db1682df389d/tests_dolfin/reduced_functional_evaluation/reduced_functional_evaluation.py?at=master&fileviewer=file-view-default

Calculating the derivative usually takes 3 or 4 times longer than the forward simulation. Is this a theoretical optimum or there is a way to optimize it by playing with some parameters?

Comments (2)

  1. Simon Funke

    The adjoint should take as much time as the forward run. What you observe is probably the overhead of the symbolic derivation of the adjoint equations. This overhead should become negligible once the assembly and solve times are increased.

    Try refining the mesh and see if you get better results.

  2. Log in to comment