# How to write a coupled code and a preCICE configuration file

**URL:** https://precice.discourse.group/t/how-to-write-a-coupled-code-and-a-precice-configuration-file/2390
**Category:** Using preCICE
**Tags:** configuration
**Created:** [March 26, 2025, 7:44am UTC](https://precice.discourse.group/t/how-to-write-a-coupled-code-and-a-precice-configuration-file/2390 "2025-03-26T07:44:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Carl](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@Carl](https://precice.discourse.group/u/Carl)
#### Post date: [March 26, 2025, 7:44am UTC](https://precice.discourse.group/t/how-to-write-a-coupled-code-and-a-precice-configuration-file/2390/1 "2025-03-26T07:44:16Z")

</div>

I want to use a simple example code I wrote to couple, but I don’t know how to write a configuration file. Please help me to see, what is missing from my config file. Thank you  
[precice-config.txt](https://precice.discourse.group/uploads/short-url/lTeSwjJygAW9C6PybcG1ObiMK2X.txt) (1.4 KB)  
[solver\_a.txt](https://precice.discourse.group/uploads/short-url/bMWjcHh43FdDaNC8WscWAdhZULC.txt) (1.3 KB)  
[solver\_b.txt](https://precice.discourse.group/uploads/short-url/vbUAi2CzI6trbvSKJB8gaurUbnf.txt) (1.3 KB)

---

<div class="post-metadata">

### Author: ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)
#### Post date: [April 1, 2025, 7:08am UTC](https://precice.discourse.group/t/how-to-write-a-coupled-code-and-a-precice-configuration-file/2390/2 "2025-04-01T07:08:37Z")

</div>

Hi @Carl,

I left this question unanswered for a bit, to encourage others to engage, as one can easily write a lot about it.

The general guide for coupling your code is here:

> **[Couple your code](https://precice.org/couple-your-code-overview.html)**

This is how your current config file looks like schematically (generated with the [config visualizer](https://precice.org/tooling-config-visualization.html)):

 ![precice-config](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/1/143c014bc9d2a2d88987a6f59111061da7354c72.png)

Looks like you are currently missing a [mapping](https://precice.org/configuration-mapping.html).

Note that you can also use `precice-tools` to check your configuration for such issues. In this case, however, it does not detect the missing mapping as an issue (this is allowed, but probably not what you want):

```shell
$ precice-tools check precice-config.xml 
Checking precice-config.xml for syntax and basic setup issues...
No major issues detected

```

We are working on a [more elaborate configuration checker](https://github.com/precice-forschungsprojekt/config-checker) for such issues, as well as on auto-generating configuration files. These are all topics to discuss in the next [preCICE workshop](https://precice.org/precice-workshop.html).
