Skip to content

Wrapping the interactions in a structure. #85

@JaydevSR

Description

@JaydevSR

Right now the interaction in the library are passed down individually as keyword arguments pairwise_inters, specific_inters_list and general_inters. I have a suggenstion that maybe these can be wrapped in a structure like:

const struct Interactions{PW, SF, GN}
    pairwise_inters::PW
    specific_inters_list::SF
    general_inters::GN
end

This can be helpful in grouping together interactions that are meant for a particular simulation/system without having to worry about x3 variables that carry this information. The usefulness of this is not that much when we are talking about simulation with a single type of interactions, but becomes apparent in cases such as Hamiltonian-REMD (which I am trying to implement) where all the replicas have different force fields.

Although we can always use three different vectors to store the different variations of three interactions whenever we want to do such a thing, it seems a bit non-structured (pun intended) way of doing things, when the i'th elements are clearly meant to be used together.

Still, this will be unnecessary if such a situation is rare in practice (which I am not sure about) and also this will increase complexity a bit for simple simulations like with simple LennardJones potential where you will have to do:

inters = Interactions(pairwise_inters=(LennardJones(..), ))

...

Here a workaround can be to write simple convenience functions that set this up for the user:

LennardJonesInteraction(...) = Interactions(pairwise_inters=(LennardJones(..), ))

Please give your views on this.

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