# Schwarz algorithm in Parallel

**URL:** https://community.freefem.org/t/schwarz-algorithm-in-parallel/3734
**Category:** General Discussion
**Created:** [February 6, 2025, 9:42pm UTC](https://community.freefem.org/t/schwarz-algorithm-in-parallel/3734 "2025-02-06T21:42:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![abdobenf](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@abdobenf](https://community.freefem.org/u/abdobenf)
#### Post date: [February 6, 2025, 9:42pm UTC](https://community.freefem.org/t/schwarz-algorithm-in-parallel/3734/1 "2025-02-06T21:42:30Z")

</div>

Hello,  
I’m trying to solve a problem using a non-overlapping domain decomposition, I have successfully coded it in parallel using two cores manually (I have two subdomains), is there any example to use built in tools in FreeFem to solve this problem with more cores?  
Thanks,  
Benfanich

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [February 7, 2025, 7:24am UTC](https://community.freefem.org/t/schwarz-algorithm-in-parallel/3734/2 "2025-02-07T07:24:29Z")

</div>

Either PETSc, ffddm or HPDDM. There is no reason for you to implement this by hand.

---

<div class="post-metadata">

### Author: ![abdobenf](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@abdobenf](https://community.freefem.org/u/abdobenf)
#### Post date: [February 7, 2025, 3:00pm UTC](https://community.freefem.org/t/schwarz-algorithm-in-parallel/3734/3 "2025-02-07T15:00:31Z")

</div>

Thank you for your help.

Sorry if this a stupid question.

Is there an example on how to decompose the two subdomains and get a matching mesh using these tools ?

Because what I tried to do is decompose each one of them separately.

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [February 7, 2025, 7:02pm UTC](https://community.freefem.org/t/schwarz-algorithm-in-parallel/3734/4 "2025-02-07T19:02:53Z")

</div>

There are examples here [FreeFem-sources/examples/hpddm at master · FreeFem/FreeFem-sources · GitHub](https://github.com/FreeFem/FreeFem-sources/tree/master/examples/hpddm) or there [FreeFem-sources/examples/ffddm at master · FreeFem/FreeFem-sources · GitHub](https://github.com/FreeFem/FreeFem-sources/tree/master/examples/ffddm).
