[lammps-users] Regarding "fix spring"

Hi,

I have some questions about the command “fix spring.” They might be very naive ones…

  1. If I use “fix spring couple” between two groups, is this spring added between the centers of mass of these two groups?

  2. Does “NULL” in the example mean the spring is only applied in z direction?

fix 5 bilayer1 spring couple bilayer2 100.0 NULL NULL 10.0 0.0

  1. How to output the spring energy? It is said in the document that it can be accessed in various ways? So how exactly? Do I need to use “computer local/atom” to generate the output?
    “This fix computes a global scalar which can be accessed by various output commands. The scalar is the spring energy = 0.5 * K * r^2.”

Thank you in advance of taking time reading my email!
-Fei

Hi,

I have some questions about the command "fix spring." They might be very
naive ones...

1. If I use "fix spring couple" between two groups, is this spring added
between the centers of mass of these two groups?

yes.

2. Does "NULL" in the example mean the spring is only applied in z
direction?

fix 5 bilayer1 spring couple bilayer2 100.0 NULL NULL 10.0 0.0

yes.

3. How to output the spring energy? It is said in the document that it can
be accessed in various ways? So how exactly? Do I need to use "computer
local/atom" to generate the output?
"This fix computes a global scalar which can be accessed by various output
commands. The scalar is the spring energy = 0.5 * K * r^2."

you can output it, e.g., via fix print.
have a closer look at the manual there are discussions on how to
output computed data.

cheers,
     axel