espressomd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a bug or a feature?


From: Peter Košovan
Subject: Re: a bug or a feature?
Date: Fri, 16 Apr 2021 19:44:53 +0200

Hi Markus,

Thank you for your clarification. Now I understand that my initial post could have been misunderstood.

I think we both see it the same: "For bonds the bare distance and the minimum image distance should always be the same. If not, the bond is broken."

However, Espresso sees it differently. It does not raise a "bond broken" error if the bare distance and minimum image distance differ. It says "bond broken" only if the minimum image distance is too big. In some cases (soft bonds, for example), it results in a rather odd behaviour.

See the attached minimal working example (zipped because gmail dislikes python scripts in attachment).

With regards,

Peter


On Fri, Apr 16, 2021 at 4:31 PM Markus Deserno <deserno@andrew.cmu.edu> wrote:
Hi Peter,

I might have misunderstood what exactly happens or seems to be going on.
Maybe I was confused by the first sentence in your error description:

if two particles connected by a bond but they are found in different periodic copies of the simulation box, then Espresso runs without any error or warning. 

Well, of course, since there’s nothing wrong with that.

Since particles are internally represented in unfolded coordinates, I would expect to get a "bond broken" error if the (unfolded) distance is greater than box_l/2.

So would I. But of course you can be found in different periodic copies in
the UNFOLDED coordinates and still have a small true distance.

Apparently, minimum image convention is used also in the calculation of bond distances, which makes no sense in the unfolded coordinates.

I’m not sure whether this sentence is meant as a deduction from the previous
one, or whether this is an independent observation. But I’d agree it'd be odd
to calculate bond distance while also applying minimum image, if you have
the unfolded coordinates available. It just seems unnecessary. (Even though
of course not wrong.)

Concerning your second email:

in UNFOLDED coordinates, it should never happen that any bond length is longer than box_l/2.

Yes. Unless, of course, the bond broke ;-)

Therefore, if it is necessary to apply the minimum image convention for bonds, it should be seen as an error.

It should not be necessary. But I’d not call it an error. It’s superfluous work.

Espresso applies the minimum image convention, and lets this error silently pass.

So maybe I still don’t understand what you mean by error. For bonds the bare
distance and the minimum image distance should aways be the same. If not,
the bond is broken.

Best,
Markus

-- 
Dr. Markus Deserno ++1-412-268-4401 (office)
Professor of Physics ++1-412-681-0648 (fax)
Carnegie Mellon University ++1-412-268-8367 (Theresa Gabrielli)
5000 Forbes Avenue www.cmu.edu/biolphys/deserno/
Pittsburgh, PA 15213, USA deserno@andrew.cmu.edu

On Apr 16, 2021, at 10:14 AM, Peter Košovan <peter.kosovan@natur.cuni.cz> wrote:

Hi Markus,

I am afraid that you may have misplaced one "NOT" in your reply. If you say "for bonds it never seems to make sense to not first apply it", why would you call it a feature if Espresso does something that does not make sense?

Perhaps I did not make one thing clear: in UNFOLDED coordinates, it should never happen that any bond length is longer than box_l/2. Therefore, if it is necessary to apply the minimum image convention for bonds, it should be seen as an error. In the current implementation, Espresso applies the minimum image convention, and lets this error silently pass.

Can anyone give an example when bond_length > box_l/2 is not an error? If yes, then I fully agree that it should be seen as a feature.

With regards,

Peter

On Fri, Apr 16, 2021 at 3:51 PM Markus Deserno <deserno@andrew.cmu.edu> wrote:
Folks,

I cannot conceive of a single instance where I wanted to know a
bond distance but would NOT want the minimum image convention
applied. Note that I specifically said “BOND DISTANCE”. there are
many situations where I care about a DISTANCE and I do NOT
want the minimum image convention. But for bonds it never seems
to make sense to not first apply it.

So I’d be inclined to call it a "feature”.

Best,
Markus

-- 
Dr. Markus Deserno ++1-412-268-4401 (office)
Professor of Physics ++1-412-681-0648 (fax)
Carnegie Mellon University ++1-412-268-8367 (Theresa Gabrielli)
5000 Forbes Avenue www.cmu.edu/biolphys/deserno/
Pittsburgh, PA 15213, USA deserno@andrew.cmu.edu

On Apr 16, 2021, at 6:46 AM, Peter Košovan <peter.kosovan@natur.cuni.cz> wrote:

Dear Espresso developers,

Today, we noticed an unexpected behaviour of Espresso, that I would consider a bug, but it might also be a feature. Before submitting a bug report, I want to ask your opinion.

In brief: if two particles connected by a bond but they are found in different periodic copies of the simulation box, then Espresso runs without any error or warning. Since particles are internally represented in unfolded coordinates, I would expect to get a "bond broken" error if the (unfolded) distance is greater than box_l/2. Apparently, minimum image convention is used also in the calculation of bond distances, which makes no sense in the unfolded coordinates.

If we agree that such behaviour is undesired, I will submit a bug report and a minimal working example.

With regards,

Peter

--
Dr. Peter Košovan

Department of Physical and Macromolecular Chemistry
Faculty of Science, Charles University in Prague, Czech Republic

Katedra fyzikální a makromolekulární chemie
Přírodovědecká fakulta Univerzity Karlovy v Praze

www.natur.cuni.cz/chemistry/fyzchem/
Tel. +420221951029
Fax +420224919752



--
Dr. Peter Košovan

Department of Physical and Macromolecular Chemistry
Faculty of Science, Charles University in Prague, Czech Republic

Katedra fyzikální a makromolekulární chemie
Přírodovědecká fakulta Univerzity Karlovy v Praze

www.natur.cuni.cz/chemistry/fyzchem/
Tel. +420221951029
Fax +420224919752



--
Dr. Peter Košovan

Department of Physical and Macromolecular Chemistry
Faculty of Science, Charles University in Prague, Czech Republic

Katedra fyzikální a makromolekulární chemie
Přírodovědecká fakulta Univerzity Karlovy v Praze

www.natur.cuni.cz/chemistry/fyzchem/
Tel. +420221951029
Fax +420224919752

Attachment: mwe.zip
Description: Zip archive


reply via email to

[Prev in Thread] Current Thread [Next in Thread]