lumol-org / lumol

Universal extensible molecular simulation engine
http://lumol.org/
BSD 3-Clause "New" or "Revised" License
190 stars 16 forks source link

Add combining rules for intermolecular interaction parameters #33

Open g-bauer opened 8 years ago

g-bauer commented 8 years ago

It would be very convenient to have combining rules. For example, specify in the input:

[input]
version = 1

[[pairs]]
atoms = ["A", "A"]
lj = {sigma = "... ", epsilon = ..."}

[[pairs]]
atoms = ["B", "B"]
lj = {sigma = "... ", epsilon = ..."}

[combining-rule]
atoms = ["A", "B"]
type = "LB" # LB = Lorentz-Berthelot

As an option, one would not need to specify A,B pair interactions. Instead, a combining rule is applied. Another possibility is to make the combining rule "global", i.e.:

[input]
version = 1

[[pairs]]
atoms = ["A", "A"]
lj = {sigma = "... ", epsilon = ..."}

[[pairs]]
atoms = ["B", "B"]
lj = {sigma = "... ", epsilon = ..."}

# the rule is applied to all intermolec. interactions
[combining-rule]
type = "LB" # LB = Lorentz-Berthelot
Luthaf commented 8 years ago

I agree this is nice to have, but I would not add a separated table for that. As combining rules mainly (only?) make sense for Lennard-Jones, we can reuse the lj key:

[input]
version = 1

[[pairs]]
atoms = ["A", "A"]
lj = {sigma = "... ", epsilon = ..."}

[[pairs]]
atoms = ["B", "B"]
lj = {sigma = "... ", epsilon = ..."}

[[pairs]]
atoms = ["A", "B"]
# Use previously defined parameters here
lj = {combine = "LorentzBerthelot"}

That plus #7 allow to use combining rules for all unspecified parameters:

[[pairs]]
atoms = ["*", "*"]
lj = {combine = "LorentzBerthelot"}