Wild card '*' in fix restrain for bonds


I am using LAMMPS-5Jun19 stable version in linux 64-bit architecture. This is regarding the fix restrain command. AMBERMD uses the following set of commands to restrain a group of atoms

Hold the molecule fixed
RES 1 20

where all combinations between 1 and 20 are considered, whereas LAMMPS uses the following command

**fix holdem all restrain bond 1 20 500.0 500.0** **2.75**,

in which only the bond between atoms 1 and 20 (atom IDs given with mass in data file I presume)
 are considered.

Is it possible to use wild cards like __fix fID all restrain bond 1*20 1*20__ 
from following versions similar to pair_coeff?  If there is any workaround, please let me know.

Vignesh M

are you sure you are not confusing individual topological restraints with position restraints?
the latter would be enabled in LAMMPS using fix spring/self and not fix restrain.

there is no wild card support in fix restrain. it would make little sense to do it the way you are outlining it, as you will restrain all permutations of pairs of atoms to the same distance which cannot be correct.

that said. it is easy to work around the limitation of having no wild cards for fix restrain by using some scripting to generate the necessary input text. e.g. in bash with:

(echo ‘fix holdem all restrain &’ ; for a in (seq 1 20) ; do for b in (seq a 20) ; do echo "bond {a} ${b} 500.0 500.0 2.75 &" ; done ; done ; echo ) > restrain.inc

and then use the command “include restrain.inc” to input this text or simply cut-n-paste it into your script.
but as mentioned before, this can hardly be what you want.


1 Like

Thank you Mr. Axel kohlmeyer. It is indeed fix spring/self that I want.

This case is closed.

Vignesh M