# Initialisation in different regions

**URL:** <https://community.freefem.org/t/initialisation-in-different-regions/1606>\
**Category:** General Discussion\
**Created:** [March 17, 2022, 11:37am UTC](https://community.freefem.org/t/initialisation-in-different-regions/1606 "2022-03-17T11:37:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [March 17, 2022, 11:37am UTC](https://community.freefem.org/t/initialisation-in-different-regions/1606/1 "2022-03-17T11:37:16Z")

</div>

Dear all,

Say

```auto
mesh Th;
int fluid=Th(x0,y0).region, solid=Th(x1,y1).region; 
fespace Vh(Th,P1);
Vh phi;

```

How can we initialise` phi=0` in the fluid region, while` phi=1` in the solid region?

---

<div class="post-metadata">

**Author:** ![henkel](https://avatars.discourse-cdn.com/v4/letter/h/b77776/32.png) [@henkel](https://community.freefem.org/u/henkel)\
**Post date:** [March 17, 2022, 4:09pm UTC](https://community.freefem.org/t/initialisation-in-different-regions/1606/2 "2022-03-17T16:09:47Z")

</div>

```auto
phi = 0*(region == fluid) + 1*(region == solid);

```

Does this meet your expectations?

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [April 2, 2022, 6:09am UTC](https://community.freefem.org/t/initialisation-in-different-regions/1606/3 "2022-04-02T06:09:57Z")

</div>

@henkel thank you, this looks nice. i will have a try.
