Skip to content

Abstract particle bond handling #5046

@RudolfWeeber

Description

@RudolfWeeber

Functions that deal with bonds (force/eneryg calculation, bond breakgge, collisin deteciotn, cluster analysis) should not know about how exactly the bond info is stored. See #4390 for background.

We allow for differnet storage formats for pair bonds and multi-partner bonds (#4390)

Steps

Implement storage-agnostic interface functions

in src/core/bonds.cpp/hpp (to be created). All of these are parallel calls. They will

  • for now: create the respective BondView for the primary particle (first particle id in pair or multi-particle bonds) and insert/remove/find it in the Particle.bonds() of the primary particle (which is a BondList, i.e., a container for BondView)

  • in the future: Create approprate bond views (which differ for all involved particles) and add/remove/find tehm on the p.bonds() for all involved particles

    • add_pair_bond(bond_id, p1_id, p2_id)
    • remove_pair_bond()
    • bond pair_bond_exists()
    • `add_multi_particle_bond(int bond_id, vector involved_particle_ids)
    • remove_...
    • ..._exists
    • for_each_bond(particle, pair_bond_kernel, multi_bond_kernel);. where the kernels take
      • for pair bonds: bond_id, p1_id, p2_id
      • for multi particle bonds bond_id, vector<int> involved_particle_ids

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions