Open JaredCrean2 opened 7 years ago
The airfoil problem is too expensive to be the only test for adjoint correctness (the test d/dx = \partial / \partial x + psi^T \partial R / \partial x). If we don't have a test like this running as part of the CI tests, I don't think the adjoint will work reliably. It is also a pain for debugging because it takes upwards of 5 minutes to run every time.
@k1nshuk @jehicken is there a less expensive way to test this functionality?
What about defining some functional, then comparing the total derivatives of the functiona w.r.t. a couple of variables, using forward mode (FD, or complex, whatever) and adjoint equation? In this case, the test case can basically be anything and unnecessary to be an airfoil.
Unfortunately the isentropic vortex is not a good test case for steady adjoints and the only other test case at the time was the airfoil. It is possible to reduce the test time by
If the airfoil test is being used by some other test, save the final eqn.q_vec
to file and use it to compute adjoint and compare against FD. That saves at least 1 airfoil solve. Similarly the FD values can be stored to file and used (thus requiring only the adjoint solve throughout the test). I'm not a fan of it in the long term because if a user/developer accidentally deletes the data/or the mesh changes, file the test won't work. Additionally, the FD test has an instructional value of teaching future students how to test adjoints using TICON, as trivial as it may be, so i want to keep it there.
Cook up data/states that produces ψ[i] = 1 for calcAdjoint
. I did not look into it because testing speed for adjoints was not a concern at the time.
I'm not sure if there are any new steady test cases or cheaper 2D airfoil meshes since I stopped woking on TICON. That can be investigated.
I'm not convinced that we cannot use the steady vortex here. Let's talk about it at the status meeting.
All adjoint/boundary functional tests are currently in one function here. Some of the tests are very fast, but a few of them require solving very expensive problem (airfoil?). The fast ones should be separated out so they can be run more often.