# Multiple Coupling: ASSERTION FAILED / Eigen::VectorXd Storage::sample(double) const / usedDegree \>= 1

**URL:** <https://precice.discourse.group/t/multiple-coupling-assertion-failed-eigen-vectorxd-storage-sample-double-const-useddegree-1/2052>\
**Category:** Using preCICE\
**Tags:** openfoam, adapters, fsi\
**Created:** [August 4, 2024, 2:42pm UTC](https://precice.discourse.group/t/multiple-coupling-assertion-failed-eigen-vectorxd-storage-sample-double-const-useddegree-1/2052 "2024-08-04T14:42:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodolfo\_Puraca](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@Rodolfo\_Puraca](https://precice.discourse.group/u/Rodolfo_Puraca)\
**Post date:** [August 4, 2024, 2:42pm UTC](https://precice.discourse.group/t/multiple-coupling-assertion-failed-eigen-vectorxd-storage-sample-double-const-useddegree-1/2052/1 "2024-08-04T14:42:43Z")

</div>

Hello,

I am developing an adapter using preCICE for the Giraffe solver which is an FEM that uses beam elements, similar to the MBDyn, to do FSI couple with OpenFOAM. I ran the single perpendicular flap and the Turek benchmark without problems using both explicity and implicity couplings.

But when I tried to run the multiple perpendicular flap case, I am facing an error with description of ASSERTION FAILED, similar to what was reported in this Topic of the preCICE forum: [preCICE/Official adapters and tutorials: ASSERTION FAILED usedDegree \>= 1](https://precice.discourse.group/t/assertion-failed-useddegree-1/2040). This error hapens when my adapter requires the preCICE forces calculated by OpenFOAM, in the very first iteration:

```c++
// read forces from preCICE
std::cout << "[Giraffe-adapter] Reading forces from preCICE" << std::endl;
participant->readData(meshName, readDataName, nodesIDs, dt , preCICE_Forces);

```

Leading to this error:

```c++
ASSERTION FAILED
Location: Eigen::VectorXd precice::time::Storage::sample(double) const
File: /home/rodolfo/programas/precice-3.1.2/src/time/Storage.cpp:199
Expression: usedDegree >= 1
Rank: 0
Arguments: none

```

This happens in both terminals executing the solid part.

I would like any help, because I don’t know if is a problem in my adapter that is not yet prepared for multiple coupling or a configuration or code problem of preCICE.

Thanks,  
Rodolfo Curci Puraca

[precice-config.xml](https://precice.discourse.group/uploads/short-url/1V9l2CjyZESoQUjeZE4GocUzxow.xml) (4.7 KB)  
[Solid\_1\_error\_log.txt](https://precice.discourse.group/uploads/short-url/7tZmGCdh9vVbxFY5wFI4hLqFQI4.txt) (4.3 KB)  
[Solid\_2\_error\_log.txt](https://precice.discourse.group/uploads/short-url/7EwHIyQZpBpiVt2zgGILgCIYoIo.txt) (4.3 KB)

---

<div class="post-metadata">

**Author:** ![LRanatomy](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@LRanatomy](https://precice.discourse.group/u/LRanatomy)\
**Post date:** [August 4, 2024, 4:13pm UTC](https://precice.discourse.group/t/multiple-coupling-assertion-failed-eigen-vectorxd-storage-sample-double-const-useddegree-1/2052/2 "2024-08-04T16:13:43Z")

</div>

> [@Rodolfo\_Puraca](#):
>
> uld like any help, because I don’t know if is a problem in my adapter that is not yet prepared for multiple coupling or a configuration or code problem of preCIC

Hi Rodolfo,

I am the original poster of the linked post. I managed to mix my issue by re-arranging the mapping in the .xml file.

You have them all under the fluid participant. I changed mine to have the fluid mapping ‘read’ both solid meshes and have each solid mesh ‘read’ the fluid mesh.

I’m not an expert but this worked for me and might be worth trying in your case.

Bw,  
Luke

---

<div class="post-metadata">

**Author:** ![Rodolfo\_Puraca](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@Rodolfo\_Puraca](https://precice.discourse.group/u/Rodolfo_Puraca)\
**Post date:** [August 4, 2024, 5:32pm UTC](https://precice.discourse.group/t/multiple-coupling-assertion-failed-eigen-vectorxd-storage-sample-double-const-useddegree-1/2052/3 "2024-08-04T17:32:39Z")

</div>

Hi Luke,

Yes, it worked! Thanks!

Attached is how the precice-config.xml looks after the changes.

[precice-config.xml](https://precice.discourse.group/uploads/short-url/zl2cmz5zm7os4J6Dbng5XTky7W6.xml) (4.7 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:** [August 5, 2024, 5:34am UTC](https://precice.discourse.group/t/multiple-coupling-assertion-failed-eigen-vectorxd-storage-sample-double-const-useddegree-1/2052/4 "2024-08-05T05:34:28Z")

</div>

It helps to [visualize the configuration](https://precice.org/tooling-config-visualization.html).

Wrong config:

 ![config-wrong](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/5/54a015867631fc25d24d5d5cf96ae9390b049f6a.png)

Correct config:

 ![config-correct](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/3/34d6439bdc4c494bcd3a2ca0a198ec8ec193e36c.png)

I opened an issue to improve the error handling here:

> <https://github.com/precice/precice/issues/2063>
>
> This assertion in the samples:
> 
> https://github.com/precice/precice/blob/v3.1.2…/src/time/Storage.cpp#L193
> 
> Was encountered by two users with wrong configs:
> 
> \`\`\`
> ASSERTION FAILED
> Location: Eigen::VectorXd precice::time::Storage::sample(double) const
> File: /home/rodolfo/programas/precice-3.1.2/src/time/Storage.cpp:199
> Expression: usedDegree \>= 1
> Rank: 0
> Arguments: none
> \`\`\`
> 
> https://precice.discourse.group/t/multiple-coupling-assertion-failed-eigen-vectorxd-storage-sample-double-const-useddegree-1/2052
> 
> https://precice.discourse.group/t/assertion-failed-useddegree-1/2040 
> 
> The main issue seems to be applying a read mapping to a received mesh:
> 
> !\[config-wrong\](https://github.com/user-attachments/assets/836e1b80-fe01-4afc-8ba0-4b3013f5418c)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/67d2a5fa6f80e597e2267ff17fa8c1673cd11caa.svg) [@system](https://precice.discourse.group/u/system)\
**Post date:** [August 8, 2024, 5:35am UTC](https://precice.discourse.group/t/multiple-coupling-assertion-failed-eigen-vectorxd-storage-sample-double-const-useddegree-1/2052/5 "2024-08-08T05:35:00Z")

</div>

Closed on August 8, 2024, 5:35am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
