# Setting up a virtual site to represent a dummy(=massless) LJ sphere

**URL:** <https://gromacs.bioexcel.eu/t/setting-up-a-virtual-site-to-represent-a-dummy-massless-lj-sphere/3334>\
**Category:** User discussions\
**Tags:** forcefield\
**Created:** [December 20, 2021, 3:14pm UTC](https://gromacs.bioexcel.eu/t/setting-up-a-virtual-site-to-represent-a-dummy-massless-lj-sphere/3334 "2021-12-20T15:14:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valentina](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/valentina/32/725_2.png) [@Valentina](https://gromacs.bioexcel.eu/u/Valentina)\
**Post date:** [December 20, 2021, 3:14pm UTC](https://gromacs.bioexcel.eu/t/setting-up-a-virtual-site-to-represent-a-dummy-massless-lj-sphere/3334/1 "2021-12-20T15:14:28Z")

</div>

GROMACS version: 2021.3  
GROMACS modification: No

Sorry, for this long post, just trying to summarise and link all the concepts, as I am struggling to wrap my head around things.

I need to create a repulsive area of a given size, it should be able to move around the simulation box as the system relaxes.

I thought I could make use of a dummy/virtual LJ spere with some radius, but w/o mass or charge. Obviously, I need a mass for the MD (=forces), so, honestly, I am confused here.  
 → _ **Am I correct to be using dummies for massless repulsive LJ sphere?** _

My approach is as follows, consulting [manual](https://manual.gromacs.org/current/reference-manual/topologies/parameter-files.html#non-bonded-parameters) obviously:

1. add a particle into `ffnonbonded.itp`:

```auto
[atomtypes]
; type atnum mass charge ptype sigma epsilon
    LJ 0 0.0 0.000 V 0.5 0.001 ; LJ test
 CG331 6 12.011000 0.000 A 0.365268474438 0.3263520 ; aliphatic C for CH3
 CG321 6 12.011000 0.000 A 0.358141284692 0.2343040 ; aliphatic C for CH2
  HGA3 1 1.008000 0.000 A 0.238760856462 0.1004160 ; alphatic proton, CH3
  HGA2 1 1.008000 0.000 A 0.238760856462 0.1464400 ; alphatic proton, CH2

```

I declare `ptype` as `V` for the virtual site, as per [Table 10](https://manual.gromacs.org/current/reference-manual/topologies/particle-type.html#tab-ptype):  
 → _ **Am I correct that I need particle to be a virtual site, to be able to have no mass, unlike `A` for an atom?** _  
 → _ **Do I need to make an entry in `atomtypes.atp`? or is it only for `ptype A`?** _ I am reading [Atom types entry in the manual](https://manual.gromacs.org/current/reference-manual/topologies/particle-type.html#atomtype) and I guess no?

1. make an `LJ.itp` for it:

```auto
[moleculetype]
; Name nrexcl
LJ 0

[atoms]
; id	at type	res nr residu name	at name	cg nr	charge
1 LJ 1 LJ LJ 1 0.0

```

Here, I am relying on the mixing rules of the forcefield, as declared under `forcefield.itp`, for instance, these are CHARMM:

```auto
[defaults]
; nbfunc comb-rule gen-pairs fudgeLJ fudgeQQ
       1 2 yes 1.0 1.0

#include "ffnonbonded.itp"
#include "ffbonded.itp"

```

If I do not want to rely on whatever I get from the mixing rules, I need to declare the values myself. As per [Table 13](https://manual.gromacs.org/current/reference-manual/topologies/topology-file-formats.html#tab-topfile1), I add `[nonbond_params]` into the `ffnonbonded.itp`, for example:

```auto
[nonbond_params]
  ; i j func sigma epsilon
    LJ CG331 1 0.5 0.001 ; LJ test
    LJ CG321 1 0.5 0.001 ; LJ test
    LJ HGA3 1 0.5 0.001 ; LJ test
    LJ HGA2 1 0.5 0.001 ; LJ test

```

_Self note_: I do not use `[pairs]` & `[pairtypes]` as those are to modify interactions within the molecule itself, see [Table 13](https://manual.gromacs.org/documentation/2021/reference-manual/topologies/topology-file-formats.html#tab-topfile1).

1. I build a system, for example, for 5 LJ and 20 alkanes in a box my `topology.top` looks like this:

```auto
#include "../charmm36.ff/forcefield.itp"

#include "./c5h.itp"
#include "./LJ.itp"

[system]
alkane + LJ

[molecules]
; Compound #mols
C5H 20
LJ 5

```

Now, I am struggling to understand what is ` [virtual_sites1]` entry is for. In my mind, it was something to deal with the massless dummy? In the manual [Virtual sites](https://manual.gromacs.org/current/reference-manual/topologies/particle-type.html#virtual-sites) it is linked to `type 1` interaction, but no such interaction is shown on the Fig 34 in the [Virtual interaction sites](https://manual.gromacs.org/current/reference-manual/functions/interaction-methods.html#virtualsites). It also seems to involve 2 atoms and falls under intramolecular interactions, [Table 14](https://manual.gromacs.org/documentation/2021/reference-manual/topologies/topology-file-formats.html#tab-topfile2)

I guess, all I want to understand is:  
 → _**Do I need to use ` [virtual_sites1]` when introducing a massless dummy LJ?**_  
 → _ **Is there anything I am missing in my setup?** _  
 → _**More general Q - If I have a massless atom floating around the box (such as in this example), how are the dynamics of it computed? Would MD only be feasible when there are other real (=with mass) atoms in the box?**_

Thank you for your advice and sorry for such long post!  
V

* * *

@mholmboe Michael, I am just tagging you here, since I saw [your earlier post](https://gromacs.bioexcel.eu/t/single-ion-virtual-sites-using-virtual-sites1-in-gromacs-2021/1810) and you may have some insight. My Q is a little different, hence, I thought I’d start a new thread rather than piggyback on yours.

---

<div class="post-metadata">

**Author:** ![mholmboe](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/mholmboe/32/753_2.png) [@mholmboe](https://gromacs.bioexcel.eu/u/mholmboe)\
**Post date:** [January 2, 2022, 1:54pm UTC](https://gromacs.bioexcel.eu/t/setting-up-a-virtual-site-to-represent-a-dummy-massless-lj-sphere/3334/2 "2022-01-02T13:54:37Z")

</div>

Im answering since I was tagged, not necessarily meaning I can help you…

→ _ **Am I correct to be using dummies for massless repulsive LJ sphere?** _

_I’m unsure what exactly what you want to achieve. What would be the benefit of using a massless particle? Seems better to use something with a mass, with or without using position restraints and such, and then use a [nonbond\_params] section. Alternatively, have you considered using (inverted) flat-bottom distance restraints (Fig 30.B)? while using refcoord\_scaling=COM_  
[https://manual.gromacs.org/documentation/2021/reference-manual/functions/restraints.html#flat-bottomed-position-restraints](https://manual.gromacs.org/documentation/2021/reference-manual/functions/restraints.html#flat-bottomed-position-restraints)

→ _ **Am I correct that I need particle to be a virtual site, to be able to have no mass, unlike `A` for an atom?** _

_I would think any virtual site has to have one or more parent/s (constructing atoms). Not sure if virtual sites can be single particles, do not think so. Why not use an actual dummy atom with some mass, and/or position restraints?_

→ _ **Do I need to make an entry in `atomtypes.atp` ? or is it only for `ptype A` ?** _

I’m unsure. Try running gmx grompp and then gmx dump with the generated .tpr file, to inspect what mass is used for your dummy particle.

→ _**Do I need to use `[virtual_sites1]` when introducing a massless dummy LJ?**_

_a virtual\_site1 site will only sit on top of its one constructing/parent atom site, as I understand, which means you need an actual atom anyway._

→ _ **Is there anything I am missing in my setup?** _

_I do not think so, but I would not recommend using a massless site or a virtual site._

→ _**More general Q - If I have a massless atom floating around the box (such as in this example), how are the dynamics of it computed? Would MD only be feasible when there are other real (=with mass) atoms in the box?**_

_I have not tried, but would assume the actual physics would be unreal since the massless particle might achieve insane velocities? I assume Gromacs would not be happy._

_All the best,_

_Michael Holmboe_
