# [gmx-users] semi-permeable wall in gromacs

Justin Lemkul jalemkul at vt.edu
Thu Apr 7 21:37:34 CEST 2016

```
On 4/7/16 12:57 PM, gozde ergin wrote:
> Hi Justin,
>
> I just want to ask how is the r(nm) in posre.itp working?
>
> I would like to put semi-permeable wall on +/- 2.4 nm in z coordinate of the box.
>
> When I write 2.4 in the r(nm) property for [position_restraints] in posre.itp, it seems all of the molecules that I apply flat-bottom restraint travel +/- 2.4 nm.

This is expected.  The flat-bottom potential is established with respect to the
reference coordinates.

> But I do not want this, I would like to put a wall or force on +/-2.4 nm in z of the box.
>

If you want walls at given z-values, the z-coordinate of species to which the
restraint is applied have to be set to zero.  This coordinate file is passed to
grompp -r as the reference point for the potential.

-Justin

>
>
>> On 21 Mar 2016, at 18:37, Justin Lemkul <jalemkul at vt.edu> wrote:
>>
>>
>>
>> On 3/21/16 1:29 PM, gozde ergin wrote:
>>> Ok this was a silly question.
>>> In g_energy command 5. one is flat-bottom posres force.
>>> Sorry.
>>>
>>
>> The output of g_energy is energy, not force.
>>
>> But the quantity is simple to calculate.  If you have applied a flat-bottom restraint along z, then you just need the time series of the z-coordinates of the restrained particles.
>>
>> F = k*(z-z0), where z0 is the position at which the flat-bottom restraint is active.  Since there are two walls, then you need to conditions, for +/- z0 and then the final sum should be divided by 2 before being divided by the area of the semipermeable wall.
>>
>> -Justin
>>
>>>> On 21 Mar 2016, at 17:26, gozde ergin <gozdeeergin at gmail.com> wrote:
>>>>
>>>> Hey Justin,
>>>>
>>>> I am just wondering in order to estimate the osmotic pressure I need extract the flat-bottom restraint force. (Force/Area = Pressure)
>>>> Do you have any idea to how to extract this force?
>>>>
>>>>
>>>>
>>>>
>>>>> On 10 Mar 2016, at 15:58, Justin Lemkul <jalemkul at vt.edu> wrote:
>>>>>
>>>>>
>>>>>
>>>>> On 3/10/16 4:44 AM, gozde ergin wrote:
>>>>>> Dear Justin,
>>>>>>
>>>>>> Thanks for your respond, I assume there is a way to apply this restraint on specific molecules.
>>>>>> Because my system is mixed with organic and water and I would like to apply these forces on organic molecules not water?
>>>>>>
>>>>>
>>>>> So apply flat-bottom restraints to whatever the organic molecules are.  It's not something specific to ions.  You set the restraints in the molecule's topology (in its [moleculetype]), construct a reference coordinate file that defines some unphysical coordinates to be used as the center of the restraint, and that's it.  I've described the process in detail before so check the archive.
>>>>>
>>>>> -Justin
>>>>>
>>>>> --
>>>>> ==================================================
>>>>>
>>>>> Justin A. Lemkul, Ph.D.
>>>>> Ruth L. Kirschstein NRSA Postdoctoral Fellow
>>>>>
>>>>> Department of Pharmaceutical Sciences
>>>>> School of Pharmacy
>>>>> Health Sciences Facility II, Room 629
>>>>> University of Maryland, Baltimore
>>>>> 20 Penn St.
>>>>> Baltimore, MD 21201
>>>>>
>>>>> jalemkul at outerbanks.umaryland.edu | (410) 706-7441
>>>>> http://mackerell.umaryland.edu/~jalemkul
>>>>>
>>>>> ==================================================
>>>>> --
>>>>> Gromacs Users mailing list
>>>>>
>>>>> * Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!
>>>>>
>>>>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>>>>>
>>>>> * For (un)subscribe requests visit
>>>>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a mail to gmx-users-request at gromacs.org.
>>>>
>>>
>>
>> --
>> ==================================================
>>
>> Justin A. Lemkul, Ph.D.
>> Ruth L. Kirschstein NRSA Postdoctoral Fellow
>>
>> Department of Pharmaceutical Sciences
>> School of Pharmacy
>> Health Sciences Facility II, Room 629
>> University of Maryland, Baltimore
>> 20 Penn St.
>> Baltimore, MD 21201
>>
>> jalemkul at outerbanks.umaryland.edu <mailto:jalemkul at outerbanks.umaryland.edu> | (410) 706-7441
>> http://mackerell.umaryland.edu/~jalemkul <http://mackerell.umaryland.edu/~jalemkul>
>>
>> ==================================================
>> --
>> Gromacs Users mailing list
>>
>> * Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List <http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List> before posting!
>>
>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists <http://www.gromacs.org/Support/Mailing_Lists>
>>
>> * For (un)subscribe requests visit
>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users <https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users> or send a mail to gmx-users-request at gromacs.org <mailto:gmx-users-request at gromacs.org>.
>

--
==================================================

Justin A. Lemkul, Ph.D.
Ruth L. Kirschstein NRSA Postdoctoral Fellow

Department of Pharmaceutical Sciences
School of Pharmacy
Health Sciences Facility II, Room 629
University of Maryland, Baltimore
20 Penn St.
Baltimore, MD 21201

jalemkul at outerbanks.umaryland.edu | (410) 706-7441
http://mackerell.umaryland.edu/~jalemkul

==================================================
```