Simplify implementation of data mapping in SolverInterfaceImpl#1216
Simplify implementation of data mapping in SolverInterfaceImpl#1216BenjaminRodenberg merged 17 commits intodevelopfrom
Conversation
|
@uekerman I realized that we could also move I'm also fine with the state as it is, but I currently do not really see why moving |
| context.resetToData(); | ||
| PRECICE_DEBUG("Map from dataID {} to dataID: {}", inDataID, outDataID); | ||
| context.mappingContext().mapping->map(inDataID, outDataID); | ||
| PRECICE_DEBUG("Mapped values = {}", utils::previewRange(3, context.toData()->values())); // @todo might be better to move this debug message into Mapping::map and remove getter DataContext::toData() |
There was a problem hiding this comment.
Why do you remove this DEBUG print? I think it might be useful. I think it might be useful.
There was a problem hiding this comment.
Good that you saw this. I removed it because it's the only place where DataContext::toData() is actually used. Maintaining this public function just for a debug statement is in my opinion too much and therefore I removed the function and the debug statement. Also fixed this now in 39910cc and cleaned it up.
If somebody really needs to debug here, this can also happen somewhere else where this data is actually used and accessed, for example inside the mapping.
There was a problem hiding this comment.
IIRC we added these Debug statements here in a dedicated effort by @fsimonis
These Debug statements are really important when developing an adapter. Let's please not remove them.
There was a problem hiding this comment.
Moved the debug statement inside DataContext then we also don't need DataContext::toData().
Co-authored-by: Frédéric Simonis <[email protected]>
…precice/precice into refactor-solver-interface-impl-map-data
|
I leave the review to @davidscn. LGTM |
uekerman
left a comment
There was a problem hiding this comment.
Looks good expect the removed mapping preview.
Both are OK. In a previous version you hid the mapping completely in the |
|
@davidscn can you take another look at this PR? |
davidscn
left a comment
There was a problem hiding this comment.
Only a minor comment, otherwise feel free to merge.
Co-authored-by: David Schneider <[email protected]>
Main changes of this PR
Creates function
isMappingRequiredand usesmapDataeverywhere, where mapping is performed.Motivation and additional information
Branched off from #1187
Author's checklist
isMappingRequiredintoDataContext?mapDataintoDataContext?SolverInterfaceImpl::resetWrittenDataintoDataContext?make changelogif there are user-observable changes since the last release.make formatto ensure everything is formatted correctly.Reviewers' checklist