# About how to use DDM tool

**URL:** https://community.freefem.org/t/about-how-to-use-ddm-tool/4031
**Category:** General Discussion
**Created:** [July 31, 2025, 1:43pm UTC](https://community.freefem.org/t/about-how-to-use-ddm-tool/4031 "2025-07-31T13:43:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![qingYang](https://avatars.discourse-cdn.com/v4/letter/q/9f8e36/32.png) [@qingYang](https://community.freefem.org/u/qingYang)
#### Post date: [July 31, 2025, 1:43pm UTC](https://community.freefem.org/t/about-how-to-use-ddm-tool/4031/1 "2025-07-31T13:43:11Z")

</div>

Hello everyone,:  
I have studied the following DDM case and I have a question. For the ffddmsetupOperator and ffddmbuildrhs functions, it is necessary to define the macro Varf(varfName, meshName, VhName). Suppose my problem has a vector unknown and a scalar unknown (electromagnetic field problem) defined in different function spaces, how to handle this issue? For complex multi-variable, multi-function space or multi-mesh problems, does it mean that the tool becomes ineffective?

[3Dexample.edp](https://community.freefem.org/uploads/short-url/q6fG8i2T000Oed4enxIS28c9n5H.edp) (940 Bytes)

[ffddm documentation](https://doc.freefem.org/documentation/ffddm/documentation.html)

---

<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: [July 31, 2025, 2:37pm UTC](https://community.freefem.org/t/about-how-to-use-ddm-tool/4031/2 "2025-07-31T14:37:29Z")

</div>

You can use a PETSc MatNest instead and let fieldsplit do the coupling.

---

<div class="post-metadata">

### Author: ![qingYang](https://avatars.discourse-cdn.com/v4/letter/q/9f8e36/32.png) [@qingYang](https://community.freefem.org/u/qingYang)
#### Post date: [July 31, 2025, 2:54pm UTC](https://community.freefem.org/t/about-how-to-use-ddm-tool/4031/3 "2025-07-31T14:54:02Z")

</div>

Thank you for your reply, Professor. Do you have any case studies or links to refer to?

---

<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: [July 31, 2025, 2:59pm UTC](https://community.freefem.org/t/about-how-to-use-ddm-tool/4031/4 "2025-07-31T14:59:21Z")

</div>

Here are some: [FreeFem-sources/examples/hpddm at develop · FreeFem/FreeFem-sources · GitHub](https://github.com/FreeFem/FreeFem-sources/tree/develop/examples/hpddm) .
