espresso icon indicating copy to clipboard operation
espresso copied to clipboard

Cannot write bonds with more than one partner in h5md

Open jonaslandsgesell opened this issue 6 years ago • 5 comments

Failing (#1303) for bonds with multiple partners is avoided, however bonds with multiple partners is still not possible.

jonaslandsgesell avatar Dec 13 '17 13:12 jonaslandsgesell

The connectivity list in H5MD is not tied to "one particle at a time". It is perfectly ok to have bonds for the following list:

0 1
0 2
1 2
2 3

for instance, where particle 0 has two bonds. Also, several connectivities can be provided for a given particles group. You can split, for instance, the FENE and harmonic bonds, etc.

Given the interaction with core data structures of ESPResSo, I'd be glad to partner with someone to resolve this issue.

pdebuyl avatar Feb 15 '18 12:02 pdebuyl

I think writing particles with multiple bonds in the format you proposed is possible. What is not possible so far is writing a bond which has 3 partners (e.g. for bonds that are anisotropic and depend on the location of a third particle). To my understanding such a bond would be written as a 3-tuple (0,1,2). Unfortunately the way espresso stores these kinds of bonds is not the best I can imagine. What is also missing is the kind of bond which is stored. How do you safe this in the h5md file?

jonaslandsgesell avatar Feb 27 '18 20:02 jonaslandsgesell

The file format itself is generic. You can have as many datasets in /connectivity as needed.

A typical use case could be:

 \connectivity
    \-- bond_type_1: Integer[N1, 2]
        +-- object reference to /particles/atoms
    \-- bond_type_2: Integer[N2, 3]
        +-- object reference to /particles/atoms
    \-- bond_type_3: Integer[variable, N3, 2]
        +-- object reference to /particles/atoms

Where the first group is a fixed-in-time connectivity list for a pair potential, the second one a fixed-in-time connectivity list for an angular potential and the thid one the result of a polymerization process (note the extra time dependence indicated by the first variable dimension).

There is no specification for force field specification in H5MD, we ruled them out as too complex to abstract for our "manpower". This is force-field and simulation code dependent. You can add attributes to the connectivity lists if you wish:

 \connectivity
    \-- bond_type_1: Integer[N1, 2]
        +-- object reference to /particles/atoms
        +-- espressomd interaction type : bonded_ia::fene
        +-- espressomd parameters: [10.0, 5.2, 3]

that would identify, for the purpose of espressomd, the type of interaction.

I have started to look in h5md_core.cpp for modifications.

I propose to change the use of "bond" (https://github.com/espressomd/espresso/blob/python/src/core/io/writer/h5md/h5md_core.cpp#L422) into a list/vector/map of bonds. There would be one per bonded interaction and the code would loop over them when storing the data. That would make all fixed-in-type connectivity lists manageable.

pdebuyl avatar Feb 28 '18 08:02 pdebuyl

@jonaslandsgesell?

RudolfWeeber avatar Nov 03 '18 09:11 RudolfWeeber

This requires a more changes in the way bonds are written by the h5md part in espresso. Won't fix now.

Am Sa., 3. Nov. 2018, 10:07 hat RudolfWeeber [email protected] geschrieben:

@jonaslandsgesell https://github.com/jonaslandsgesell?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/espressomd/espresso/issues/1715#issuecomment-435572567, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8wPcR5UcNc-a_m3GZVTzQQWjdrsUCPks5urVzrgaJpZM4RAjuf .

jonaslandsgesell avatar Nov 03 '18 09:11 jonaslandsgesell