Skip to content
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

Remove last else-cases in FF and CHT #197

Merged
merged 11 commits into from
Dec 3, 2021

Conversation

maxfirmbach
Copy link
Contributor

Loading several modules e.g. FF and FSI results in an error message (see issue #196).
The last else-case in the FF- and CHT-modules for writing and reading participants is deleted,
which should provide a first fix. Now the branching should be consistent in all three available modules (FSI, FF, CHT).

Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for the contribution, @maxfirmbach!

I went ahead and added a similar error message that checks across modules. Scenarios:

  • The user does not specify any read or any write data --> Nothing is happening, preCICE works, no data exchange, no warning. (do we want to change this?)
  • The user mistypes a data type --> Error message.
  • The user forgot to enable a module --> Error message.
  • The user has extended the adapter and now has two modules defining the same read/write data set --> Error message (to not rely on picking the last occuring one).

To implement this error, I had to change the return type of the addWriters and addReaders methods from void to bool and count in how many modules a dataset is found.

@davidscn please cross-check my changes, at least by looking at the diff.

Copy link
Member

@davidscn davidscn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user does not specify any read or any write data --> Nothing is happening, preCICE works, no data exchange, no warning. (do we want to change this?)

From what I understand you raise an error in case no reader or no writer was specified. This disables unidirectional coupling. We should only raise an error message in case the reader and writer are in total zero?!

The user mistypes a data type --> Error message.

✔️

The user forgot to enable a module --> Error message.

✔️

The user has extended the adapter and now has two modules defining the same read/write data set --> Error message (to not rely on picking the last occuring one).

✔️

Adapter.C Outdated Show resolved Hide resolved
Adapter.C Outdated Show resolved Hide resolved
Adapter.C Outdated Show resolved Hide resolved
Adapter.C Outdated Show resolved Hide resolved
Adapter.C Outdated Show resolved Hide resolved
Adapter.C Outdated Show resolved Hide resolved
CHT/CHT.C Outdated Show resolved Hide resolved
CHT/CHT.C Outdated Show resolved Hide resolved
MakisH and others added 5 commits November 18, 2021 18:25
Co-authored-by: David Schneider <[email protected]>
Co-authored-by: David Schneider <[email protected]>
Co-authored-by: David Schneider <[email protected]>
Co-authored-by: David Schneider <[email protected]>
Adapter.C Show resolved Hide resolved
@MakisH
Copy link
Member

MakisH commented Nov 18, 2021

@davidscn thanks again for your suggestions, I am ready for another review.

As a summary, I took the original suggestion (mostly a work-around) and changed every module to handle possible related errors.

@davidscn davidscn linked an issue Nov 19, 2021 that may be closed by this pull request
@MakisH MakisH merged commit 49b6267 into precice:develop Dec 3, 2021
@MakisH MakisH added this to the v1.1.0 milestone Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using multiple modules: false errors from CHT and FF
3 participants