-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
include/votca/xtp/atomcontainer.h
Outdated
_type += "_" + container._type; | ||
_atomlist.insert(_atomlist.end(), container._atomlist.begin(), | ||
container._atomlist.end()); | ||
for (auto at : container._atomlist) { |
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.
for (auto at : container._atomlist) { | |
for (const auto& at : container._atomlist) { |
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.
@rubengerritsen your assumptions are correct as far as I know.
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.
actually I am not sure about other T
like atom
or staticsite
. I am not sure if this does not break other template arguements.
Co-authored-by: Jens <jenswehner@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #599 +/- ##
======================================
Coverage 51.5% 51.5%
======================================
Files 302 302
Lines 28815 28819 +4
======================================
+ Hits 14846 14849 +3
- Misses 13969 13970 +1
Continue to review full report at Codecov.
|
FWIW, this has fixed the problem. Not sure about the other concerns @JensWehner mentioned. |
At the moment it seems that AddContainer is only used on QMAtoms. So it should be fine. To make sure that it will be fine in the future as well, I propose we untemplate the |
@votca-bot changelog: fixed atomid numbering while adding containers |
I might be wrong, I am looking at the |
The atomids are only needed for atomwise operations, which iqm should not do, as far as I know. |
For the calculations that we do now, I agree. But the annoying thing is that the atomIDs of the B segment in iqm will always be offset by the size of the A segment if we merge the current fix in master. If someone in the future ever needs to use the atomIDs in iqm it will be very hard to figure that out. So I have a new idea, that I will try to implement. The QMregion in qmmm makes in essence a new "molecule" (can be multiple) that is done in the QMRegion::push_back, if we update the atom IDs there then it won't affect any other classes. Furthermore the AddContainer behaves as one should expect, by simply appending one container to another without influencing the content. |
Yeah yes and no, the atomid inside a molecule should be unique, even if you add two molecules to form a new one. So renumbering is actually a desirable property. For the other molecule like containers, I am not sure if the atomid can also correspond to the atomid inside the molecular dynamics simulation. |
e37e3b4
to
cd18605
Compare
After a QMmapping all atoms are stripped of their original (MD sim) atomIDs and hence all start at zero. My main concern raised above about the iqm was just wrong. Hence the original fix is the real fix. |
I thought we wanted to move this up to the QMMolecule? |
Hmm, I am not really sure that we understood one another, because that is not necessarily what I was thinking. Though it is a good idea. So hopefully I understood it correctly this time. I have added a new commit in which I moved the |
fixes #597
Or at least so I think, there are two assumptions:
@JensWehner are these valid assumptions?