# Stochastic Stokes periodic boundary conditions in freefem crash on launch

**URL:** <https://community.freefem.org/t/stochastic-stokes-periodic-boundary-conditions-in-freefem-crash-on-launch/4362>\
**Category:** General Discussion\
**Created:** [September 19, 2026, 6:55am UTC](https://community.freefem.org/t/stochastic-stokes-periodic-boundary-conditions-in-freefem-crash-on-launch/4362 "2026-09-19T06:55:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sylvia](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/sylvia/32/3751_2.png) [@Sylvia](https://community.freefem.org/u/Sylvia)\
**Post date:** [September 19, 2026, 6:55am UTC](https://community.freefem.org/t/stochastic-stokes-periodic-boundary-conditions-in-freefem-crash-on-launch/4362/1 "2026-09-19T06:55:05Z")

</div>

Hello everyone,  
I am reproducing the temporal convergence rate experiment from this paper. I have removed the Dirichlet boundary conditions and added periodic boundary conditions. The program exits automatically after about 4 seconds of runtime, with no error messages and no log files generated. Could anyone tell me what might cause this problem?  
[StochasticStokes.pdf](https://community.freefem.org/uploads/short-url/2GoVGhXMoqKanTsbyQ2otPnj27f.pdf) (1.7 MB)  
[stokes.edp](https://community.freefem.org/uploads/short-url/vUDH4qBb3dTCuEljOLRewGcfyN5.edp) (7.4 KB)  
[normal\_K2\_N600\_M16.zip](https://community.freefem.org/uploads/short-url/xnKUbT95MolLhCB7D4tAbVXhQ1K.zip) (161.3 KB)

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [September 19, 2026, 10:09am UTC](https://community.freefem.org/t/stochastic-stokes-periodic-boundary-conditions-in-freefem-crash-on-launch/4362/2 "2026-09-19T10:09:49Z")

</div>

Hello,  
Since you define the space `Xh` with four unknowns and declare  
`Xh [u1,u2,xi,r],[v1,v2,Phi,q];`  
you cannot define the problems  
`problem B(xi,Phi)`  
and  
`problem St([u1,u2,r],[v1,v2,q])`  
that have only 1 or 3 unknowns. For solving these you need to define spaces `XB` and `Xstokes` with 1 and 3 unknowns respectively, and define the associated unknowns and problems

```auto
XB xxi,PPhi;
problem B(xxi,PPhi)

```

```auto
Xstokes [uu1,uu2,rr],[vv1,vv2,qq];
problem St([uu1,uu2,rr],[vv1,vv2,qq])

```

Next you can gather the results in the unknown [u1,u2,xi,r] as  
`[u1,u2,xi,r]=[uu1,uu2,xxi,rr];`  
Here is your modified code  
[stokes-sylvia.edp](https://community.freefem.org/uploads/short-url/u5NP2XeTxX9LSRhtll7nsgHGEuc.edp) (7.9 KB)
