-
Notifications
You must be signed in to change notification settings - Fork 917
Re-enable Discrete Adjoint FSI Test Cases #803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for bringing this back. The testcase was passing on #753 alone, so that should not be the problem, I'll have a look. |
|
@rsanfer You shouldn't get in touch with the new AD routines at all unless you're using |
|
Sure we do (e.g. So actually both ways are based on saving indices somewhere. However the routines that I added (with the
We don't want the
Yes there are counterparts in |
|
@oleburghardt I figured why There is, of course, the possibility to set a specific boolean for these test cases in particular, but I think that would over-complicate the code. Else, it should be possible to extend the index based to the rest of the features required (geometry and structural solvers), which would be my preferred option. |
|
Ok. I don't think these changes are over-complicated. But I'm fine with changing the index saving procedure everywhere. There'd be just some work to do (we would have to adapt everything for the FEA elasticity solvers and all the variables they need as well)... so it's also a question of time, testing and so on. |
|
I think one option would add yet one more config option and make it more difficult for the user, and the other would be to extend new features to all existing capabilities of the code. The idea behind the single and multi-zone drivers was precisely generalization. In my opinion it would be a no brainer to go for the second, but I'll leave it up to the community, but it depends also a lot on what timing we are moving in. |
|
Is it possible for the fluid side to work index-based and the structural side as before? I solved the segfault by adding a GetAdjointCoord_intIndexBased() method to CPoint. |
(Please rather say internal-based, or variable-based - both approaches are index-based, they differ in the way they are stored :-)) In principle, yes. One can have both at the same time. I'd have to think about it, sounds a bit messy to me right now to get it all consistent. One could also change
Yes. |
|
@rsanfer , @oleburghardt , I think I fixed it, I'll do further validation tomorrow, but the reference derivative is very close to the regression value. The "int" in "intIndexBased" is for internal then? Because its type is also int, easy mistake to make xD. |
Yes.. The name was the first one I gave that routine. It somehow made it through.. Now that I had to type it several times I'd love to have it changed. But anyway.. I'm a bit puzzled that it seems to be so easy but maybe it's just as simple as you said - new approach inside |
pcarruscag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results are OK, I also checked I could replicate old results for a larger case.
I updated the reference results for my testcase, @rsanfer I suggest you have a look at the other one.
The only thing we needed was an internal index version of CPoint::GetAdjointCoord, nothing to do with #753.
Next time I see a PR with testcases commented out I think I'll close it xD
|
Thanks a lot for your support, @pcarruscag. I run the other test cases this morning and I noticed there is a very small difference in the sensitivities around the 10th significant figure (in the order of the updates you made on the discrete adjoint airfoil case). Given that the order of magnitude of this difference remains consistent even when extending the simulation, I updated the test values. I leave here the reference to the previous state for our records. If there are no comments against it in the next day or so, I will be merging in this PR next, as it just puts back some functionality that was removed. |
|
Does anyone know why we get this random failures from travis?
It does not seem to be related with a particular test case... |
Unfortunately that happens a lot lately. Haven't figured out what the reason is. I assume its something with MPI on the virtual machines in Travis. Hard to debug though, I can test a different MPI version maybe... |
Just finished it. Everything's ok. |
Proposed Changes
This PR is intended to put some functionality back that was involuntarily removed in #724.
Test cases for discrete adjoint FSI are now re-enabled with split files. They correctly pass the travis tests when the branch is based in feature_input_output, which was the original branch merged in #724.
Unfortunately, given that during this time both #753 and #774 were merged, the tests are failing now. Particularly, the disc_adj_fsi case runs into a segfault in
CDiscAdjSolver::ExtractAdjoint_CrossTerm_Geometry, when trying to executegeometry->node[iPoint]->GetAdjointCoord(Solution_Geometry);.I believe this is related to the changes to the index based recording introduced in #774, as the code was running before into the same problem in
CDiscAdjSolver::ExtractAdjoint_CrossTerm, and now goes beyond this point having changed the Get routine intodirect_solver->GetNodes()->GetAdjointSolution_intIndexBased(iPoint,Solution);.Currently, there is no
GetAdjointCoord_intIndexBasedor similar available, and its implementation requires some constructs for the indices. Therefore, I would like to ask for support from @oleburghardt and @pcarruscag to make this work with their changes.Related Work
#724 involuntarily removed the discrete adjoint FSI cases from the regression tests.
Branch fix_discadjfsi successfully recovers the functionality removed.
#774 introduced relevant changes to the adjoint solver that are making.
#753 was merged and, although I tried to adapt to it, I can't guarantee it's working correctly.
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.