# Is it necessary to apply external pressure in the deformation direction?

**URL:** <https://gromacs.bioexcel.eu/t/is-it-necessary-to-apply-external-pressure-in-the-deformation-direction/10684>\
**Category:** User discussions\
**Tags:** mdp-parameters\
**Created:** [December 2, 2024, 10:55am UTC](https://gromacs.bioexcel.eu/t/is-it-necessary-to-apply-external-pressure-in-the-deformation-direction/10684 "2024-12-02T10:55:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ema2022](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@Ema2022](https://gromacs.bioexcel.eu/u/Ema2022)\
**Post date:** [December 2, 2024, 10:55am UTC](https://gromacs.bioexcel.eu/t/is-it-necessary-to-apply-external-pressure-in-the-deformation-direction/10684/1 "2024-12-02T10:55:14Z")

</div>

GROMACS version: 2022  
GROMACS modification: No

Hi All,

When performing deformation in the z-direction with semi-isotropic coupling, should the reference pressure in the z-direction be set to 1.0 or 0.0? I have set the compressibility in the z-direction to 0.

pcoupl = Parrinello-Rahman  
pcoupltype = semiisotropic  
tau\_p = 1.0  
ref\_p = 1.0 0.0  
compressibility = 4.5e-5 0

@MagnusL Could you please comment on this?

Thank you.

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [December 2, 2024, 2:16pm UTC](https://gromacs.bioexcel.eu/t/is-it-necessary-to-apply-external-pressure-in-the-deformation-direction/10684/2 "2024-12-02T14:16:23Z")

</div>

It doesn’t really matter what pressure you set in a dimension with 0 compressibility. I usually keep `ref_p = 1.0 1.0`, but `ref_p = 1.0 0.0` should work the same.

---

<div class="post-metadata">

**Author:** ![Ema2022](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@Ema2022](https://gromacs.bioexcel.eu/u/Ema2022)\
**Post date:** [December 2, 2024, 2:24pm UTC](https://gromacs.bioexcel.eu/t/is-it-necessary-to-apply-external-pressure-in-the-deformation-direction/10684/3 "2024-12-02T14:24:40Z")

</div>

Yes, it is. I tried it myself and obtained the same result in both cases.

Thanks.

---

<div class="post-metadata">

**Author:** ![Ema2022](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@Ema2022](https://gromacs.bioexcel.eu/u/Ema2022)\
**Post date:** [February 19, 2025, 11:14am UTC](https://gromacs.bioexcel.eu/t/is-it-necessary-to-apply-external-pressure-in-the-deformation-direction/10684/4 "2025-02-19T11:14:47Z")

</div>

Hi Again,

What would be a good value for compressibility to use in the deformation of a viscoelastic material? Does compressibility impact the deformation simulation?

---

<div class="post-metadata">

**Author:** ![MichelePellegrino](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/michelepellegrino/32/628_2.png) [@MichelePellegrino](https://gromacs.bioexcel.eu/u/MichelePellegrino)\
**Post date:** [February 19, 2025, 1:13pm UTC](https://gromacs.bioexcel.eu/t/is-it-necessary-to-apply-external-pressure-in-the-deformation-direction/10684/5 "2025-02-19T13:13:21Z")

</div>

Hi,  
The value of the compressibility _itself_ depends on the type of material you are simulating, but in general I think we should remind that tunning the compressibility is essentially the same as tuning the relaxation time of the barostat (`tau_p` and `compressibility` always go together, see the definition of the inverse mass parameter matrix for P-R). So, from a purely _numerical_ point of view, I would argue you should choose a value of `tau_p`/`compressibility` such that the box relaxes in `x/y` faster than it is strained in `z` (i.e. it depends on the strain rate you are using). I am not sure whether coupling in `z` would create instabilities/artifacts, I usually do not couple in the strain direction just to be safe.

---

<div class="post-metadata">

**Author:** ![Ema2022](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@Ema2022](https://gromacs.bioexcel.eu/u/Ema2022)\
**Post date:** [February 21, 2025, 11:48am UTC](https://gromacs.bioexcel.eu/t/is-it-necessary-to-apply-external-pressure-in-the-deformation-direction/10684/6 "2025-02-21T11:48:51Z")

</div>

Thanks a lot for the clarification.

---

<div class="post-metadata">

**Author:** ![Ema2022](https://avatars.discourse-cdn.com/v4/letter/e/c5a1d2/32.png) [@Ema2022](https://gromacs.bioexcel.eu/u/Ema2022)\
**Post date:** [March 4, 2025, 11:19am UTC](https://gromacs.bioexcel.eu/t/is-it-necessary-to-apply-external-pressure-in-the-deformation-direction/10684/7 "2025-03-04T11:19:13Z")

</div>

Hi Again,

In my system, when strain is zero (t=0), I get a stress value, which I believe is an artifact. Can subtracting this stress value from all the others solve the issue? Or is there any other way to avoid this?
