Adds storeIteration for initial write data#1036
Conversation
|
This does fix #1032 for me. I do not understand the change, though. |
|
For the quasi-Newton scheme, the The 1D elastic tube test case is sensitive to this initial write data. The function precice/src/cplscheme/CouplingData.cpp Lines 38 to 41 in bd0e158 Adding this during |
|
Good find and thanks for the explanation! This is something I oversaw in #1004. Any idea why some of the tests are failing now? Do you think we should write a specific test to avoid this kind of bug in the future? I'll look into it more closely tomorrow. |
|
I think a test is necessary. I will look into a test, that writes initial data and checks that value against |
Then I will wait until you trigger me again or something pops up here. Right? |
BenjaminRodenberg
left a comment
There was a problem hiding this comment.
I guess we also have to add storeIteration at the right places in MultiCouplingScheme:
precice/src/cplscheme/MultiCouplingScheme.cpp
Lines 67 to 82 in 54707b3
|
Is there a potential bug in the SerialTests? Below is an output from the test: SolverB writes the initial data of 2 precice/src/precice/tests/SerialTests.cpp Lines 418 to 421 in f71e555 and SolverA reads in the initial data precice/src/precice/tests/SerialTests.cpp Lines 398 to 401 in f71e555 However the test still says the the solverB data is zero. SolverA should not be reading the values before SolverB sets them? |
Not sure I understand what you mean, but the test looks correct. Not the test is buggy, preCICE is buggy. |
|
Shouldn't the receiving serial solver skip the call to initializeData? Sender / Second:
Receiver / First:
Actually, initializeData should throw an error if it is called without being required to. |
|
I did another quick test comparing 3ff0899 (pre #1004) and 54707b3 (current state of this PR): I ran the 1d-elastic-tube cpp version precice/tutorials@46ce8ab and compared the |
…to storeWriteInitialData
|
With this version the tests work and also the elastic-tube is ok. However, I would like to add a test that catches the underlying problem. I'm also not yet sure whether actually all additions to the code are necessary. Todos
|
|
This PR is from my perspective ready. I would still suggest to merge #1050 first. |
When I tried this out a while ago: yes. You can locally merge this branch into |
|
Can we merge the tests into this PR, see if all is well and finally merge the fix? |
Main changes of this PR
stores the
previousIterationafter callingwriteInitialData.Motivation and additional information
This PR closes #1034 and #1032
Author's checklist
docs/changelog/if there are noteworthy changes. -> Fixes a bug, but the buggy version was never released, so no need to add anything to the changelog.tools/formatting/check-formatand everything is formatted correctly.Reviewers' checklist