Hello sir,
i want interaction between active brownian particles and substrate particles in 2 dimension… but I did not found this potential in unbond style
harmonic potential =1/2 k(r-r0)^2
but I found it in bond style…
plz help me to consider this potential…
thank you
As you have found, there is no pair style implemented for that.
You would either write a custom pair style (e.g. based on lj/cut) to realize this ( 3. Modifying & extending LAMMPS — LAMMPS documentation )
implement this via pair style python with a python class ( pair_style python command — LAMMPS documentation )
or use a tabulated potential ( pair_style table command — LAMMPS documentation ).
The tabulation can also created from the Python variant using the pair_write command — LAMMPS documentation
Please carefully review the linked documentation.
Or you could create a feature request issue describing the specifics at: Issues · lammps/lammps · GitHub
and hope that somebody volunteers to implement the potential you are looking for.
Thank you so much for your kind suggestions…
Can’t this interaction be obtained by setting appropriate values for the parameters of the harmonic types from one of the granular pair styles? Is this new style primarily for ease of use, because this simple interaction is used fairly often? Or is there more to it that can’t be achieved via the granular styles?
Granular pair style require a per-atom diameter and have a per-atom mass and many other quirks. Most don’t support atom types.
As of the 17 February version of LAMMPS (released today, obviously), there is a new pair style that implements exactly what was asked for: pair_style harmonic/cut command — LAMMPS documentation
It is likely much more efficient than (ab-)using a granular pair style.
As mentioned in a previous post in this thread the simplest way to implement the requested interaction with an older LAMMPS version is to use the pair_style table command — LAMMPS documentation
Hello Sir,
I want to know about the pair style that was added in the latest version (17-02-2022).
Is still giving this error… Illegal pair_style command
plz, consider this problem…
LAMMPS (17 Feb 2022)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
units lj
dimension 2
boundary p p p
atom_style sphere
lattice sq 1.0
Lattice spacing in x,y,z = 1 1 1
region mybox block 0 36 0 36 0 0.5
create_box 2 mybox
Created orthogonal box = (0 0 0) to (36 36 0.5)
1 by 1 by 1 MPI processor grid
region box block 0 36 0 36 0 0.5 units box
create_atoms 1 region box
Created 1296 atoms
using lattice units in orthogonal box = (0 0 0) to (36 36 0.5)
create_atoms CPU = 0.005 seconds
group mobile type 1
1296 atoms in group mobile
region plane block 0 36 0 36 0 0.5 units box
lattice sq 0.2
Lattice spacing in x,y,z = 2.236068 2.236068 2.236068
create_atoms 2 region plane
Created 289 atoms
using lattice units in orthogonal box = (0 0 0) to (36 36 0.5)
create_atoms CPU = 0.001 seconds
group substrate type 2
289 atoms in group substrate
pair_style harmonic/cut 2.5
ERROR: Illegal pair_style command (src/EXTRA-PAIR/pair_harmonic_cut.cpp:149)
Last command: pair_style harmonic/cut 2.5
The error message is correct. The harmonic/cut pair style takes no arguments and thus your input is incorrect. The documentation says so, too, but unfortunately it’s example is incorrect as well.
Thank you… you are saying right… The example is wrong…
It is 3 years old. Anyway, the subject interests me. Perhaps I will get a comment?
This is a repulsive potential. I have been looking for an attractive one. Finally I made it with table style. My potential acts like a spring between atoms.
Creating my potential is described in this: Harmonic interlayer potential with no higher-order contributions. - Mendeley Data
and there: [2411.07633] Stretched-exponential stress dynamics in chain of springs and masses model of crystals: analytical results and MD simulations
Why I find my way of doing this better? The reason is that I want to have potential with power different than 2 as well.
But there is another reason, too. I am interested in harmonic potential between layers in crystal (FCC), when layers move in a coherent way. In that case the potential between them is not harmonic anymore, it contains higher order corrections.
Please confirm that there is still no other way to do this?
You can now try out different analytical forms of potentials with pair styles in the LEPTON package. Of course, lepton being interpreted, makes it slow, so using pair_write to create a table for pair style table, is still the way to go (unless there are very few pairs of atoms affected).
For inter-layer interactions, you may check out the potentials in the INTERLAYER package.
So how do you make your potential energy and force continuous at the cutoff?
So why not define bonds and use bond style harmonic?
Thank you, Alex,
I will have a look to LEPTON and INTERLAYER packages and analyze what is there. For now, I am grateful for these suggestions.
So how do you make your potential energy and force continuous at the cutoff?
I do not. I care that conditions are that atoms do not go outside of cutoff. My potential is good for relatively low temperatures (not more than 100-500 K) and not too large stress (a few GPa) (depending on some other parameters)
So why not define bonds and use bond style harmonic?
Hm, I will need to study bonds…